{"id":"CVE-2024-36361","published":"2024-05-24T06:04:19Z","modified":"2025-02-13T15:59:18Z","title":"Pug through 3.0.2 allows JavaScript code execution if an application accepts untrusted input for the name option of…","vendor":null,"product":null,"tier":"tail","description":{"text":"Pug through 3.0.2 allows JavaScript code execution if an application accepts untrusted input for the name option of the compileClient, compileFileClient, or compileClientWithDependenciesTracked function. NOTE: these functions are for compiling Pug templates into JavaScript, and there would typically be no reason to allow untrusted callers.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.8,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N","provenance":"source","from":"CISA ADP Vulnrichment"},"epss":{"score":0.00782,"percentile":0.52466,"provenance":"source"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"references":[{"url":"https://github.com/pugjs/pug/pull/3428","tags":[]},{"url":"https://pugjs.org/api/reference.html","tags":[]}],"priority":{"score":15.3,"factors":[{"name":"EPSS percentile","points":10.49},{"name":"CVSS severity","points":4.76}]},"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"total","timestamp":"2024-06-06T15:59:41.616680Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"pug-code-gen","vulnerableRanges":["<3.0.3"],"patched":["3.0.3"],"from":["GHSA-3965-hpx2-q597"],"provenance":"source"},{"ecosystem":"npm","package":"pug","vulnerableRanges":["<3.0.3"],"patched":["3.0.3"],"from":["GHSA-3965-hpx2-q597"],"provenance":"source"}],"summary":{"text":"Pug through 3.0.2, the Node.js template engine, contains a code injection flaw in its compileClient, compileFileClient, and compileClientWithDependenciesTracked functions, which compile Pug templates into JavaScript. An attacker can execute arbitrary JavaScript if an application passes untrusted input as the name option to these functions, a scenario the advisory notes is uncommon since these functions are not normally intended for untrusted callers, and exploitation requires user interaction.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:42:56Z"},"euvd":{"id":"EUVD-2024-1383","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-pugjs-pug-cve-2021-21353","parents":[{"from":"CVE-2021-21353","to":"CVE-2024-36361","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["packages/pug-code-gen/index.js"],"commits":["https://github.com/pugjs/pug/commit/991e78f7c4220b2f8da042877c6f0ef5a4683be0","https://github.com/pugjs/pug/commit/32acfe8f197dc44c54e8af32c7d7b19aa9d350fb"],"basis":"shared function","functions":["Compiler"]}]}]}}