Open
Description
Just found that this expression is valid according to escodegen:
!{
"type": "TemplateLiteral",
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"value": {
"raw": "hello ${prompt('I CAN DO XSS')}!"
}
}
]
}
The string is not parsed and it's processed into output code as is. I think that it should be an error. This can lead into injection of JavaScript code and escaping from sandbox depending on how the application is using this library.
Just found it in my project https://gaiman.js.org/ just type code:
echo "hello ${prompt('I CAN DO XSS')}!"
I think that I will report this to NPM or GitHub.
EDIT: I think that only maintainer of the package can report Security Advisory.
Metadata
Metadata
Assignees
Labels
No labels