9

CVE-2021-21353: pugjs pug Injection

CVSS: 9.0v3.1CriticalAnalyzed
AliasesCGA-23g7-fxfh-cjxcCGA-3fxp-xqpm-wmf5CGA-7vr2-jc3p-7w7f
Published 03-03-2021Last modified 16-04-2025

Vulnerability summary

CVE-2021-21353 is a critical (CVSS 9.0) Injection vulnerability in pugjs pug. EPSS estimates a 4.30% chance of exploitation in the next 30 days, higher than 91% of scored vulnerabilities. 1 public exploit is recorded.

Overall risk
70/100
0100
High · default modelHow is this calculated?
CVSS score
9.0/10
010
Critical · v3.1 (NVD)
EPSS score
4.30%
0%100%
Low · 0.00 pp in 30 days
KEVNot listedIn no KEV catalog
RansomwareNone recordedNo known use recorded
Public exploits1github

Advisory lineage

Upstream 0 · Downstream 0 · Related 9

Timeline

  1. 03-03-2021
    PublishedVulnerability first disclosed.
  2. 16-04-2025
    Last modifiedVulnerability information updated.

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.

CVSS metrics

6 scores · 5 sources · 2 versions

EPSS trend

Probability

4.30%

Chance of exploitation in the next 30 days

Percentile

91%

Versus all other CVEs

30-day change

0.00 pp

From 4.30% on 19-09-2026

19-09-202619-10-2026
EPSS score
4.30%

Known exploited

Compare KEV catalogs

Not in any of the 3 tracked catalogs.

Public exploits

1 found
  • githubUnverified

    Pug

    Maturity: poc

Weaknesses

CWE · root cause

Affected systems

Chainguard72 products
  • code-serverAll versions (No fix recorded)
  • code-server-compatAll versions (No fix recorded)
  • commercial-gitlab-rails-ee-assets-19.1All versions (No fix recorded)
  • commercial-gitlab-rails-ee-assets-19.2All versions (No fix recorded)
  • commercial-gitlab-rails-ee-assets-19.3All versions (No fix recorded)
Npm2 products
  • pug< 3.0.1
  • pug-code-gen< 2.0.3 | ≥ 3.0.0, < 3.0.2
Pugjs2 products
Wolfi2 products
  • code-serverAll versions (No fix recorded)
  • code-server-compatAll versions (No fix recorded)

4 vendors · 78 products

References

8 links