jte's HTML templates containing Javascript template strings are subject to XSS
Description
Published to the GitHub Advisory Database
Jan 13, 2025
Reviewed
Jan 13, 2025
Published by the National Vulnerability Database
Jan 13, 2025
Last updated
Jan 13, 2025
Summary
Jte HTML templates with
script
tags or script attributes that include a Javascript template string (backticks) are subject to XSS.Details
The
javaScriptBlock
andjavaScriptAttribute
methods in theEscape
class (source) do not escape backticks, which are used for Javascript template strings. Dollar signs in template strings should also be escaped as well to prevent undesired interpolation.PoC
src/jte/xss.jte
:Impact
HTML templates rendered by Jte's
OwaspHtmlTemplateOutput
in versions less than or equal to3.1.15
withscript
tags or script attributes that contain Javascript template strings (backticks) are vulnerable.References