CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-WM3W-8RRP-J577

GHSA-WM3W-8RRP-J577: Host-Only Cookie Scope Exposure in Guzzle Cookie Jar

Alon Barad
Alon Barad
Software Engineer

Jul 21, 2026·6 min read·6 visits

Executive Summary (TL;DR)

Guzzle failed to track whether cookies were originally set without a Domain attribute, causing host-only cookies to be incorrectly forwarded to subdomains and potentially exposing sensitive sessions.

An information disclosure vulnerability in guzzlehttp/guzzle allows host-only cookies to be incorrectly matched and sent to subdomains. Because Guzzle failed to track whether cookies were defined without a Domain attribute, it evaluated host-only cookies using standard domain-suffix rules, widening their scope and exposing sensitive session tokens to untrusted subdomains.

Vulnerability Overview and Context

The PHP HTTP client library guzzlehttp/guzzle provides a comprehensive framework for handling synchronous and asynchronous HTTP requests. A core capability of this library is persistent state management, facilitated by various implementations of the CookieJarInterface. Under default operations, a Cookie Jar intercepts standard response headers, parses cookie definitions, and dynamically injects them into outbound requests targeting matching hosts.

This automatic state management introduces a significant security boundary. The client must strictly isolate cookies based on domain boundaries specified by RFC 6265. When a client library fails to respect these boundaries, it exposes an attack surface where highly sensitive cookies, such as active session identifiers, can be inadvertently transmitted to unauthorized endpoints.

This vulnerability represents a classic class of incorrect privilege assignment and cookie scope widening. By failing to track the structural difference between host-only cookies and domain-scoped cookies, the library systematically bypassed origin separation boundaries designed to restrict cookie visibility.

Root Cause Analysis: RFC 6265 Host-Only Cookie Semantics

According to RFC 6265 Section 4.1.2.3, the absence of an explicit Domain attribute in a Set-Cookie header obligates the user agent to treat the cookie as a host-only cookie. A host-only cookie must only be returned to the exact host that originally set it, preventing propagation to any related subdomains. Conversely, if a cookie explicitly defines a domain, it is a domain cookie and is sent to both the target host and all subdomains.

In legacy versions of Guzzle, the extraction logic within CookieJar::extractCookies parsed the cookie and, if the domain was empty, simply backfilled it using the current request's hostname. This backfilling operation permanently erased the structural distinction between an explicitly scoped domain cookie and a host-only cookie. Guzzle did not maintain any state flag indicating that this cookie was originally host-only.

Because Guzzle did not retain the historical state of whether the Domain attribute was originally present, subsequent matching operations executed standard domain suffix matching. This resulted in the cookie being matched against any child subdomains, causing cookie scope widening and leading to information leakage when communicating with non-origin hosts.

Code-Level Analysis of the Vulnerability and Patch

To understand the technical mechanics, examine the vulnerable implementation in Guzzle's extraction flow before the patch:

// Legacy logic inside extractCookies()
$sc = SetCookie::fromString($cookie);
$domain = $sc->getDomain();
if ($domain === null || $domain === '') {
    // The domain is assigned the request host, but no flag is set to record its host-only nature
    $sc->setDomain($request->getUri()->getHost());
}

The vulnerability was resolved in commit 7b68220d6543f6f80fe62e633361fc9d4ead14d4. The patch introduces a private boolean $hostOnly state tracker inside the SetCookie class, alongside updated matching rules:

// Patched logic in src/Cookie/SetCookie.php
public function matchesDomain(string $domain): bool
{
    $cookieDomain = $this->getDomain();
    if (null === $cookieDomain) {
        return !$this->getHostOnly();
    }
 
    if ($this->getHostOnly()) {
        // Strict, case-insensitive match for Host-Only cookies
        return Psr7\Utils::asciiToLower($domain) === Psr7\Utils::asciiToLower($cookieDomain);
    }
 
    // Suffix matching logic continues for standard domain cookies
}

Additionally, the extraction logic in CookieJar.php was hardened to explicitly flag host-only cookies during parsing:

