Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing single quote escaping when singleQuotedAttributeValue is enabled #291

Open
mdk000 opened this issue Sep 30, 2024 · 0 comments
Open

Comments

@mdk000
Copy link
Contributor

mdk000 commented 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

@mdk000 mdk000 changed the title Missing single quote escaping when quotedAttributeValueSyntax is enabled Missing single quote escaping when singleQuotedAttributeValue is enabled Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant