Pug through 3.0.2 allows JavaScript code execution if an application accepts untrusted…
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- High
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CISA ADP. Fix status from CNA and GitHub. Impact type from CWE-94.
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | — | all versions | — | No fix listed | CNA |
| — | pug-code-gen (npm) | before 3.0.3 | 3.0.3 | Patch available | GHSA-3965-hpx2-q597 |
| — | pug (npm) | before 3.0.3 | 3.0.3 | Patch available | GHSA-3965-hpx2-q597 |
- — Vendor— Affected all versions Fixed in — No fix listed CNA
- pug-code-gen (npm) Vendor— Affected before 3.0.3 Fixed in 3.0.3 Patch available GHSA-3965-hpx2-q597
- pug (npm) Vendor— Affected before 3.0.3 Fixed in 3.0.3 Patch available GHSA-3965-hpx2-q597
Remediation
- Fix · GHSA-3965-hpx2-q597 pug-code-gen (npm) Fixed in 3.0.3 Advisory →
- Fix · GHSA-3965-hpx2-q597 pug (npm) Fixed in 3.0.3 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2024-36361
- 2026-10-03 Alias added: GHSA-3965-hpx2-q597
References
Other 9
- https://github.com/pugjs/pug/pull/3428
- https://pugjs.org/api/reference.html
- https://github.com/pugjs/pug/pull/3438
- https://github.com/pugjs/pug/commit/32acfe8f197dc44c54e8af32c7d7b19aa9d350fb
- https://github.com/Coding-Competition-Team/hackac-2024/tree/main/web/pug
- https://github.com/pugjs/pug
- https://github.com/pugjs/pug/blob/4767cafea0af3d3f935553df0f9a8a6e76d470c2/packages/pug/lib/index.js#L328
- https://github.com/pugjs/pug/releases/tag/pug%403.0.3
- https://www.npmjs.com/package/pug-code-gen
Sources
- CVE-2024-36361 · CVE Program
- CVE-2024-36361 · NVD
- FIRST EPSS
- GHSA-3965-hpx2-q597 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences