CVE-2024-36361
Pug allows JavaScript code execution if an application accepts untrusted input
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- High
- Privileges needed
- None
- User interaction
- Required
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
6.8
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.
- Record
CVE-2024-36361- 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 - Weakness
- CWE-94
- Updated
- 2026-11-02
EUVDEUVD-2024-1383
6.8
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.
- Record
EUVD-2024-1383- 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 - Updated
- 2026-11-03
GitHub AdvisoriesGHSA-3965-hpx2-q597
6.8
Pug allows JavaScript code execution if an application accepts untrusted input
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.
- Record
GHSA-3965-hpx2-q597- 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 - Weakness
- CWE-94
- Updated
- 2026-11-02
NVD
6.8
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.
- Record
CVE-2024-36361- 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 - Weakness
- CWE-94
- Updated
- 2026-11-02
OSV
6.8
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.
- Record
CVE-2024-36361- 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 - Updated
- 2026-11-02
OSVGHSA-3965-hpx2-q597
6.8
Pug allows JavaScript code execution if an application accepts untrusted input
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.
- Record
GHSA-3965-hpx2-q597- 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 - Weakness
- CWE-94
- Updated
- 2026-11-02
Show 4 moreShow less
OSVCLSA-2026-1777250300 No score
TuxCare security update for pug (2 CVEs)
TuxCare rebuilt pug to address 2 CVEs. Fixed in 2.0.4-tuxcare.4.
- Record
CLSA-2026-1777250300- Updated
- 2026-11-02
OSVCLSA-2026-1786620685 No score
TuxCare security update for pug-code-gen (2 CVEs)
TuxCare rebuilt pug-code-gen to address 2 CVEs. Fixed in 2.0.2-tuxcare.5.
- Record
CLSA-2026-1786620685- Updated
- 2026-11-02
OSVROOT-APP-NPM-AIKIDO-2024-10105 No score
AIKIDO-2024-10105 in @rootio/pug - Patched by Root
Root has patched AIKIDO-2024-10105 in the @rootio/pug package for Root:npm. Multiple fixed versions available.
- Record
ROOT-APP-NPM-AIKIDO-2024-10105- Updated
- 2026-11-02
OSVROOT-APP-NPM-CVE-2024-36361 No score
CVE-2024-36361 in @rootio/pug - Patched by Root
Root has patched CVE-2024-36361 in the @rootio/pug package for Root:npm. Multiple fixed versions available.
- Record
ROOT-APP-NPM-CVE-2024-36361- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
pugnpm |
through 3.0.2 | 3.0.3 |
pug-code-gennpm |
through 3.0.2 | 3.0.3 |
pugTuxCare:npm From an advisory covering 2 CVEs |
2.0.4-tuxcare.0 up to 2.0.4-tuxcare.4, plus listed versions 2.0.42.0.4-tuxcare.12.0.4-tuxcare.22.0.4-tuxcare.3 |
2.0.4-tuxcare.4 |
pug-code-genTuxCare:npm |
2.0.2-tuxcare.0 up to 2.0.2-tuxcare.5, plus listed versions 2.0.22.0.2-tuxcare.12.0.2-tuxcare.22.0.2-tuxcare.32.0.2-tuxcare.4 |
2.0.2-tuxcare.5 |
pug-code-gennpm |
before 3.0.3 | 3.0.3 |
pugnpm |
before 3.0.3 | 3.0.3 |
@rootio/pugRoot:npm |
before 2.0.4-root.io.1 | 2.0.4-root.io.12.0.4-root.io.2 |
pugRoot:npm |
before 2.0.4-aikido.1 | 2.0.4-aikido.12.0.4-aikido.2 |
@rootio/pugRoot:npm |
before 2.0.4-root.io.2 | 2.0.4-root.io.2 |
pugRoot:npm |
before 2.0.4-aikido.2 | 2.0.4-aikido.2 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| aliases, published | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2024-36361 is a medium vulnerability (CVSS 6.8) in Pugjs Pug, published May 24, 2024. Its validity is disputed. EPSS puts the chance of exploitation in the next 30 days at 0.49%, the 42nd percentile. Fixed in pug 3.0.3.
References
github.com/pugjs/pug/pull/3428
pugjs.org/api/reference.html
nvd.nist.gov/vuln/detail/CVE-2024-36361
github.com/Coding-Competition-Team/hackac-2024/tree/main/web/pug
github.com/pugjs/pug/blob/4767cafea0af3d3f935553df0f9a8a6e76d470c2/packages/pug/lib/index.js
npmjs.com/package/pug-code-gen