Spaces:
Sleeping
Sleeping
Commit ·
85cfbb0
1
Parent(s): 7e3b7e5
fix(H-02,CodeQL#24): sanitize evidence chip text in FindingItem -- XSS from AI/DB output in innerHTML
Browse files
frontend/js/components.js
CHANGED
|
@@ -100,7 +100,7 @@ const Components = {
|
|
| 100 |
el.className = `finding-item finding-item--${finding.severity || "LOW"}`;
|
| 101 |
const evidence = (finding.evidence || [])
|
| 102 |
.slice(0, 3)
|
| 103 |
-
.map(e => `<span class="evidence-chip">${e.substring(0, 60)}</span>`)
|
| 104 |
.join("");
|
| 105 |
// BUG-20 FIX: finding.description was put directly in innerHTML -- XSS risk
|
| 106 |
el.innerHTML = `
|
|
|
|
| 100 |
el.className = `finding-item finding-item--${finding.severity || "LOW"}`;
|
| 101 |
const evidence = (finding.evidence || [])
|
| 102 |
.slice(0, 3)
|
| 103 |
+
.map(e => `<span class="evidence-chip">${sanitize(e).substring(0, 60)}</span>`)
|
| 104 |
.join("");
|
| 105 |
// BUG-20 FIX: finding.description was put directly in innerHTML -- XSS risk
|
| 106 |
el.innerHTML = `
|