You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: escape YAML data in threat model detail overlay to prevent XSS
The showThreatDetail() function in all four threat model pages (en, ja,
ko, zh-cn) concatenates YAML-sourced threat data directly into innerHTML
without sanitization. Because the trust page invites community
contributions to the threat model via pull requests, a malicious PR
modifying threats.yaml could inject arbitrary HTML/JS that executes when
a visitor clicks any threat card.
Add an escapeHtml() helper that encodes &, <, >, ", and ' and wrap all
data fields (risk, atlas, description, attackVector, affected,
mitigations, residualRisk, recommendations) and i18n label values before
innerHTML insertion.
Existing textContent assignments (detailId, detailTitle) are already
safe and left unchanged.
Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
0 commit comments