auth: the duplicate-cookie line hides a link's token (audit A4)
Security audit 2026-10-17, finding A4 (low), stage 0. The line logged when a request carries two unprefixed session cookies printed r.URL.Path raw, so GET /confirm/<token> wrote the token to the log (reachable only with PANEL_COOKIE_SECURE=false, where a sibling host can plant the bare name). loggedPath moves from internal/web to internal/web/auth as LoggedPath (web imports auth, not the other way) and both lines - the origin check's refusal and the duplicate-cookie one - go through it. Tests: TestDuplicateCookieLineHidesALinksToken; TestLoggedPathHidesTokens moved with the function. go test ./internal/web ./internal/web/auth. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -21,6 +21,8 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); version
|
||||
- **The sender check keeps two `From:` and two `Sender:` lines** (audit M5),
|
||||
not every one an application sends: the judgement needs no more, and a
|
||||
hundred long lines were megabytes held per connection.
|
||||
- **A link's token stays out of the duplicate-cookie log line** (audit A4),
|
||||
as it already did out of the origin check's.
|
||||
- **The entrypoint follows no link at the DMARC maps** (audit I2): the
|
||||
three `dmarc_*` maps root creates at the start were missing from the list
|
||||
of paths where a symbolic link is removed first.
|
||||
|
||||
Reference in New Issue
Block a user