// Patched logic in src/Cookie/CookieJar.php
$sc = SetCookie::fromString($cookie);
$domain = $sc->getDomain();
if ($domain === null || $domain === '') {
    $sc->setDomain($request->getUri()->getHost());
    $sc->setHostOnly(true);
} else {
    $sc->setHostOnly(false);
}

To prevent state loss between HTTP client cycles, both JSON-based persistent jars (FileCookieJar and SessionCookieJar) were updated to serialize and deserialize the HostOnly flag. Loading an existing cookie database file or session that lacks this marker now throws a RuntimeException to avoid silent regressions.

Exploitation and Attack Scenarios

An exploitation scenario begins with a client application using a vulnerable version of Guzzle. The application communicates with a secure parent site https://example.com which issues a host-only authentication cookie: Set-Cookie: auth=token123; Secure; HttpOnly. The Guzzle client stores this cookie inside its persistent cookie jar.

If an attacker compromises or establishes control over a subdomain (e.g., https://attacker-controlled.example.com), they can exploit Guzzle's scope widening. When the Guzzle client subsequently sends an HTTP request to the attacker-controlled subdomain, Guzzle automatically appends the host-only cookie to the headers because it evaluates example.com as matching the subdomain under legacy rules.

The target interaction and flow can be structured as follows:

Upon receiving the request, the attacker extracts the auth token from the headers, enabling complete session hijacking of the Guzzle client's session on the parent site. This scenario is highly viable in shared hosting environments or platforms that host user-generated content on subdomains.

Remaining Attack Surface and Edge Cases

A key technical limitation of the fix involves the lack of Public Suffix List (PSL) validation. As noted in Guzzle's patched codebase, Guzzle does not natively validate domains against a Public Suffix List because it avoids pulling in a large external dependency. Consequently, if an attacker operates a service on a public suffix subdomain (such as attacker.github.io), they can set a domain-scoped cookie for github.io which Guzzle will accept and forward to other subdomains under the same suffix.

Additionally, developers must manage the risk of the downgrade migration bypass. When Guzzle's updated persistent cookie jars encounter legacy files lacking the HostOnly key, they immediately throw a RuntimeException. If developers write legacy conversion scripts that blindly set the HostOnly field to false to suppress these errors, they will force-disable host-only protection for those cookies, exposing them to scope widening.

Security teams must also audit custom implementations of CookieJarInterface that may have replicated Guzzle's original flawed logic without adopting the new $hostOnly tracking architecture. Custom engines must be updated to explicitly respect host-only boundaries.

Detection and Remediation Strategy

Remediation requires upgrading the Guzzle package to version 7.15.1 or higher. This update introduces the necessary schema definitions and code-level checks to strictly enforce host-only rules. System administrators should verify the installed package version using Composer commands.

Because the patch updates persistent cookie store schemas, developers must handle the transition period carefully. Loading existing cookie files using FileCookieJar or SessionCookieJar will trigger a RuntimeException if they do not contain the newly introduced HostOnly serialization key. To prevent application downtime, security administrators should clear or regenerate existing persistent cookie storage files during the deployment of the patched version.

For temporary workarounds where immediate updates are impossible, developers should avoid making requests to parent domains and subdomains using the same shared Guzzle Cookie Jar instance. Separating Cookie Jars per host boundary prevents cross-origin data exposure.

Official Patches

GuzzleSecurity patch commit implementing Host-Only tracking and domain-matching validation

Fix Analysis (1)

Technical Appendix

CVSS Score
7.5/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Affected Systems

guzzlehttp/guzzle

Affected Versions Detail

Product
Affected Versions
Fixed Version
guzzlehttp/guzzle
Guzzle
< 7.15.17.15.1
AttributeDetail
Vulnerability TypeCWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Attack VectorNetwork
CVSS Score7.5
Exploit StatusProof of Concept (PoC) documented
Affected ComponentsGuzzleHttp\Cookie\CookieJar
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1539Steal Web Session Cookie
Credential Access
CWE-200
Exposure of Sensitive Information to an Unauthorized Actor

The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.

Vulnerability Timeline

Guzzle releases version 7.15.0
2026-07-17
Security fixes implemented in commit 7b68220d6543f6f80fe62e633361fc9d4ead14d4
2026-07-18
Release of version 7.15.1 addressing GHSA-WM3W-8RRP-J577
2026-07-18

References & Sources

  • [1]GitHub Security Advisory GHSA-WM3W-8RRP-J577
  • [2]Guzzle Security Patch Commit
  • [3]Guzzle Security Pull Request
  • [4]Guzzle Official v7.15.1 Release Changelog

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•14 minutes ago•CVE-2026-59198
6.5

CVE-2026-59198: Heap Out-of-Bounds Read in Pillow TGA RLE Encoder

CVE-2026-59198 is a high-severity heap out-of-bounds read vulnerability in Pillow, the Python imaging library, affecting versions from 5.2.0 up to 12.3.0. The vulnerability occurs in the TGA RLE compression path due to a calculation mismatch between the allocated packed 1-bit row buffer and the byte-level pixel stride assumption in the C-level encoder. This mismatch allows an attacker to leak up to approximately 57 KB of adjacent process heap memory directly into generated TGA image files.

Alon Barad
Alon Barad
0 views•8 min read
•about 1 hour ago•CVE-2026-59199
7.5

CVE-2026-59199: Signed 32-Bit Integer Overflow and Heap Backward Underwrite in Pillow

A critical signed 32-bit integer overflow vulnerability was identified in Pillow (Python Imaging Library) versions prior to 12.3.0. The vulnerability resides within the native C extension library (libImaging) during coordinate and bounding box calculations in functions like ImagingPaste and ImagingFill2. Exploitation can bypass bounds and clipping safety checks, leading to a controlled heap backward underwrite and application crash.

Alon Barad
Alon Barad
4 views•6 min read
•about 2 hours ago•CVE-2026-59200
7.5

CVE-2026-59200: Remote Denial of Service via PDF Decompression Bomb in Pillow

CVE-2026-59200 is a high-severity uncontrolled resource consumption vulnerability in the Pillow Python Imaging Library. The flaw resides in the PDF stream decoder, allowing remote, unauthenticated attackers to trigger host out-of-memory crashes by submitting malicious PDF decompression bombs.

Alon Barad
Alon Barad
4 views•5 min read
•about 3 hours ago•CVE-2026-59203
5.3

CVE-2026-59203: Denial of Service via Infinite Loop in Pillow EPS Image Parser

A denial-of-service (DoS) vulnerability in Pillow (Python Imaging Library) versions 12.0.0 through 12.2.0 allows unauthenticated remote attackers to trigger 100% CPU utilization and hang the processing thread. The issue occurs within the Encapsulated PostScript (EPS) image parser (PIL/EpsImagePlugin.py) due to missing validation on the byte count parsed from %%BeginBinary: comments, allowing negative values to cause an infinite backward stream seek loop. This formatting-level state-looping issue occurs during the initial format sniffing phase inside Image.open() and does not require the system Ghostscript interpreter to be executed or present. It is resolved in version 12.3.0.

Amit Schendel
Amit Schendel
4 views•6 min read
•about 4 hours ago•CVE-2026-59204
7.5

CVE-2026-59204: Denial of Service via Memory Exhaustion in Pillow JPEG2000 Decoder

A Denial of Service vulnerability exists in the JPEG2000 decoder of Pillow (versions 8.2.0 to 12.2.0) due to memory allocation state accumulation across tiles, leading to rapid process termination.

Amit Schendel
Amit Schendel
8 views•7 min read
•about 5 hours ago•CVE-2026-59205
7.5

CVE-2026-59205: Heap-Based Buffer Overflow in Pillow ImageCms Module

CVE-2026-59205 is a high-severity heap-based out-of-bounds write vulnerability affecting Pillow prior to version 12.3.0. The flaw stems from a validation omission in the ImageCmsTransform class where source and destination image modes are not checked against the configurations defined during the creation of the transform. An attacker can exploit this discrepancy to trigger a heap buffer overflow or an out-of-bounds read by supplying an under-allocated target image buffer.

Amit Schendel
Amit Schendel
7 views•5 min read