CVE-2021-21353: Pug is an npm package which is a high-performance template engine
CVE-2021-21353 is a medium-severity flaw (CVSS 6.8) affecting pug, pug-code-gen. Below: why it ranks where it does, which versions are affected, what to do, and the exact commands.
Pug is an npm package which is a high-performance template engine. In pug before version 3.0.1, if a remote attacker was able to control the `pretty` option of the pug compiler, e.g. if you spread a user provided object such as the query parameters of a request into the pug template inputs, it was possible for them to achieve remote code execution on the node.js backend. This is fixed in version 3.0.1. This advisory applies to multiple pug pack
Why this priority
- EPSS top 9%: very likely to be exploited
- Public exploit reference
- Remotely exploitable, no login, no user action
A fixed release or distro patch exists.
Last updated 2026-06-17 · Sources: CVE Program, NVD, CISA KEV, EPSS and vendor advisories · How we score
Am I affected?
Timeline
- Published CVE record published
- Updated Record last modified
Scores and fixes here are computed automatically from those and other public sources. Confirm with the vendor advisory before changing production systems.
Quick answers
How do I fix CVE-2021-21353?
pug: upgrade to 3.0.1; pug-code-gen: upgrade to 2.0.3, 3.0.2. Exact commands for each OS are on this page.
Is CVE-2021-21353 being exploited?
CVE-2021-21353 is not on the CISA Known Exploited Vulnerabilities list at the time of the last update. Check again, as this can change.
What does CVE-2021-21353 affect?
CVE-2021-21353 affects pug, pug-code-gen. Severity is medium (CVSS 6.8). Pug is an npm package which is a high-performance template engine. In pug before version 3.0.1, if a remote attacker was able to control the `pretty` option of the pug compiler, e.g. if you spread a user provided object such as the query p
How urgent is CVE-2021-21353?
Priority 57/100. EPSS top 9%: very likely to be exploited; Public exploit reference; Remotely exploitable, no login, no user action
Software pages
Node.js vulnerabilities · npm packages vulnerabilities