A cookie that a server meant only for its own host can be sent by Guzzle to that host's subdomains. If an attacker controls or can watch a subdomain, they can receive cookies such as session ids or access tokens that were meant for the parent host.

Cookies set without a Domain attribute, or with an empty one, should only go back to the exact host that set them. Guzzle stored them as if they covered the whole domain.

Who is affected

Apps on guzzlehttp/guzzle before 7.15.1 that use Guzzle's cookie support and reuse one cookie jar for a parent host and a less trusted subdomain. The Guzzle advisory points to new Client(['cookies' => true]) as a common way to share one jar. The cookie's path, Secure flag and expiry still apply. Apps that don't use Guzzle's cookies, or use a separate jar per host, aren't affected.

What to do

Update to 7.15.1 or later. The fix records host-only cookies and only sends them to the exact host.

After updating, FileCookieJar and SessionCookieJar data saved by older versions is rejected with an error. Delete or regenerate that data. Until you can update, use a separate cookie jar for each host or trust boundary.

Reported by GrahamCampbell.