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
scripttags or script attributes that include a Javascript template string (backticks) are subject to XSS.Details
The
javaScriptBlockandjavaScriptAttributemethods in theEscapeclass (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
OwaspHtmlTemplateOutputin versions less than or equal to3.1.15withscripttags or script attributes that contain Javascript template strings (backticks) are vulnerable.References