MEDIUM 5.8

CVE-2026-55767: Guzzle Cookie Domain Validation Flaw – PHP HTTP Client Injection

Guzzle, a popular PHP HTTP client library, has a flaw in how it validates cookie attributes. The library incorrectly permits cookies with a domain attribute that is either completely empty or contains only whitespace, after normalization. When an attacker-controlled web server sets such a malformed cookie, Guzzle stores it and then sends it to any downstream host that the application requests using the same cookie jar—regardless of domain matching rules. This cookie injection could be leveraged for session fixation or other cookie-based attacks against services downstream from the vulnerable application.

Source data · NVD / CISA · public domain

CVSS
3.1 · 5.8 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N
Weaknesses (CWE)
CWE-1286, CWE-346
Affected products
1 configuration(s)
Published / Modified
2026-06-23 / 2026-06-26

NVD description (verbatim)

Guzzle is an extensible PHP HTTP client. Prior to 7.12.1, CookieJar incorrectly accepts cookies with a dot-only Domain attribute and whitespace-padded variants. SetCookie::matchesDomain() removes leading dots from the cookie domain, normalizing dot-only values to the empty string; SetCookie::validate() only rejected a strictly empty domain, so these cookies could be stored and the empty normalized domain was treated as matching any request host. An attacker-controlled origin that an application requests with a shared cookie jar can therefore set a cookie that Guzzle later sends to unrelated hosts using the same jar. This may allow cookie injection or session fixation against downstream services, depending on how those services interpret the injected cookie. This vulnerability is fixed in 7.12.1.

1 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability stems from insufficient validation in SetCookie::validate(). The method removes leading dots from domain attributes via SetCookie::matchesDomain(), which converts dot-only values to empty strings. However, validate() only rejects strictly empty domains, leaving whitespace-padded and post-normalization-empty domains undetected. These malformed cookies bypass storage checks, and because the normalized empty domain matches any request host, Guzzle applies the cookie to all downstream requests made through the same jar. An attacker can exploit this by hosting an endpoint that a vulnerable application requests, injecting a specially crafted Set-Cookie header to compromise cookie integrity and isolation.

Business impact

Applications using Guzzle with shared cookie jars across multiple upstream and downstream services face injection attacks. A compromised third-party endpoint or attacker-controlled origin can inject cookies that propagate to unrelated services, potentially stealing sessions, escalating privileges, or bypassing authentication controls. The impact depends on how downstream services interpret injected cookies and the trust model of the application architecture.

Affected systems

Guzzle versions prior to 7.12.1 are affected. Applications that instantiate a single CookieJar and reuse it across multiple HTTP requests to different hosts—a common pattern for connection pooling and efficiency—face the highest risk. PHP applications relying on Guzzle for HTTP operations are directly vulnerable.

Exploitability

Exploitation requires network access to an endpoint that the vulnerable application will request. The attacker controls the HTTP response headers from that endpoint and injects a malformed Set-Cookie header. No authentication, user interaction, or victim-side complexity is required; the vulnerability triggers automatically when Guzzle processes the response. The CVSS score of 5.8 reflects the network-accessible nature and lack of prerequisites, though integrity impact is limited to cookie scope rather than broader data compromise.

Remediation

Upgrade Guzzle to version 7.12.1 or later, which includes corrected validation logic in SetCookie::validate() to reject empty and whitespace-padded domain attributes. For applications unable to patch immediately, consider using separate cookie jar instances per upstream host or disabling cookie persistence for untrusted origins.

Patch guidance

Update the guzzlephp/guzzle package to 7.12.1 or newer. Verify the fix in vendor advisory documentation to confirm version alignment with your codebase. If using a dependency manager such as Composer, run `composer update guzzlephp/guzzle` to pull the patched version, then test integration with downstream services to ensure cookie handling remains correct.

Detection guidance

Monitor logs for Set-Cookie headers with empty or whitespace-only domain attributes originating from external endpoints. Inspect cookie jar contents at runtime to identify cookies with missing or malformed domain fields. Code review should flag any HTTP responses from third-party or user-controlled origins that are processed by Guzzle instances using shared jar objects. Security scanning tools should verify that installed Guzzle versions match 7.12.1 or later.

Why prioritize this

Although the CVSS score is medium (5.8), the vulnerability should be prioritized based on deployment scope: applications that request multiple external services using a shared cookie jar are at immediate risk. Cookie injection attacks can have cascading effects in microservice or API-gateway architectures. The fix is straightforward and non-breaking, making rapid remediation low-risk.

Risk score, explained

The CVSS 3.1 score of 5.8 (Medium severity) reflects a network-accessible attack vector with low complexity, no privileges or user interaction required, but limited to integrity impact within cookie scope. The vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N indicates scope change because the attack can affect downstream services beyond the immediate Guzzle consumer. Confidentiality and availability are not directly impacted by the cookie injection itself.

Frequently asked questions

Does this affect all uses of Guzzle, or only specific configurations?

The vulnerability is present in affected Guzzle versions regardless of configuration, but exploitation requires that an application reuse a single CookieJar instance across requests to multiple hosts. Applications using separate cookie jars per host or disabling cookie persistence are at lower risk.

Can this vulnerability be exploited without control of an endpoint the application requests?

No. The attacker must control or compromise an HTTP endpoint that the vulnerable application makes requests to, so that the attacker can inject the malformed Set-Cookie header in the response. If an application only requests trusted, first-party endpoints, the attack surface is reduced.

What is the difference between this vulnerability and a traditional cross-site request forgery (CSRF)?

This is not CSRF. CSRF exploits legitimate cookie submission by the browser. This vulnerability exploits incorrect validation and domain matching in Guzzle's own cookie jar, allowing an attacker to inject cookies that should never be sent to a particular host. It is closer to cookie injection or session fixation in a server-to-server context.

If we upgrade to 7.12.1, do we need to clear existing malformed cookies?

Upgrading prevents new malformed cookies from being stored. However, if a vulnerable version previously stored injected cookies, they may still reside in the persistent cookie jar file or in-memory store. Consider clearing the jar or resetting application state after upgrading, particularly if upstream sources were untrusted during the vulnerable period.

This analysis is based on publicly available vulnerability data and vendor documentation as of the publication date. Specific version numbers, patch dates, and remediation steps should be verified against the official Guzzle security advisories and release notes before implementation. SEC.co makes no warranty regarding the completeness or accuracy of derived risk assessments. Security teams should conduct their own impact analysis based on their environment, architecture, and dependency trees. This vulnerability intelligence does not constitute legal advice or guarantee of protection against exploitation. Source: NVD (public-domain), retrieved 2026-07-28. Analysis generated by SEC.co (claude-haiku-4-5).