Hash all fingerprints into the manual security check
The manual check used to show the first 8 bytes of the first fingerprint each SDP named, so an interposer could add its own certificate beside the claimed one and the codes still matched. Now each code is the first 16 bytes of a SHA-256 over every fingerprint the SDP names, also ones hidden in other lines, so whatever the browser uses changes the code. Without a fingerprint on either side the connection ends. End-to-end tests try a claimed certificate in several hiding places. The README says that a working connection isn't necessarily direct and what the meeting tracker sees, TODO.md lists hardening from a security review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ae871a2647
commit
ae1e3bef9b
5 files changed
+205
-38
No files matched your search
@@ -1,5 +1,41 @@
|
||||
# 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, `invoicefdp.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.
|
||||
|
||||
- Limit what a tracker can make the page do: no size or rate limit on its messages, `parse` and
|
||||
`unseal` take whatever arrives, failure reasons after acceptance are logged, and the log in
|
||||
`App.vue` grows without bound. A malicious tracker can freeze the tab. Only availability, and only
|
||||
of a tracker the user chose, but cheap: cap `event.data.length` before parsing, cap the log, drop
|
||||
failure reasons after acceptance or log one.
|
||||
|
||||
- The tracker relays anything: `isSdp` only checks for a string, so it passes any payload up to
|
||||
`MAX_FORWARDED` between two peers of a swarm, usable as a small message relay. The SDP is sealed,
|
||||
the tracker can't check it's SDP. Checking for base64 of a plausible length only shapes what it
|
||||
relays, any data can be base64. What limits the relay is a quota: bytes forwarded per IP over
|
||||
time, and a per-IP connection rate, not only `MAX_PER_IP` concurrent ones, so reconnecting doesn't
|
||||
reset it. Or decide this is accepted and say so in `tracker.mjs`.
|
||||
|
||||
- The tracker's plain HTTP path isn't counted: `MAX_CONNECTIONS` and `MAX_PER_IP` only apply to
|
||||
upgrades, a non-upgrade request gets a 404 with Node's default timeouts. Don't count on Caddy for
|
||||
it, its defaults may not cut slow clients short either. Setting `headersTimeout`,
|
||||
`requestTimeout`, `keepAliveTimeout` and `maxHeadersCount`, and closing the socket after the 404,
|
||||
costs little. Queues can reach `MAX_QUEUED` × `MAX_CONNECTIONS` = 32 MiB against `mem_limit: 96m`,
|
||||
maybe a global byte budget.
|
||||
|
||||
- Framing: no `frame-ancestors`, so another page can frame HellCon and overlay the security check's
|
||||
buttons. Gains little: a framed HellCon starts empty like any other, nothing is kept, so it has no
|
||||
file or offer the user didn't pick or paste inside it, and the address bar shows the framing site.
|
||||
That site could as well serve a modified copy that fakes the codes. `frame-ancestors` and
|
||||
`X-Frame-Options` only work as headers, not in a `<meta>`. Recommend them,
|
||||
`X-Content-Type-Options: nosniff` and `Referrer-Policy: no-referrer` in Host your own.
|
||||
|
||||
## Ideas
|
||||
|
||||
- Resume interrupted transfers: the receiver already reports how much the download manager has
|
||||
|
||||
Reference in new issue
Block a user