Subscriber codes in the access log (2026-11-17)
The access log once recorded the two codes carried in subscriber links; the log now deletes the c and t query parameters from the request URI and keeps only the referring site's scheme and host in the Referer; the eight affected log entries were rewritten in redacted form, and a test guards against recurrence.
Incident: subscriber codes in the front-end access log, 2026-11-17
Found by: the outside audit of 2026-11-17 (finding F01), confirmed and measured here. State: contained, records scrubbed, recurrence guarded by a test. No token is recorded.
What happened
The Caddy access log on the front-end box deletes reader-entered text from the request URL before
a line is written. Its list was q, address, zip, email and token. token is a name no
route uses. The subscriber links carry their code as c (the confirmation link) and t
(the personal management link, also the one-click unsubscribe target), so both codes were written
into request>uri — and kept for fourteen days — on every click of a link in an email.
A management code (t) is a bearer secret: with it, anyone can see that sign-up's status and saved
races, unfollow a race, ask for the results email, unsubscribe, and delete the address
(src/elab/api/support_view.py:400–518). A confirmation code (c) can only confirm.
The second route was the Referer. A page addressed with a code or an Ask question, when it loads its own script or stylesheet, sends that address as Referer, and the log kept Referer whole.
Scope, measured before the scrub
Across the fifteen retained log files (fourteen rotated .gz, one current):
| lines | distinct values | |
|---|---|---|
?c= (confirmation codes) |
4 | 3 |
?t= (management codes) |
4 | 1 |
codes found in a Referer field |
0 | — |
Against the live subscriber table, without printing any value:
- the one management code belongs to one sign-up that has never been confirmed — so no confirmed reader's personal link was in the log, and that link's preferences could not have been set yet;
- of the three confirmation codes, one belongs to a sign-up already confirmed, one to a sign-up not yet confirmed, and one matches no row (deleted since);
- none of the eight lines carried a code in the Referer.
Earlier in the same review, before the older files rotated out of the fourteen-day retention, the same measurement found eleven lines (two distinct management codes, five confirmation codes).
What changed
Repository (deploy/frontend/Caddyfile, installed on the box as the identical file, sha256
868731ea4058f14f356e9ad34d3cc83beac3530b6871ba3a86d534a9dcdd1fa1):
delete canddelete tadded torequest>uri query.request>headers>Referer regexp ^(https?://[^/?#]+).* $1— the log keeps the referring site only. The weekly readers report counts referrer hosts (scripts/readers_report.py), so nothing that reads the log loses anything; the app's own sign-up attribution reads the live request, not the log, and is untouched.- The outage page (
handle_errors,@askdown) is served at the reader's own address, so it now sendsReferrer-Policy: no-referrerandCache-Control: no-store— previously it inherited the site defaultstrict-origin-when-cross-origin, which is how a code or a question could leave the log and come back in through the page's own subresource requests.
The privacy page (src/elab/api/support_view.py) now says the personal-link code is cut from the
recorded address and that a referring address is kept only as the referring site.
tests/unit/test_access_log_redaction.py compares the query parameters the routes accept, read from
their own signatures, with the log filter's delete list, and requires every one to be deleted or
listed as safe with a reason — so a new route with a reader's text in its query fails the test
rather than being logged. It also pins the c/t deletion, the Referer rule, and the outage
headers.
The scrub, and a fault made during it
The eight lines were rewritten to c=[redacted] / t=[redacted] across the current and rotated
files, keeping the path, status, date and any other parameter. After the scrub, a search for any
64-hex c= or t= across all retained files returns zero, and the eight lines still exist in
redacted form. No copy of the values was kept anywhere; the temporary lists used to count and assess
them were deleted from the box and from Skynet-Three.
Fault during the scrub (mine, recorded): rewriting the current log with sed -i renamed the
file while Caddy held it open. Caddy kept writing to the unlinked inode, and a reload did not
reopen it, so access logging was silent from 20:10:59 to 20:14:19 UTC. systemctl restart caddy
reopened it; the site answered 200 throughout, and no reader traffic was lost from the site itself —
only those three minutes of access lines. The correct procedure is: scrub, then restart (not
reload) Caddy, and verify /proc/<pid>/fd shows the log path without (deleted).
Verification
- A synthetic confirmation, management and unsubscribe request, the one-click POST, and an ordinary
page request carrying a forged Referer with a management code: after the change, none of the
synthetic values appears in any Caddy log, while the three subscriber paths appear with their
status and the test's
ref=f01testintact. - A request to the origin with a forged Referer containing a code is logged as
Referer: https://futureballot.com— scheme and host only. - An isolated Caddy instance running the production
security_headersandhandle_errorsblocks (only the upstream pointed at a dead port) answers a subscriber path with 503,Referrer-Policy: no-referrer,Cache-Control: no-store. - Zero occurrences of the affected values in: the box's Caddy journal, any other file under
/var/logon the box, the application logs and user and system journals on Skynet-Three. PostgreSQL runs withlog_statement=none, so the database log holds none either. - The confirm → manage → one-click unsubscribe → delete round trip was exercised against the
database by
tests/integration/test_signup_manage.py(every step, with the writes rolled back), not by a live sign-up: a live one would create a real subscriber row and send real mail. That step of Fable's acceptance list is therefore met by the test, not by an email.
The negative control is the eight real lines found before the change: the same requests were logged with their codes intact.
Rotation: assessed, not done
The evidence does not show the log was read by anyone other than root on the box — the only account
that can read it, and one that already holds the subscriber table with every address and code. The
one management code exposed belongs to an unconfirmed sign-up, and its owner has no preferences to
change or delete yet. Rotating every code would break the List-Unsubscribe target of every email
already sent, which mail providers expect to keep working.
So: no blanket rotation. If evidence appears that the log files were read by anyone else, rotate the codes actually in the retained files, and keep the old management code valid for unsubscribe alone so that the links in delivered email keep working.