Vulnerabilities

Vulnerability · CVE-2021-21353

Pug is an npm package which is a high-performance template engine.

Published Mar 3, 2021 · catalog updated Nov 2, 2026 · Pug is an npm

Last checked Nov 6, 2026. A connected source was read within the last 7 days.

Check if you run it

No confirmed exploitation is on record for CVE-2021-21353. EPSS is 4.27%. Act only if a listed version of Pug is an npm is installed.

Gaps on this record

  • The stored product name is a package slug. The name on this page is taken from the title (Pug is an npm).
  • No vendor fix or required action is stored. Compare the linked advisory before you change production.
Severity
Critical9.0
Known exploitation
Not in CISA/VulnCheck KEV
EPSS
4.27%
Remediation
Version ranges on file
Affected products
cpe pugjs/pug · cpe pugjs/pug-code-gen

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 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 packages including "pug", "pug-code-gen". pug-code-gen has a backported fix at version 2.0.3. This advisory is not exploitable if there is no way for un-trusted input to be passed to pug as the option, e.g. if you compile templates in advance before applying user input to them, you do not need to upgrade.

Are you affected?

Enter the version you run. The result uses only the ranges stored on this record.

The check returns affected, not affected, or incomplete. It does not guess a version that is missing from the record.

  • cpe pugjs/pug< 3.0.1
  • cpe pugjs/pug-code-gen< 2.0.3
  • cpe pugjs/pug-code-gen< 3.0.2

How to fix CVE-2021-21353

What to do

Three questions, each answered from this record only. Confirm the vendor advisory before you patch.

Should you patch?

No confirmed exploitation is on record for CVE-2021-21353. EPSS is 4.27%. Act only if a listed version of Pug is an npm is installed.

Which versions are affected?

Compare what you have installed with < 3.0.1, < 2.0.3, < 3.0.2. Compare the installed version with the linked vendor advisory before you change production.

What should an analyst verify?

CWE-74: Injection; CWE-94: Code Injection. EPSS 4.27%. There is no CISA KEV listing. No Exploit-DB or Metasploit reference is linked. Use the source links for the original advisory.

Code

The project this record applies to. Exploit listings stay in References.

Timeline

Detection, updates, and resolution for this record.

  1. Mar 3, 2021 · NIST NVD

    Detected

    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 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. Thi

  2. Nov 2, 2026 · NIST NVD

    Updated

    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 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. Thi

Sources

  • CVE.orgVulnerability recordCVE-2021-21353

    Official CVE identifier

    cve.org
  • FIRST EPSSExploitation probabilityCVE-2021-21353

    30-day exploitation probability 4.27%

    first.org
  • NIST NVDVulnerability recordCVE-2021-21353

    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 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 temp

    nvd.nist.gov

References

Freshness

Last verified in this catalog Nov 6, 2026. Significant claims (KEV, EPSS, CVSS, affected ranges) come from the source rows above — open the original publisher for the authoritative advisory.

  • FIRST EPSSNov 6, 2026
  • CVE.orgNov 4, 2026
  • NIST NVDNov 2, 2026