{"id":"CVE-2024-36361","aliases":["CVE-2024-36361","GHSA-3965-hpx2-q597"],"related":[],"kind":"vulnerability","state":"published","title":"Pug allows JavaScript code execution if an application accepts untrusted input","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","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.","source":"cvelist"},{"lang":"en","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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Pug hasta 3.0.2 permite la ejecución de código JavaScript si una aplicación acepta entradas que no son de confianza para la opción de nombre de la función compileClient, compileFileClient o compileClientWithDependenciesTracked. NOTA: estas funciones son para compilar plantillas de Pug en JavaScript y normalmente no habría motivo para permitir llamadas que no sean de confianza.","source":"nvd"}],"published":"2024-05-24T06:04:19.211Z","modified":"2026-09-10T03:50:13.109Z","severity":{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N","score":6.8,"rating":"MEDIUM"},"severities":[{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N","score":6.8,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N","score":6.8,"rating":"MEDIUM"}],"cwes":["CWE-94"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"custom","introduced":"0.0.2","lastAffected":"3.0.2","status":"affected"}],"vendor":"pugjs","product":"pug","cpe":"cpe:2.3:a:pugjs:pug:0.0.2:*:*:*:*:node.js:*:*","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"3.0.3"}],"ecosystem":"npm","package":"pug-code-gen","purl":"pkg:npm/pug-code-gen","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"3.0.3"}],"ecosystem":"npm","package":"pug","purl":"pkg:npm/pug","source":"ghsa"}],"references":[{"url":"https://github.com/pugjs/pug/pull/3428","tags":["web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://pugjs.org/api/reference.html","tags":["web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-36361","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/pugjs/pug/pull/3438","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pugjs/pug/commit/32acfe8f197dc44c54e8af32c7d7b19aa9d350fb","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/Coding-Competition-Team/hackac-2024/tree/main/web/pug","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pugjs/pug","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/pugjs/pug/blob/4767cafea0af3d3f935553df0f9a8a6e76d470c2/packages/pug/lib/index.js#L328","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pugjs/pug/releases/tag/pug%403.0.3","tags":["web"],"sources":["ghsa"]},{"url":"https://www.npmjs.com/package/pug-code-gen","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"mitre","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2024-06-06T15:59:41.616Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-36361","url":"https://www.cve.org/CVERecord?id=CVE-2024-36361","licence":"CVE Terms of Use","modified":"2025-02-13T15:59:18.755Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-3965-hpx2-q597","url":"https://github.com/advisories/GHSA-3965-hpx2-q597","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:13.109Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-36361","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-36361","licence":"Public domain","modified":"2026-06-17T07:36:34.587Z"}],"updatedAt":"2026-11-25T22:58:40.818Z","epss":{"score":0.00491,"percentile":0.43789,"date":"2026-12-01T12:00:22.000Z"}}