Skip to content

logging: apply set_cookie filter when Go rejects the cookie value - #8429

Open
sam-kota wants to merge 1 commit into
caddyserver:masterfrom
sam-kota:set-cookie-filter-raw-fallback
Open

sam-kota wants to merge 1 commit into
caddyserver:masterfrom
sam-kota:set-cookie-filter-raw-fallback

Conversation

@sam-kota

Copy link
Copy Markdown
Contributor

set_cookie log filter returned the whole line unfiltered whenever http.ParseSetCookie failed, and go rejects values browsers happily accept (json like session={"id":"..."}, a backslash or " in the value, non-ascii), so with set_cookie { replace session REDACTED } the session secret still landed in the access log; this falls back to the raw name=value pair so replace/hash/delete still apply, and TestSetCookieFilterValueRejectedByParser fails before and passes after.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant