Executive brief
Handlebars is a popular templating engine used to generate dynamic HTML and text content in web applications. Versions prior to 3.0.8 or 4.5.3 contain a prototype pollution vulnerability that allows attackers to inject malicious code through specially crafted templates, potentially crashing applications or executing arbitrary code depending on how the templating engine is used.
Technical details
The vulnerability is a prototype pollution flaw (CWE-1321) in Handlebars template processing. An attacker can craft a malicious template that modifies properties on the Object prototype, affecting the behavior of all objects in the application. The attack requires the application to process untrusted template input. Depending on the application context and how the prototype is modified, this can lead to denial of service (application crash) or in specific conditions, arbitrary code execution. Patches are available in versions 3.0.8, 4.5.3, and later.
Affected products
- Handlebars Handlebars versions prior to 3.0.8 or 4.x versions prior to 4.5.3
Timeline
- 2020-09-04: disclosed