fix: escape provider text in the batch scanner #90
No reviewers
Labels
No labels
bug
critical
ebook-branch
high
low
main
medium
release-blocker
security
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jfro/fuzzy_catalog!90
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/batch-scanner-escape"
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?
Fixes a stored-XSS in the batch scanner found in the v0.9 review (no ticket).
Provider text (book title, author, ISBN, media type, error messages) was interpolated into
innerHTMLin the result rows (addResultItem) and inshowToast. Open Library records are publicly editable, so a title like<img src=x onerror=...>would run script in the signed-in user's session when scanned.esc()helper for every untrusted value in the row templatestextContent(icons stay markup)book.idin the View link is URI-encodedTesting:
processBarcodeflow) fails on main, passes heremix precommit: 635 passedNo in-repo JS test: the project has no JS test runner and this didn't seem worth adding one (jsdom) for. Touches the same file as #85; expect a trivial rebase.