{"id":"CVE-2026-33916","published":"2026-03-27T21:00:48Z","modified":"2026-03-30T15:41:36Z","title":"Handlebars.js has Prototype Pollution Leading to XSS through Partial Template Injection","vendor":"handlebars-lang","product":"handlebars.js","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":4.7,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.0028,"percentile":0.20446,"provenance":"source"},"cwes":[{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"},{"id":"CWE-1321","name":"Improperly Controlled Modification of Object Prototype Attributes"}],"references":[{"url":"https://github.com/handlebars-lang/handlebars.js/security/advisories/GHSA-2qvq-rjwj-gvw9","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/handlebars-lang/handlebars.js/commit/68d8df5a88e0a26fe9e6084c5c6aaebe67b07da2","tags":["x_refsource_MISC"]},{"url":"https://github.com/handlebars-lang/handlebars.js/releases/tag/v4.7.9","tags":["x_refsource_MISC"]}],"priority":{"score":7.4,"factors":[{"name":"EPSS percentile","points":4.09},{"name":"CVSS severity","points":3.29}]},"vendorSlug":"handlebars-lang","affectedVersions":[{"vendor":"handlebars-lang","product":"handlebars.js","versions":[">= 4.0.0, < 4.7.9"]}],"affected":[{"ecosystem":"npm","package":"handlebars","vulnerableRanges":[">=4.0.0, <4.7.9"],"patched":["4.7.9"],"from":["GHSA-2qvq-rjwj-gvw9"],"provenance":"source"}],"euvd":{"id":"EUVD-2026-16847","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-handlebars-lang-handlebars-js-cve-2021-23369","parents":[{"from":"CVE-2021-23369","to":"CVE-2026-33916","relation":"related","confidence":"high","kind":"lineage","evidence":[{"kind":"osv-related","provenance":"source","id":"GHSA-2qvq-rjwj-gvw9","via":"reference","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-23369"}]},{"from":"CVE-2021-23383","to":"CVE-2026-33916","relation":"related","confidence":"high","kind":"lineage","evidence":[{"kind":"osv-related","provenance":"source","id":"GHSA-2qvq-rjwj-gvw9","via":"reference","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-23383"}]}]}}