Strip controls, line separators and bidi controls from offered file names

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
SchluffeandClaude Opus 5.5 committed 2026-10-30 00:38:10 +01:00
1 parent 7f4811485a
commit af0a8c9fee
3 files changed
+18 -12

No files matched your search

-9
View File
@@ -1,14 +1,5 @@
# TODO
## Hardening
From a security review, none of them urgent.
- Sanitize file names for display: `MAX_NAME` only limits the length. Control and bidi characters
(e.g. U+202E) can fake log lines or disguise an extension, `invoice‮fdp.exe` shows as
`invoiceexe.pdf`. Strip C0/C1 and bidi controls where the name is shown and logged, maybe for
`Content-Disposition` in `sw.js` too, though browsers sanitize download names themselves.
## Ideas
- Resume interrupted transfers: the receiver already reports how much the download manager has