Skip to main content
CRITICAL

CVE-2021-21353

CVSS v3

9

CRITICAL

EPSS Score

4.3 %

exploit probability, as of 2026-10-19

CISA KEV

No

known exploited

Exploitation

—

SSVC status

Get an alert for each new CVE published for pug.

Set up CVE WatchFree account · no credit card

Affected and fixed versions

Packages from OSV.dev and products from the vendors' CSAF advisories.

version not verifiedVersions not verified: read as OSV.dev and the vendors publish them, not checked against each vendor's release list.

Packages

  • pugnpmall versions · fixed in 3.0.1
  • pug-code-gennpmfrom 3.0.0 · fixed in 3.0.2

Vendor advisories

  • CVE-2021-21353 Red Hat Product Security1 known affected

    pug: user provided objects as input to pug templates can achieve remote code execution

    openshift-logging/kibana6-rhel8 as a component of Logging Subsystem for Red Hat OpenShift

Full record on NVD

Description

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 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 `pretty` option, e.g. if you compile templates in advance before applying user input to them, you do not need to upgrade.

Technical details

Published
2021-03-03

Frequently asked questions

What is CVE-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 `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 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 `pretty` option, e.g. if you compile templates in advance before applying user input to them, you do not need to upgrade.

Is CVE-2021-21353 actively exploited?

Active exploitation of CVE-2021-21353 has not been confirmed. Its EPSS score was 4.3% on 2026-10-19, the estimated probability of exploitation in the next 30 days.

What is the CVSS score for CVE-2021-21353?

CVE-2021-21353 has a CVSS v3 base score of 9 (CRITICAL severity).

Running pug? Hear about its next vulnerability

CVE Watch matches each new CVE to the vendors and products you list (vendor and product, not the version) and puts it in your alerts with its KEV and EPSS status.

Already have an account? Open CVE WatchNo credit card required · No monthly cap on website lookups · 250 API requests/month