{"cve":"CVE-2021-21353","nvd":{"published":"2021-03-03T02:15:13.143","modified":"2026-06-17T03:35:22.490","status":"Analyzed","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_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H","score":9.0},"cwes":["CWE-94","CWE-74"],"references":["https://github.com/pugjs/pug/commit/991e78f7c4220b2f8da042877c6f0ef5a4683be0","https://github.com/pugjs/pug/issues/3312","https://github.com/pugjs/pug/pull/3314","https://github.com/pugjs/pug/releases/tag/pug%403.0.1","https://github.com/pugjs/pug/security/advisories/GHSA-p493-635q-r6gr"],"products":["pugjs:pug","pugjs:pug-code-gen"],"source":"nvd","synced_at":"2026-10-19T21:15:50.279857260+00:00"},"epss":{"cve":"CVE-2021-21353","score":0.04305,"percentile":0.9115,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-p493-635q-r6gr","url":"https://osv.dev/vulnerability/GHSA-p493-635q-r6gr","summary":"Remote code execution via the `pretty` option.","modified":"2026-09-10T03:49:14.371503003Z","packages":[{"ecosystem":"npm","name":"pug","purl":"pkg:npm/pug","ranges":["<3.0.1"],"fixed":["3.0.1"]},{"ecosystem":"npm","name":"pug-code-gen","purl":"pkg:npm/pug-code-gen","ranges":["<2.0.3"],"fixed":["2.0.3"]},{"ecosystem":"npm","name":"pug-code-gen","purl":"pkg:npm/pug-code-gen","ranges":[">=3.0.0 <3.0.2"],"fixed":["3.0.2"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}