This repository was archived by the owner on Jun 18, 2026. It is now read-only.
Commit 4328537
committed
security: HTML-escape user-controlled vertex names in HTML reports (CWE-79)
GraphHealthChecker.toHtml() injected vertex names (isolatedNodes,
degreeOutliers) from graph files directly into HTML via truncateList()
without escaping. A malicious graph file with vertex names containing
HTML/JS (e.g. '<img/src=x onerror=alert(1)>') would execute arbitrary
scripts when the health report was opened in a browser.
Fix: wrap truncateList() output with ExportUtils.escapeHtml() for both
isolated-node and degree-outlier findings.
GraphDiffHtmlExporter used D3's .html() (which parses HTML) with raw
vertex IDs in tooltip template literals. Added a client-side esc()
helper that uses textContent/innerHTML to sanitize vertex names before
HTML insertion.1 parent 128f768 commit 4328537
2 files changed
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
| 239 | + | |
239 | 240 | | |
240 | 241 | | |
241 | 242 | | |
| |||
294 | 295 | | |
295 | 296 | | |
296 | 297 | | |
297 | | - | |
| 298 | + | |
298 | 299 | | |
299 | 300 | | |
300 | 301 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
| 214 | + | |
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| |||
0 commit comments