CVE-2026-142701: Squirrelly before 10.0.0 XSS via autoEscape Override in renderFile
Squirrelly before 10.0.0 contains a cross-site scripting vulnerability that allows remote attackers to disable HTML escaping by supplying engine options in render data passed to renderFile. Attackers can submit keys like autoEscape: false in user-controlled data such as Express req.body to inject script, which persists for later renders when template caching is enabled.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 10.0.0
Event History
Frequently Asked Questions
Which applications are exposed to this issue?
Applications using npm/squirrelly before 10.0.0 are exposed when they pass user-controlled render data to renderFile. A relevant example is passing Express req.body directly or indirectly as render data.
What must an attacker be able to do to exploit it?
The attacker needs to submit data that reaches renderFile as engine options. They can supply a key such as autoEscape: false, causing HTML escaping to be disabled and allowing script injection.
Does template caching change the impact?
Yes. When template caching is enabled, the escaping override can persist and affect later renders, potentially impacting users who did not submit the malicious data.
What can be done if upgrading is not immediately possible?
Do not pass untrusted request data directly to renderFile as render data or engine options. Filter or construct the render-data object so attacker-controlled input cannot set engine option keys such as autoEscape.