{"id":"GHSA-p493-635q-r6gr","revision":"3e8e7379606642ffab3b7280fbcb477e","records":[{"revision":"3e8e7379606642ffab3b7280fbcb477e","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-p493-635q-r6gr","aliases":["CVE-2021-21353"],"title":"Remote code execution via the `pretty` option.","description":"### Impact\n\nIf 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.\n\n### Patches\n\nUpgrade to `pug@3.0.1` or `pug-code-gen@3.0.2` or `pug-code-gen@2.0.3`, which correctly sanitise the parameter.\n\n### Workarounds\n\nIf 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.\n\n### References\n\n\nOriginal report: https://github.com/pugjs/pug/issues/3312\n\n### For more information\n\nIf you believe you have found other vulnerabilities, please **DO NOT** open an issue. Instead, you can follow the instructions in our [Security Policy](https://github.com/pugjs/pug/blob/master/SECURITY.md)","state":0,"publishedAt":"2021-03-03T02:03:52+00:00","modifiedAt":"2026-09-10T03:49:14.371503+00:00","affected":[{"ecosystem":"npm","name":"pug","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"3.0.1"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"pug-code-gen","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"2.0.3"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"pug-code-gen","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"3.0.0"},{"kind":"fixed","version":"3.0.2"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:H/A:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/pugjs/pug/security/advisories/GHSA-p493-635q-r6gr","https://nvd.nist.gov/vuln/detail/CVE-2021-21353","https://github.com/pugjs/pug/issues/3312","https://github.com/pugjs/pug/pull/3314","https://github.com/pugjs/pug/commit/991e78f7c4220b2f8da042877c6f0ef5a4683be0","https://github.com/pugjs/pug/releases/tag/pug%403.0.1","https://www.npmjs.com/package/pug","https://www.npmjs.com/package/pug-code-gen"],"sourceUrl":"https://github.com/advisories/GHSA-p493-635q-r6gr","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-p493-635q-r6gr","identifiers":["GHSA-p493-635q-r6gr","CVE-2021-21353"]},"retained":false,"historicalAffected":[]}],"coverage":[]}