Skip to main content

Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') in handlebars

Cx57f1d4f0-ebb7

  • handlebars
  • org.webjars:handlebars
  • org.webjars.npm:handlebars
Severity Medium
Score 4.8/10

Summary

The prototype method blocklist in `lib/handlebars/internal/proto-access.js` blocks `constructor`, `__defineGetter__`, `__defineSetter__`, and `__lookupGetter__`, but omits the symmetric `__lookupSetter__`. This omission is only exploitable when the non-default runtime option `allowProtoMethodsByDefault: true` is explicitly set -- in that configuration `__lookupSetter__` becomes accessible while its counterparts remain blocked, creating an inconsistent security boundary. 4.6.0 is the version that introduced `protoAccessControl` and the `allowProtoMethodsByDefault` runtime option. This issue affects handlebars versions 4.6.0 through 4.7.8.

  • HIGH
  • NETWORK
  • LOW
  • UNCHANGED
  • NONE
  • NONE
  • LOW
  • NONE

CWE-1321 - Prototype Pollution

Prototype pollution is one of the lesser-known vulnerabilities. It allows attackers to abuse the rules of JavaScript by injecting properties into the general object “Object” in JS. Modifying the prototype of “Object” affects the behavior of all objects in the entire app, potentially resulting in denial of service, arbitrary code execution, cross-site scripting, etc.

Advisory Timeline

  • Published