# CVE-2024-36361: Pug allows JavaScript code execution if an application accepts untrusted input

- Severity: Medium 6.8 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.49%, higher than 43% of CVEs (2026-12-01)
- Published: 2024-05-24T06:04:19.211Z
- Modified: 2026-09-10T03:50:13.109Z
- Also known as: GHSA-3965-hpx2-q597
- Weaknesses: CWE-94
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total
- Assigned by: mitre

## Description

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.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- pugjs pug: from 0.0.2 up to 3.0.2
- pug-code-gen (npm): before 3.0.3
- pug (npm): before 3.0.3

## Every score

- CISA-ADP: CVSS:3.1 6.8 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N`
- GitHub: CVSS:3.1 6.8 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N`

## References

- <https://github.com/pugjs/pug/pull/3428> (web)
- <https://pugjs.org/api/reference.html> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-36361> (advisory)
- <https://github.com/pugjs/pug/pull/3438> (web)
- <https://github.com/pugjs/pug/commit/32acfe8f197dc44c54e8af32c7d7b19aa9d350fb> (web)
- <https://github.com/Coding-Competition-Team/hackac-2024/tree/main/web/pug> (web)
- <https://github.com/pugjs/pug> (package)
- <https://github.com/pugjs/pug/blob/4767cafea0af3d3f935553df0f9a8a6e76d470c2/packages/pug/lib/index.js#L328> (web)
- <https://github.com/pugjs/pug/releases/tag/pug%403.0.3> (web)
- <https://www.npmjs.com/package/pug-code-gen> (web)

## Sources

- CVE List: [CVE-2024-36361](https://www.cve.org/CVERecord?id=CVE-2024-36361), CVE Terms of Use, modified 2025-02-13
- GitHub Advisory Database: [GHSA-3965-hpx2-q597](https://github.com/advisories/GHSA-3965-hpx2-q597), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2024-36361](https://nvd.nist.gov/vuln/detail/CVE-2024-36361), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-36361 · Whole record: https://cve.day/CVE-2024-36361.json · Rebuilt by cve.day 2026-11-25T22:58:40.818Z
