You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TASK-064: fix partial-mutation in do_set_cookie and add semicolon guard to validate_attr_param
Two behavioral fixes driven by TDD:
1. Partial-mutation bug (code-simplifier-iter1-2): do_set_cookie now
builds and validates the structured cookie first (with_name /
with_value throw on invalid chars), then mirrors into the legacy
cookies_ map only on success. Previously, insert_or_assign ran
before with_name, leaving a dirty entry in the legacy map when
with_name threw. Test: legacy_with_cookie_bad_key_leaves_maps_clean.
2. Attribute-injection guard (security-reviewer-iter1-1): validate_attr_param
(used by with_domain and with_path) now rejects semicolons in addition
to CR/LF/NUL. A semicolon in Domain or Path would be emitted verbatim
by the renderer, injecting synthetic attributes into the Set-Cookie
header (CWE-113). Tests: with_path_rejects_semicolon,
with_domain_rejects_semicolon.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
0 commit comments