KEVWire

Security intelligence, with context.

Response snapshot Nov 2, 2026, 19:26 UTC

Back to the wire
Permalink
VulnerabilityCVE-2021-21353

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

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.

At a glance

Exploited
Not known
Severity
6.8 Medium (CVSS 3.1)
Chance of exploitation
Not estimated
Sources
1 source

What to do

Check the vendor advisory for affected versions and fixes.

Read NVD CVE-2021-21353 (opens a new tab)

What happened

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.

Scores and how they were measured

CVSS base severity

6.8

Version 3.1As of

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:H/A:N

Measurement source (opens a new tab)

How bad it is if exploited. Not a prediction of exploitation or proof you are exposed.

EPSS probability

Not available

A model's estimate of exploitation in the next 30 days, not certainty or your own risk.

Related technology

Sources

  1. Primary source

    NVD CVE-2021-21353 (opens a new tab)

    NVD record: description, CVSS (the CNA score is preferred), affected products, and publication date. Not evidence of exploitation.

    Published Checked

  2. Primary source

    NVD CVE API 2.0 (opens a new tab)

    The NVD API page that supplied this CVE record.

    Published Date not suppliedChecked

  3. Primary source

    NVD CVE API 2.0 (opens a new tab)

    The NVD API page that supplied this CVE record.

    Published Date not suppliedChecked

  4. Primary source

    NVD CVE API 2.0 (opens a new tab)

    The NVD API page that supplied this CVE record.

    Published Date not suppliedChecked

Cite this record

For factual claims, cite the primary sources above; cite KEVWire for its compilation, dates, and classifications.

APA

KEVWire. (2026, November 2). Pug is an npm package which is a high-performance template engine. (CVE-2021-21353). https://kevwire.com/record/CVE-2021-21353

MLA

"Pug is an npm package which is a high-performance template engine. (CVE-2021-21353)." KEVWire, 2 Nov. 2026, kevwire.com/record/CVE-2021-21353.

Chicago

KEVWire. "Pug is an npm package which is a high-performance template engine. (CVE-2021-21353)." Last modified November 2, 2026. https://kevwire.com/record/CVE-2021-21353.

Evidence summary (plain text)

Pug is an npm package which is a high-performance template engine. (Mar 3, 2021).
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.
CVSS 6.8 (version 3.1; evidence as of Nov 2, 2026; https://nvd.nist.gov/vuln/detail/CVE-2021-21353).
Sources:
NVD CVE-2021-21353: https://nvd.nist.gov/vuln/detail/CVE-2021-21353
NVD CVE API 2.0: https://services.nvd.nist.gov/rest/json/cves/2.0?lastModStartDate=2026-11-02T17:56:05.581Z&lastModEndDate=2026-11-02T19:25:57.888Z&resultsPerPage=500&startIndex=0
NVD CVE API 2.0: https://services.nvd.nist.gov/rest/json/cves/2.0?lastModStartDate=2026-11-02T17:21:00.248Z&lastModEndDate=2026-11-02T18:55:57.389Z&resultsPerPage=500&startIndex=0
NVD CVE API 2.0: https://services.nvd.nist.gov/rest/json/cves/2.0?lastModStartDate=2026-11-02T16:46:03.426Z&lastModEndDate=2026-11-02T18:20:57.848Z&resultsPerPage=500&startIndex=0
Record ID: CVE-2021-21353.
Record origin: Ingested record.
AI evidence: Not assessed.
Known exploitation: Not assessed.
Zero-day status: Not assessed. KEV membership alone does not establish zero-day status.
About this data

This record was ingested from a data source. Retrieved: Nov 2, 2026, 19:25 UTC. Ingestion is not an independent editorial investigation.

NVD status: Analyzed. Publication in the NVD is not evidence of exploitation.

A CISA KEV listing documents known exploitation, not necessarily a zero-day; absence from the catalog does not prove a vulnerability has never been exploited.

Technology tags indicate possible relevance, not verified exposure. Confirm the affected product, version, and configuration against your own inventory; KEVWire does not scan your systems.

A personal reading checklist on this device, not verified remediation.

Record JSON

Your account

Email alerts

Email alerts are coming as part of KEVWire Premium: join the waitlist. To follow your stack today, use its RSS feed, which honors your filters, or connect an AI agent through the API.

Suggest an improvement

Ideas, missing sources, corrections, and bugs are all welcome. No account needed. Suggestions are reviewed by a person before anything changes.

Record details

Record detail