Escape or avoid HTML interpolation for all external and API-sourced text #1
Labels
No labels
architecture
cleanup
dependencies
performance
priority: high
priority: medium
reliability
security
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
solvreven/FPL#1
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Finding
The frontend renders extensive API/external data through template strings assigned to
innerHTML, but only a few call sites useesc(). Player names, team names, error details, override notes, fixture opponent names, accuracy details, and bookmaker-derived strings can therefore become markup.Representative evidence:
frontend/app.js:877-883,956-957,1266-1268,1358-1367,3665,3951,4090,4117,4216,4278-4279,4346frontend/ticker.js:90-96,124-125,140frontend/app.js:49-56defines a correct HTML escaper, butrgfinds only three calls while dozens of external strings are interpolated into HTML.tests/web/test_escaping.pytests the helper itself, not the sinks that need it.This is a DOM XSS risk whenever upstream data, persisted notes, or server error text contains markup. The official FPL feed and bookmaker feeds are external trust boundaries even if their current values are benign.
Suggested direction
textContent/DOM construction for text-only values.Acceptance criteria
Implemented on main in commit
ae1e35band covered by regression tests. Closing as complete.