Closed genetus closed 1 year ago
If we tryind to validate HTML code like this:
<video controls="controls" width="300" height="150"> <source src="https://leonardo.osnova.io/49ab16a3-64a6-505e-97f1-34c83f122a49/-/preview/700/-/format/webp/" /> <source src="https://leonardo.osnova.io/49ab16a3-64a6-505e-97f1-34c83f122a49/-/preview/700/-/format/webp/" /> </video>
We got an XSS error rise. Howewer it is an valid HTML code, with allowed tags: video & sorce.
$html = <<<HTML <video controls="controls" width="300" height="150"> <source src="https://leonardo.osnova.io/49ab16a3-64a6-505e-97f1-34c83f122a49/-/preview/700/-/format/webp/" /> <source src="https://leonardo.osnova.io/49ab16a3-64a6-505e-97f1-34c83f122a49/-/preview/700/-/format/webp/" /> </video> HTML; $antiXss = new AntiXSS(); $antiXss->removeEvilHtmlTags(['video', 'sorce']); $antiXss->xss_clean($html); var_dump($antiXss->isXssFound());
On validation system check a valid src attribute in tag and this is what this regexp finds:
src="https://leonardo.osnova.io/49ab16a3-64a6-505e-97f1-34c83f122a49/-/preview/700/-/format/webp/" /
Obviously the last / is ambiguous and it show only, that this tag is closed.
/
$antiXss->removeEvilHtmlTags(['video', 'sorce']);
spelling of source.
Thanks for the bug report, fixed in version: 4.1.40 (2023-02-11)
What is this feature about (expected vs actual behaviour)?
If we tryind to validate HTML code like this:
We got an XSS error rise. Howewer it is an valid HTML code, with allowed tags: video & sorce.
How can I reproduce it?
Any additional information?
On validation system check a valid src attribute in tag and this is what this regexp finds:
Obviously the last
/
is ambiguous and it show only, that this tag is closed.