CERT24Improper encoding or escaping in Handlebars output — affects versions 4.0.0 through 4.7.10Loading data…

Improper encoding or escaping in Handlebars output — affects versions 4.0.0 through 4.7.10

From versions 4.0.0 through 4.7.10, Handlebars.precompile() uses quotedString() to emit static template text into generated JavaScript without escaping sequences that terminate an enclosing HTML script element. When an application precompiles attacker-controlled template text and embeds the generated source directly in an inline script element, a closing script delimiter can end the element and cause following attacker-controlled markup to be parsed and executed. The issue is fixed in version 4.7.10.

← Back to intelligence

Improper encoding or escaping in Handlebars output — affects versions 4.0.0 through 4.7.10

From versions 4.0.0 through 4.7.10, Handlebars.precompile() uses quotedString() to emit static template text into generated JavaScript without escaping sequences that terminate an enclosing HTML script element. When an application precompiles attacker-controlled template text and embeds the generated source directly in an inline script element, a closing script delimiter can end the element and cause following attacker-controlled markup to be parsed and executed. The issue is fixed in version 4.7.10.