Vulnerabilities/

Handlebars.js has Prototype Pollution Leading to XSS through Partial Template Injection

Severity:
Medium

Description

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.

Recommendation

Update the handlebars package to the latest compatible version. Followings are version details:

References

Related Issues

Tags:
npm
handlebars
Anything's wrong? Let us know Last updated on March 27, 2026