Skip to content

gh-150522: anchor suffix check in http.cookiejar.domain_match#150523

Open
metsw24-max wants to merge 1 commit into
python:mainfrom
metsw24-max:fix-cookiejar-domain-match-suffix
Open

gh-150522: anchor suffix check in http.cookiejar.domain_match#150523
metsw24-max wants to merge 1 commit into
python:mainfrom
metsw24-max:fix-cookiejar-domain-match-suffix

Conversation

@metsw24-max
Copy link
Copy Markdown

@metsw24-max metsw24-max commented May 27, 2026

domain_match() computes A.rfind(B) but never checks the match sits at the end of A, so a host like www.acme.com.evil.org matches the cookie domain .acme.com even though it does not end with it. RFC 2965 wants A to have the form NB, and the sibling user_domain_match() already uses endswith. Anchor the rfind result to the end of A.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant