{"affected":[{"product":"pug","source":"CNA: GitHub_M","vendor":"pugjs","versions":[{"status":"affected","version":"< 3.0.1"}]},{"defaultStatus":"unaffected","ecosystem":"npm","packageName":"pug","product":"pug","source":"OSV GHSA-p493-635q-r6gr","vendor":"","versions":[{"events":[{"introduced":"0"},{"fixed":"3.0.1"}],"lessThan":"3.0.1","status":"affected","version":"0","versionType":"semver"}]},{"defaultStatus":"unaffected","ecosystem":"npm","packageName":"pug-code-gen","product":"pug-code-gen","source":"OSV GHSA-p493-635q-r6gr","vendor":"","versions":[{"events":[{"introduced":"0"},{"fixed":"2.0.3"}],"lessThan":"2.0.3","status":"affected","version":"0","versionType":"semver"}]},{"defaultStatus":"unaffected","ecosystem":"npm","packageName":"pug-code-gen","product":"pug-code-gen","source":"OSV GHSA-p493-635q-r6gr","vendor":"","versions":[{"events":[{"introduced":"3.0.0"},{"fixed":"3.0.2"}],"lessThan":"3.0.2","status":"affected","version":"3.0.0","versionType":"semver"}]}],"cveId":"CVE-2021-21353","cwes":["CWE-74"],"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.","epss":{"date":"2026-11-02","percentile":0.9115,"score":0.04305},"exploits":[],"kev":null,"metrics":[{"score":6.8,"severity":"medium","source":"CNA: GitHub_M","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:H/A:N","version":"3.1"}],"modifiedAt":1793642395421,"publishedAt":1614736218000,"references":[{"source":"CNA: GitHub_M","tags":["x_refsource_CONFIRM"],"url":"https://github.com/pugjs/pug/security/advisories/GHSA-p493-635q-r6gr"},{"source":"CNA: GitHub_M","tags":["x_refsource_MISC"],"url":"https://github.com/pugjs/pug/issues/3312"},{"source":"CNA: GitHub_M","tags":["x_refsource_MISC"],"url":"https://github.com/pugjs/pug/pull/3314"},{"source":"CNA: GitHub_M","tags":["x_refsource_MISC"],"url":"https://github.com/pugjs/pug/commit/991e78f7c4220b2f8da042877c6f0ef5a4683be0"},{"source":"CNA: GitHub_M","tags":["x_refsource_MISC"],"url":"https://github.com/pugjs/pug/releases/tag/pug%403.0.1"},{"source":"CNA: GitHub_M","tags":["x_refsource_MISC"],"url":"https://www.npmjs.com/package/pug"},{"source":"CNA: GitHub_M","tags":["x_refsource_MISC"],"url":"https://www.npmjs.com/package/pug-code-gen"},{"source":"ADP: CVE","tags":["x_refsource_CONFIRM","x_transferred"],"url":"https://github.com/pugjs/pug/security/advisories/GHSA-p493-635q-r6gr"},{"source":"ADP: CVE","tags":["x_refsource_MISC","x_transferred"],"url":"https://github.com/pugjs/pug/issues/3312"},{"source":"ADP: CVE","tags":["x_refsource_MISC","x_transferred"],"url":"https://github.com/pugjs/pug/pull/3314"},{"source":"ADP: CVE","tags":["x_refsource_MISC","x_transferred"],"url":"https://github.com/pugjs/pug/commit/991e78f7c4220b2f8da042877c6f0ef5a4683be0"},{"source":"ADP: CVE","tags":["x_refsource_MISC","x_transferred"],"url":"https://github.com/pugjs/pug/releases/tag/pug%403.0.1"},{"source":"ADP: CVE","tags":["x_refsource_MISC","x_transferred"],"url":"https://www.npmjs.com/package/pug"},{"source":"ADP: CVE","tags":["x_refsource_MISC","x_transferred"],"url":"https://www.npmjs.com/package/pug-code-gen"},{"source":"OSV / GitHub Security Advisories","tags":["advisory"],"url":"https://github.com/advisories/GHSA-p493-635q-r6gr"},{"source":"OSV / GitHub Security Advisories","tags":["osv"],"url":"https://osv.dev/vulnerability/GHSA-p493-635q-r6gr"}],"remediation":[{"kind":"fix","source":"OSV GHSA-p493-635q-r6gr","text":"pug (npm): OSV reports a fixed version 3.0.1. Check the advisory for supported release branches.","url":"https://github.com/advisories/GHSA-p493-635q-r6gr"},{"kind":"fix","source":"OSV GHSA-p493-635q-r6gr","text":"pug-code-gen (npm): OSV reports a fixed version 2.0.3. Check the advisory for supported release branches.","url":"https://github.com/advisories/GHSA-p493-635q-r6gr"},{"kind":"fix","source":"OSV GHSA-p493-635q-r6gr","text":"pug-code-gen (npm): OSV reports a fixed version 3.0.2. Check the advisory for supported release branches.","url":"https://github.com/advisories/GHSA-p493-635q-r6gr"}],"revision":"8df98c62d4e85f7b1523698a69093a275bfad0c4031517f4bc6f55b38b0c5fc2","sources":[{"modifiedAt":1793642395421,"name":"CNA: GitHub_M","retrievedAt":1793642925748,"url":"https://www.cve.org/CVERecord?id=CVE-2021-21353"},{"modifiedAt":1789012154371,"name":"OSV / GitHub Security Advisories","retrievedAt":1793642926808,"url":"https://osv.dev/vulnerability/GHSA-p493-635q-r6gr"},{"modifiedAt":null,"name":"FIRST EPSS","retrievedAt":1793642931531,"url":"https://api.first.org/data/v1/epss?cve=CVE-2021-21353"}],"ssvc":{"assessedAt":1793642385476,"automatable":"no","exploitation":"none","source":"ADP: CISA-ADP","technicalImpact":"total"},"status":"published","title":"Remote code execution in pug","updatedAt":1793642931531}