# CVE-2024-33883: ejs prototype pollution in template processing

Source: https://junglewise.ai/threats/cve-2024-33883-ejs-prototype-pollution-in-template-processing  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2024-04-28. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2024-33883 · Severity: low · CVSS 3.1 · Published 2024-04-28

ejs is a popular template engine for Node.js applications. A prototype pollution vulnerability in versions before 3.1.10 allows attackers to modify JavaScript object prototypes during template processing, potentially causing denial of service or enabling object property injection attacks. Applications using vulnerable versions could experience unexpected behavior or crashes.

Technologies: [ejs (npm)](https://junglewise.ai/threats/technologies/ejs). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2024-33883 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2024-33883 being exploited in the wild.

**How severe is CVE-2024-33883?** Low severity, with a CVSS score of 3.1, published 28 April 2024.

**Which products and versions are affected?** ejs (npm) SEMVER:introduced=0,fixed=3.1.10.

**Is there a fix for CVE-2024-33883?** Yes. ejs (npm): upgrade to 3.1.10 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2024-33883 attacked?** It is attacked with local access.

**Am I affected by CVE-2024-33883?** Check whether you run ejs (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- ejs (npm): upgrade to 3.1.10 or later

  ```sh
  npm install ejs@3.1.10
  ```


## Technical details

ejs lacks adequate pollution protection in its template processing logic, allowing prototype pollution attacks via CWE-1321 (improperly controlled modification of object prototype attributes). The vulnerability affects all versions before 3.1.10 and is rooted in insufficient input sanitization during template compilation. An attacker can craft malicious template data that pollutes Object.prototype or other core prototypes, affecting all subsequently created objects in the application. The attack requires the ability to control template input or data passed to ejs, with no authentication required. The fix, released in version 3.1.10, implements basic pollution protection to prevent unauthorized prototype modification. The patch is available and should be applied immediately.

## Affected products

- mde ejs before 3.1.10

## Identifiers

- CVE-2024-33883
- GHSA-ghr5-ch3p-vcr6

## Timeline

- 2024-04-28: disclosed
- 2024-04-28: patched: Fix released in version 3.1.10

## References

- [https://github.com/mde/ejs/commit/e469741dca7df2eb400199e1cdb74621e3f89aa5](https://github.com/mde/ejs/commit/e469741dca7df2eb400199e1cdb74621e3f89aa5)

## Related threats

- [ejs template injection via outputFunctionName](https://junglewise.ai/threats/cve-2022-29078-ejs-template-injection-via-outputfunctionname)
- [ejs denial of service via weak input validation](https://junglewise.ai/threats/cve-2017-1000189-ejs-denial-of-service-via-weak-input-validation)
- [EJS remote code execution via weak input validation in renderFile](https://junglewise.ai/threats/cve-2017-1000228-ejs-remote-code-execution-via-weak-input-validation-in)
- [mde ejs XSS in renderFile](https://junglewise.ai/threats/cve-2017-1000188-mde-ejs-xss-in-renderfile)
