{"identifier":"CVE-2021-21353","cve":{"id":"CVE-2021-21353","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.","published":"2021-03-03T02:15:13.143000+00:00","modified":"2026-11-02T18:18:32.957000+00:00","status":"Analyzed","score":6.8,"severity":"MEDIUM","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:H/A:N","cvss_version":"3.1","affected":[{"criteria":"cpe:2.3:a:pugjs:pug:*:*:*:*:*:node.js:*:*","versionStartIncluding":"","versionStartExcluding":"","versionEndIncluding":"","versionEndExcluding":"3.0.1"},{"criteria":"cpe:2.3:a:pugjs:pug-code-gen:*:*:*:*:*:node.js:*:*","versionStartIncluding":"","versionStartExcluding":"","versionEndIncluding":"","versionEndExcluding":"2.0.3"},{"criteria":"cpe:2.3:a:pugjs:pug-code-gen:*:*:*:*:*:node.js:*:*","versionStartIncluding":"3.0.0","versionStartExcluding":"","versionEndIncluding":"","versionEndExcluding":"3.0.2"}],"weaknesses":["CWE-74","CWE-94"],"references":[{"url":"https://github.com/pugjs/pug/commit/991e78f7c4220b2f8da042877c6f0ef5a4683be0","source":"security-advisories@github.com","tags":["Patch","Third Party Advisory"]},{"url":"https://github.com/pugjs/pug/issues/3312","source":"security-advisories@github.com","tags":["Exploit","Patch","Third Party Advisory"]},{"url":"https://github.com/pugjs/pug/pull/3314","source":"security-advisories@github.com","tags":["Patch","Third Party Advisory"]},{"url":"https://github.com/pugjs/pug/releases/tag/pug%403.0.1","source":"security-advisories@github.com","tags":["Release Notes","Third Party Advisory"]},{"url":"https://github.com/pugjs/pug/security/advisories/GHSA-p493-635q-r6gr","source":"security-advisories@github.com","tags":["Third Party Advisory"]},{"url":"https://www.npmjs.com/package/pug","source":"security-advisories@github.com","tags":["Product","Third Party Advisory"]},{"url":"https://www.npmjs.com/package/pug-code-gen","source":"security-advisories@github.com","tags":["Product","Third Party Advisory"]},{"url":"https://github.com/pugjs/pug/commit/991e78f7c4220b2f8da042877c6f0ef5a4683be0","source":"af854a3a-2127-422b-91ae-364da2661108","tags":["Patch","Third Party Advisory"]},{"url":"https://github.com/pugjs/pug/issues/3312","source":"af854a3a-2127-422b-91ae-364da2661108","tags":["Exploit","Patch","Third Party Advisory"]},{"url":"https://github.com/pugjs/pug/pull/3314","source":"af854a3a-2127-422b-91ae-364da2661108","tags":["Patch","Third Party Advisory"]},{"url":"https://github.com/pugjs/pug/releases/tag/pug%403.0.1","source":"af854a3a-2127-422b-91ae-364da2661108","tags":["Release Notes","Third Party Advisory"]},{"url":"https://github.com/pugjs/pug/security/advisories/GHSA-p493-635q-r6gr","source":"af854a3a-2127-422b-91ae-364da2661108","tags":["Third Party Advisory"]},{"url":"https://www.npmjs.com/package/pug","source":"af854a3a-2127-422b-91ae-364da2661108","tags":["Product","Third Party Advisory"]},{"url":"https://www.npmjs.com/package/pug-code-gen","source":"af854a3a-2127-422b-91ae-364da2661108","tags":["Product","Third Party Advisory"]}],"kev":null,"kev_checked":true,"metrics":{"cvssMetricV31":[{"source":"security-advisories@github.com","type":"Secondary","cvssData":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:H/A:N","baseScore":6.8,"baseSeverity":"MEDIUM","attackVector":"NETWORK","attackComplexity":"HIGH","privilegesRequired":"NONE","userInteraction":"NONE","scope":"CHANGED","confidentialityImpact":"NONE","integrityImpact":"HIGH","availabilityImpact":"NONE"},"exploitabilityScore":2.2,"impactScore":4.0},{"source":"nvd@nist.gov","type":"Primary","cvssData":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H","baseScore":9.0,"baseSeverity":"CRITICAL","attackVector":"NETWORK","attackComplexity":"HIGH","privilegesRequired":"NONE","userInteraction":"NONE","scope":"CHANGED","confidentialityImpact":"HIGH","integrityImpact":"HIGH","availabilityImpact":"HIGH"},"exploitabilityScore":2.2,"impactScore":6.0}],"cvssMetricV2":[{"source":"nvd@nist.gov","type":"Primary","cvssData":{"version":"2.0","vectorString":"AV:N/AC:M/Au:N/C:P/I:P/A:P","baseScore":6.8,"accessVector":"NETWORK","accessComplexity":"MEDIUM","authentication":"NONE","confidentialityImpact":"PARTIAL","integrityImpact":"PARTIAL","availabilityImpact":"PARTIAL"},"baseSeverity":"MEDIUM","exploitabilityScore":8.6,"impactScore":6.4,"acInsufInfo":false,"obtainAllPrivilege":false,"obtainUserPrivilege":false,"obtainOtherPrivilege":false,"userInteractionRequired":false}],"ssvcV203":[{"source":"134c704f-9b21-4f2e-91b3-4a467353bcc0","ssvcData":{"timestamp":"2026-11-02T17:59:45.476555Z","id":"CVE-2021-21353","options":[{"exploitation":"none"},{"automatable":"no"},{"technicalImpact":"total"}],"role":"CISA Coordinator","version":"2.0.3"}}]},"configurations":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:a:pugjs:pug:*:*:*:*:*:node.js:*:*","versionEndExcluding":"3.0.1","matchCriteriaId":"AE43CE50-8DE8-4487-BCCB-9E3931241EB2"},{"vulnerable":true,"criteria":"cpe:2.3:a:pugjs:pug-code-gen:*:*:*:*:*:node.js:*:*","versionEndExcluding":"2.0.3","matchCriteriaId":"F0CD8CA7-F670-4B0A-9639-E7D60F401DBB"},{"vulnerable":true,"criteria":"cpe:2.3:a:pugjs:pug-code-gen:*:*:*:*:*:node.js:*:*","versionStartIncluding":"3.0.0","versionEndExcluding":"3.0.2","matchCriteriaId":"55FCB9F1-8C93-474D-9137-CB14C8F9F05E"}]}]}],"source":"nvd","retrieved_at":"2026-11-02T21:31:21.279424+00:00","exploited":false,"kev_stale":false,"products":["pugjs / pug","pugjs / pug-code-gen"],"priority":{"label":"Assess exposure and vendor guidance","reasons":["No higher-priority signal is available in the current stored evidence.","Fresh EPSS data is unavailable; missing values are not zero."]},"epss":null,"version_assessment":null},"news":[],"campaigns":[],"domains":[{"domain":"github.com","source_url":"https://github.com/pugjs/pug/commit/991e78f7c4220b2f8da042877c6f0ef5a4683be0","investigate_url":"https://investigate.aeglixmind.com/#github.com"},{"domain":"www.npmjs.com","source_url":"https://www.npmjs.com/package/pug","investigate_url":"https://investigate.aeglixmind.com/#www.npmjs.com"}],"arsenal_url":"https://arsenal.aeglixmind.com/?cve=CVE-2021-21353","catalog_url":"https://cves.aeglixmind.com/cve/CVE-2021-21353","research_url":"https://investigate.aeglixmind.com/research/cve/CVE-2021-21353","coverage":{"news_candidates_checked":0,"campaign_candidates_checked":0,"bounded":false,"notice":"Exact CVE mentions in stored public excerpts and reviewed campaign content only. A mention is not proof of exploitation, attribution or tool suitability. Missing matches do not establish absence."}}