You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After introducing new option with support for single-quoted attribute value syntax (#287) I've encountered a gap when this option is enabled.
During lack of escaping of single quote char in attribute value, we can pass a code like this: <img src="/url' onerror='alert(1)'" /> and the output is <img src='/url' onerror='alert(1)'' /> which of course is not a result we wanted to be.
I've created a PR (#290) which adds an additional escaping for single quote char.
Please take a look
The text was updated successfully, but these errors were encountered:
mdk000
changed the title
Missing single quote escaping when quotedAttributeValueSyntax is enabled
Missing single quote escaping when singleQuotedAttributeValue is enabled
Sep 30, 2024
Hello @leizongmin
After introducing new option with support for single-quoted attribute value syntax (#287) I've encountered a gap when this option is enabled.
During lack of escaping of single quote char in attribute value, we can pass a code like this:
<img src="/url' onerror='alert(1)'" />
and the output is<img src='/url' onerror='alert(1)'' />
which of course is not a result we wanted to be.I've created a PR (#290) which adds an additional escaping for single quote char.
Please take a look
The text was updated successfully, but these errors were encountered: