CVE-2021-21353

MEDIUM 1 PoC
MEDIUM Priority: 0.29 BB Relevance: 74/100
Published: 2021-03-03 Modified: 2026-11-02 First seen: 2026-11-02 Status: active

Attack Surface

Network No Auth No Interaction Integ. Impact Scope Change

CVSS Vector Breakdown

AV: Network
AC: High
PR: None
UI: None
S: Changed
C: None
I: High
A: None

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.

Weakness Classification (2)

Affected Software (3)

VendorProductVersion
pugjs pug < 3.0.1
pugjs pug < 3.0.1
pugjs pug-code-gen < 2.0.3

References & Advisories (7)

https://github.com/pugjs/pug/releases/tag/pug%403.0.1
Release Notes Third Party Advisory
https://www.npmjs.com/package/pug
Product Third Party Advisory
https://www.npmjs.com/package/pug-code-gen
Product Third Party Advisory
https://github.com/pugjs/pug/pull/3314
Patch Third Party Advisory
https://github.com/pugjs/pug/issues/3312
Exploit Patch Third Party Advisory

Proof of Concept (1)

Bug Bounty Relevance

74 / 100
✓ Network accessible
✓ No authentication
✓ No user interaction
✓ PoC available (1)

CVSS Score

6.8 / 10.0 v3.1
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:H/A:N

EPSS — Exploitation Probability

4.27%
Raw Score 0.042690
Percentile 91.2%
Date 2026-11-13

EPSS Trend

2026-11-13
0.04269
2026-11-12
0.04269
2026-11-10
0.04269
2026-11-09
0.04269
2026-11-08
0.04269
2026-11-07
0.04269
2026-11-06
0.04269
2026-11-05
0.04269
2026-11-04
0.04269
2026-11-03
0.04269
2026-11-02
0.04305

Intelligence Sources

mitre ref →
nvd ref →