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
{{ message }}
Repository navigation
[Bug]: APIRequestContext cookie path matching is too permissive (RFC 6265 §5.1.4) #43160
A response sets Set-Cookie: a=1; Path=/foo/. A subsequent request.get('http://host/foo') sends a=1.
request.cookies('http://host/foobar') returns a cookie with Path=/foo.
Expected behavior
Per RFC 6265 §5.1.4 (and browser behavior), request path /foo does not path-match cookie path /foo/, and /foobar does not path-match /foo (the next char after the cookie path must be / unless the cookie path ends with /).
Actual behavior
pathMatches in server/cookieStore.ts appends / to the request path before comparing, so /foo matches /foo/ and the cookie is sent.
filterCookies in server/network.ts (used by cookies(urls)) uses a bare pathname.startsWith(c.path), so /foobar matches /foo.
Additional context
Pre-existing, but more visible now that APIRequestContext.cookies() is public (#43052). Low severity.
Environment
Playwright main @ 6936b230a (1.65.0-next). Found by code review of recent commits; not OS/browser specific.
Activity
yury-s commentedon Oct 6, 2026
This was fixed by #43148.