Commit 9df8951
committed
fix(gui/security): escape filterFormatters.software to close newline-bypass XSS in /relays
Mirror the encode-on-output mitigation shipped in PR #900 for
tableFormatters.software (commit 5f3aff4) — wrap the formatter return
in escapeHtml so the same neutralization applies on the filter render
path at DataViewFilters.svelte:748.
The space-only guard in makeSoftwareReadable() rejects literal spaces
but lets newlines pass, so the payload <img\nsrc=x\nonerror=...>
defeated the guard and reached the {@html} sink. After this change the
structural HTML metacharacters are entity-encoded so no DOM is built
and no event handler can fire.
Also tightens the regression test: structural-escape assertions
(no raw <, >, or ") replace the unsatisfiable substring check on
'onerror=' (which appears as inert identifier text in the escaped
output — neutralized but not stripped).
Out of scope (separate concern flagged by reporter): cache versioning
/ aggregate:complete IndexedDB+localStorage purge on deploy. Already-
poisoned browser state may continue executing on reloads until fresh
data overwrites it.1 parent ad96d1b commit 9df8951
2 files changed
Lines changed: 13 additions & 2 deletions
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
174 | 179 | | |
175 | 180 | | |
| 181 | + | |
176 | 182 | | |
177 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
178 | 187 | | |
| 188 | + | |
| 189 | + | |
179 | 190 | | |
180 | 191 | | |
181 | 192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
568 | | - | |
| 568 | + | |
569 | 569 | | |
570 | 570 | | |
571 | 571 | | |
| |||
0 commit comments