Skip to content

Commit 0b3d129

Browse files
committed
update php parser2
1 parent a5a8a48 commit 0b3d129

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

source/_posts/PHP HTML parser differential due to libxml2 lack of HTML5 support.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@ Parsing the following string will render an xss tag in the browser but not in PH
6262
* `<!DOCTYPE HTML SYSTEM "><xss>">`
6363

6464
#### 5. element name starting with underscrool
65-
65+
According to the [XML specification](https://www.w3schools.com/xml/xml_elements.asp#:~:text=can%20have%20attributes.-,XML%20Naming%20Rules,-XML%20elements%20must) `Element names must start with a letter or underscore`, unlike [HTML](https://html.spec.whatwg.org/#syntax-tag-name) where tags must start with ASCII alphanumerics.
66+
```
67+
Input: <p><_test>/<p>
68+
HTML output: <p>&lt;_test/&gt;/<p>
69+
XML output: <p><_test/>/<p>
70+
```
6671

6772
### Impact
6873
Sanitizers using the built-in PHP parser are inherently vulnerable to bypass due to wrong parsing.

0 commit comments

Comments
 (0)