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

Sanitize Vue.js scripts #515

Closed
gmarzaloni-onit opened this issue Dec 13, 2023 · 1 comment
Closed

Sanitize Vue.js scripts #515

gmarzaloni-onit opened this issue Dec 13, 2023 · 1 comment

Comments

@gmarzaloni-onit
Copy link

Hello,
HtmlSanitizer is not sanitize this example Vue.js script code:

{{$on.constructor('alert(1)')()}}

This code, placed for example in a OPTION item, creates a XSS vulnerability on the page.

<select>
  <option value="1">Item 1 {{$on.constructor(&#x27;alert(1)&#x27;)()}}</option>
  <option value="2">Item 2</option>
</select>

On load, the page shows the modal alert.

image
@mganss
Copy link
Owner

mganss commented Dec 13, 2023

This scenario is out of scope as we only deal with HTML, not specific frameworks that have their own syntax. That said, the upcoming change in #511 would probably allow you to handle this use case. In the current version you can probably use the PostProcessNode event to enable this use case.

@mganss mganss closed this as completed Dec 13, 2023
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

2 participants