Skip to content

Commit 6253ada

Browse files
committed
Warn about parsing user-generated HTML
1 parent a798171 commit 6253ada

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/PhpWord/Shared/Html.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ class Html
3434
* Add HTML parts.
3535
*
3636
* Note: $stylesheet parameter is removed to avoid PHPMD error for unused parameter
37+
* Warning: Do not pass user-generated HTML here, as that would allow an attacker to read arbitrary
38+
* files or perform server-side request forgery by passing local file paths or URLs in <img>.
3739
*
3840
* @param \PhpOffice\PhpWord\Element\AbstractContainer $element Where the parts need to be added
3941
* @param string $html The code to parse

0 commit comments

Comments
 (0)