CVE-2021-21353

Source
https://cve.org/CVERecord?id=CVE-2021-21353
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-21353.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2021-21353
Aliases
Related
Published
2021-03-03T02:15:13.143Z
Modified
2026-02-13T08:42:20.792929Z
Severity
  • 9.0 (Critical) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H CVSS Calculator
Summary
[none]
Details

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.

References

Affected packages

Git / github.com/pugjs/pug

Affected ranges

Type
GIT
Repo
https://github.com/pugjs/pug
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Fixed
Introduced
Fixed

Affected versions

pug-attrs@3.*
pug-attrs@3.0.0
pug-code-gen@3.*
pug-code-gen@3.0.0
pug-code-gen@3.0.1
pug-error@2.*
pug-error@2.0.0
pug-filters@4.*
pug-filters@4.0.0
pug-lexer@5.*
pug-lexer@5.0.0
pug-linker@4.*
pug-linker@4.0.0
pug-load@3.*
pug-load@3.0.0
pug-parser@6.*
pug-parser@6.0.0
pug-runtime@3.*
pug-runtime@3.0.0
pug-strip-comments@2.*
pug-strip-comments@2.0.0
pug-walk@2.*
pug-walk@2.0.0
pug@3.*
pug@3.0.0

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-21353.json"