skill-creator: eval-viewer/generate_review.py embeds JSON in a <script> block without escaping closing tags
Author: DamiencorriganCreated Sep 18, 2026Updated Sep 27, 2026
File: skill-creator/eval-viewer/generate_review.py (lines ~279-281)
data_json = json.dumps(embedded)
return template.replace("/*__EMBEDDED_DATA__*/", f"const EMBEDDED_DATA = {data_json};")json.dumps output is not safe to interpolate directly into an HTML <script> block. It does not escape <, >, or &, so any string in the eval data containing a script-closing sequence terminates the script element early and the remainder is parsed as markup. Eval data carries attacker-influenced text (model outputs, evidence strings, file paths), so this is reachable without an adversarial project.
Suggested fix: escape the closing-tag sequence before embedding:
data_json = json.dumps(embedded).replace("<", "\\u003c").replace(">", "\\u003e").replace("&", "\\u0026")or place the payload in <script type="application/json"> and read it with JSON.parse(el.textContent).
Found by an automated security review of the vendored skill copy on Claude Code 2.1.x.
Source: anthropics/skills