Skip to content

Ignore a cookie Path with control characters - #57

Merged
FlorianRappl merged 2 commits into
AngleSharp:develfrom
michaelthyregod:fix/cookie-path-control-chars
Nov 4, 2026
Merged

FlorianRappl merged 2 commits into
AngleSharp:develfrom
michaelthyregod:fix/cookie-path-control-chars

Conversation

@michaelthyregod

Copy link
Copy Markdown
Contributor

Code for #54.

A tab or newline in Path was written unescaped into the Netscape cookie file. So one cookie could add lines for other domains, which were loaded on the next start. A single tab made the file unreadable.

  • Change: TryParsePath now applies the parser's existing InvalidChars check (RFC 6265 path-value).
  • Behaviour: the attribute is ignored and the default path is used, as for other invalid paths.

Test: the injected line doesn't come back after a reload.

🤖 Generated with Claude Code

RFC 6265 does not allow control characters in a path value. A tab or newline in the
path was written unescaped into the Netscape cookie file, so a single cookie could add
lines for other domains, which were loaded on the next start. The attribute is now
ignored and the default path is used, as for other invalid paths.
@CLAassistant

CLAassistant commented Nov 4, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@FlorianRappl FlorianRappl modified the milestones: v1.3.1, v1.3.0 Nov 4, 2026
@FlorianRappl
FlorianRappl merged commit 011fb11 into AngleSharp:devel Nov 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants