# CVE-2026-33916: Handlebars.js has Prototype Pollution Leading to XSS through Partial Template Injection

- Severity: Medium 4.7 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.29%, higher than 22% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-03-26T22:20:51.000Z
- Modified: 2026-10-26T22:10:00.163Z
- Also known as: GHSA-2qvq-rjwj-gvw9
- Weaknesses: CWE-79, CWE-1321
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

Handlebars provides the power necessary to let users build semantic templates. In versions 4.0.0 through 4.7.8, `resolvePartial()` in the Handlebars runtime resolves partial names via a plain property lookup on `options.partials` without guarding against prototype-chain traversal. When `Object.prototype` has been polluted with a string value whose key matches a partial reference in a template, the polluted string is used as the partial body and rendered without HTML escaping, resulting in reflected or stored XSS. Version 4.7.9 fixes the issue. Some workarounds are available. Apply `Object.freeze(Object.prototype)` early in application startup to prevent prototype  pollution. Note: this may break other libraries, and/or use the Handlebars runtime-only build (`handlebars/runtime`), which does not compile templates  and reduces the attack surface.

(As written by CVE List.)

## Affected

- handlebars-lang handlebars.js: >= 4.0.0, < 4.7.9
- handlebars (npm): from 4.0.0 before 4.7.9
- handlebarsjs handlebars: from 4.0.0 before 4.7.9

## Every score

- GitHub_M: CVSS:3.1 4.7 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N`
- GitHub: CVSS:3.1 4.7 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N`
- NVD: CVSS:3.1 4.7 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N`

## References

- <https://github.com/handlebars-lang/handlebars.js/security/advisories/GHSA-2qvq-rjwj-gvw9> (exploit, vendor-advisory, web)
- <https://github.com/handlebars-lang/handlebars.js/commit/68d8df5a88e0a26fe9e6084c5c6aaebe67b07da2> (patch, web)
- <https://github.com/handlebars-lang/handlebars.js/releases/tag/v4.7.9> (release-notes, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-23369> (advisory)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-23383> (advisory)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-33916> (advisory)
- <https://github.com/handlebars-lang/handlebars.js> (package)

## Sources

- CVE List: [CVE-2026-33916](https://www.cve.org/CVERecord?id=CVE-2026-33916), CVE Terms of Use, modified 2026-03-30
- GitHub Advisory Database: [GHSA-2qvq-rjwj-gvw9](https://github.com/advisories/GHSA-2qvq-rjwj-gvw9), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2026-33916](https://nvd.nist.gov/vuln/detail/CVE-2026-33916), Public domain, modified 2026-10-26

---

Page: https://cve.day/CVE-2026-33916 · Whole record: https://cve.day/CVE-2026-33916.json · Rebuilt by cve.day 2026-11-25T22:59:17.446Z
