CVE-2024-36361 json
Pug allows JavaScript code execution if an application accepts untrusted input
published 2024-05-24 2 y ago modified 2026-09-10 1 mo ago also GHSA-3965-hpx2-q597 , EUVD-2024-1383
- cvss
- 6.8
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.5%
- EPSS 0.5% chance of exploitation in 30 days, percentile 42%
- public exploits
- 0
- none known
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.
Patch / fix
- npm pug-code-gen 3.0.3
- npm pug 3.0.3
- github.com/pugjs/pug@32acfe8 commit
- github.com/pugjs/pug#3428 pull request
- github.com/pugjs/pug#3438 pull request
- github.com/pugjs/pug/releases/tag/pug%403.0.3 release
CISA SSVC
- Exploitation
- Proof of concept is public
- Automatable
- no
- Technical impact
- total
- Assessed
- 2 y ago
Exploit prediction
0.49% chance of exploitation in the next 30 days, higher than 42% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CISA ADP | 3.1 | 6.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N |
| CNA | 3.1 | 6.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N |
| GitHub | 3.1 | 6.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| npm | pug-code-gen | <3.0.3 |
3.0.3 |
| npm | pug | <3.0.3 |
3.0.3 |
Affected products
- pugjs pug
Classification
- Weakness
-
- CWE-94 Improper Control of Generation of Code
References
-
github.com
/pugjs/pug/pull/3428
web
-
github.com
/pugjs/pug/pull/3438
web
-
github.com
/pugjs/pug/commit/32acfe8f197dc44c54e8af32c7d7b19aa9d350fb
web
-
pugjs.org
/api/reference.html
web
-
nvd.nist.gov
/vuln/detail/CVE-2024-36361
advisory
-
github.com
/Coding-Competition-Team/hackac-2024/tree/main/web/pug
web
-
github.com
/pugjs/pug
package
-
github.com
/pugjs/pug/blob/4767cafea0af3d3f935553df0f9a8a6e76d470c2/packages/pug/lib/index.js#L328
web
-
github.com
/pugjs/pug/releases/tag/pug%403.0.3
web
-
npmjs.com
/package/pug-code-gen
web
Sources
- CVE List CVE-2024-36361
- GitHub Advisory GHSA-3965-hpx2-q597
- NVD CVE-2024-36361
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.