Skip to content

Commit 9ce0318

Browse files
1 parent 0d52cd2 commit 9ce0318

3 files changed

Lines changed: 175 additions & 0 deletions

File tree

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-34xg-wgjx-8xph",
4+
"modified": "2026-06-11T13:04:53Z",
5+
"published": "2026-06-11T13:04:53Z",
6+
"aliases": [
7+
"CVE-2026-48998"
8+
],
9+
"summary": "guzzlehttp/psr7 has Host Confusion via Authority Reinterpretation",
10+
"details": "## Impact\n\n`guzzlehttp/psr7` improperly interpreted malformed `Host` header values when constructing request URIs from inbound request data. This issue concerns inbound request parsing and server request construction. It does not require serializing a PSR-7 request, and it is not part of the normal outbound request-sending path used by `guzzlehttp/guzzle`.\n\nA vulnerable flow is:\n\n1. An attacker controls a raw HTTP request or server variable containing a `Host` value.\n2. The `Host` value contains URI authority delimiters, such as `trusted.example@evil.example`.\n3. `guzzlehttp/psr7` uses that value to construct a URI.\n4. The URI parser treats the portion before `@` as userinfo and the portion after `@` as the URI host.\n5. The resulting PSR-7 request URI host differs from the original `Host` header value.\n\nFor example, `Host: trusted.example@evil.example` can result in a PSR-7 URI whose host is `evil.example`, while the original Host header value remains `trusted.example@evil.example`.\n\nApplications are affected if they parse attacker-controlled raw HTTP requests with `GuzzleHttp\\Psr7\\Message::parseRequest()` or the legacy 1.x `GuzzleHttp\\Psr7\\parse_request()` function, or if they build server requests from attacker-controlled server variables with `GuzzleHttp\\Psr7\\ServerRequest::fromGlobals()` or `GuzzleHttp\\Psr7\\ServerRequest::getUriFromGlobals()`, and then rely on the resulting URI host for routing, allow-list checks, credential selection, or forwarding decisions. Applications using `guzzlehttp/psr7` only through Guzzle's standard HTTP client APIs are not expected to be affected. In affected forwarding or gateway scenarios, this may cause requests or credentials to be sent to an unintended host.\n\n## Patches\n\nThe issue is patched in `2.10.2` and later. `1.x` is end-of-life and will not receive a patch.\n\n## Workarounds\n\nIf you cannot upgrade immediately, validate Host values before passing untrusted request data to `Message::parseRequest()`, legacy 1.x `parse_request()`, `ServerRequest::fromGlobals()`, or `ServerRequest::getUriFromGlobals()`.\n\nAccept only `uri-host [ \":\" port ]`. Reject values containing whitespace, control characters, userinfo (`@`), path (`/` or `\\`), query (`?`), fragment (`#`), malformed IP literals or bracket syntax, or invalid port syntax.\n\nDo not validate Host by prefixing it with `http://` and passing it to `parse_url()`, because that can reinterpret malformed values as URI userinfo and host.\n\n## References\n\n* https://www.rfc-editor.org/rfc/rfc9112.html#section-3.2\n* https://www.rfc-editor.org/rfc/rfc9112.html#section-3.3\n* https://www.rfc-editor.org/rfc/rfc9110.html#section-4.2.4\n* https://www.rfc-editor.org/rfc/rfc9110.html#section-7.2",
11+
"severity": [
12+
{
13+
"type": "CVSS_V3",
14+
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
15+
}
16+
],
17+
"affected": [
18+
{
19+
"package": {
20+
"ecosystem": "Packagist",
21+
"name": "guzzlehttp/psr7"
22+
},
23+
"ranges": [
24+
{
25+
"type": "ECOSYSTEM",
26+
"events": [
27+
{
28+
"introduced": "0"
29+
},
30+
{
31+
"fixed": "2.10.2"
32+
}
33+
]
34+
}
35+
]
36+
}
37+
],
38+
"references": [
39+
{
40+
"type": "WEB",
41+
"url": "https://github.com/guzzle/psr7/security/advisories/GHSA-34xg-wgjx-8xph"
42+
},
43+
{
44+
"type": "PACKAGE",
45+
"url": "https://github.com/guzzle/psr7"
46+
}
47+
],
48+
"database_specific": {
49+
"cwe_ids": [
50+
"CWE-20",
51+
"CWE-918"
52+
],
53+
"severity": "MODERATE",
54+
"github_reviewed": true,
55+
"github_reviewed_at": "2026-06-11T13:04:53Z",
56+
"nvd_published_at": null
57+
}
58+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-hq7v-mx3g-29hw",
4+
"modified": "2026-06-11T13:04:47Z",
5+
"published": "2026-06-11T13:04:47Z",
6+
"aliases": [
7+
"CVE-2026-49214"
8+
],
9+
"summary": "guzzlehttp/psr7 has CRLF Injection via URI Host Component",
10+
"details": "## Impact\n\n`guzzlehttp/psr7` did not reject ASCII control characters, whitespace, or DEL in first-party URI host components. The issue requires a PSR-7 request to be serialized into a raw HTTP/1.x message, for example with `GuzzleHttp\\Psr7\\Message::toString()` or an equivalent custom serializer. Creating a `Uri`, `Request`, or other PSR-7 object alone is not sufficient. The malformed host must be copied into the serialized `Host` header without further validation.\n\nA vulnerable flow is:\n\n1. An application accepts a user-controlled URL.\n2. The URL is used to construct a PSR-7 `Uri` or `Request`.\n3. The host component contains CRLF or another header-unsafe character.\n4. The request is serialized into a raw HTTP/1.x message without an explicit `Host` header.\n5. The host is copied into the serialized `Host` header.\n6. The serialized request is written to the network or otherwise processed by software that does not independently reject the malformed host.\n\nIn that flow, an attacker can cause the serialized request to contain additional attacker-controlled header lines. For example, a host containing `\"\\r\\nX-Injected: yes\"` can cause the generated `Host` header to span multiple HTTP header lines.\n\nThis is not the normal request-sending path used by `guzzlehttp/guzzle`. Applications using `guzzlehttp/psr7` only through Guzzle's standard HTTP client APIs are not expected to be affected. Applications are most likely to be affected when they manually serialize PSR-7 requests, forward raw HTTP messages, or use custom transports, proxying, crawling, webhook delivery, or similar request-dispatch code that serializes requests without independently validating URI hosts and header data. In deployments involving HTTP/1.1 connection reuse, proxies, gateways, or load balancers, this malformed serialized request may also contribute to request smuggling or cache poisoning, depending on how downstream components parse the request.\n\n## Patches\n\nThe issue is patched in `2.10.2` and later. `1.x` is end-of-life and will not receive a patch.\n\n## Workarounds\n\nIf you cannot upgrade immediately, validate and reject all untrusted URI strings before constructing PSR-7 `Uri` or `Request` instances. Reject input containing ASCII control characters, whitespace, or DEL, including CRLF, tab, space, NUL, or DEL characters:\n\n```php\nif (preg_match('/[\\x00-\\x20\\x7F]/', $untrustedUrl)) {\n throw new \\InvalidArgumentException('Insecure URL detected');\n}\n```\n\nApplications that manually serialize or forward requests should also ensure the final HTTP client, transport, or serializer rejects invalid URI and header data before writing requests to the network.\n\n## References\n\n* https://www.rfc-editor.org/rfc/rfc9112.html#section-3.2\n* https://www.rfc-editor.org/rfc/rfc9112.html#section-5\n* https://www.rfc-editor.org/rfc/rfc9112.html#section-11.2\n* https://www.rfc-editor.org/rfc/rfc9110.html#section-7.2",
11+
"severity": [
12+
{
13+
"type": "CVSS_V3",
14+
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
15+
}
16+
],
17+
"affected": [
18+
{
19+
"package": {
20+
"ecosystem": "Packagist",
21+
"name": "guzzlehttp/psr7"
22+
},
23+
"ranges": [
24+
{
25+
"type": "ECOSYSTEM",
26+
"events": [
27+
{
28+
"introduced": "0"
29+
},
30+
{
31+
"fixed": "2.10.2"
32+
}
33+
]
34+
}
35+
]
36+
}
37+
],
38+
"references": [
39+
{
40+
"type": "WEB",
41+
"url": "https://github.com/guzzle/psr7/security/advisories/GHSA-hq7v-mx3g-29hw"
42+
},
43+
{
44+
"type": "PACKAGE",
45+
"url": "https://github.com/guzzle/psr7"
46+
}
47+
],
48+
"database_specific": {
49+
"cwe_ids": [
50+
"CWE-113",
51+
"CWE-20",
52+
"CWE-93"
53+
],
54+
"severity": "MODERATE",
55+
"github_reviewed": true,
56+
"github_reviewed_at": "2026-06-11T13:04:47Z",
57+
"nvd_published_at": null
58+
}
59+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-q8r6-5hfw-5jff",
4+
"modified": "2026-06-11T13:05:01Z",
5+
"published": "2026-06-11T13:05:01Z",
6+
"aliases": [
7+
"CVE-2026-53723"
8+
],
9+
"summary": "guzzlehttp/guzzle-services' XML Request Serialization Vulnerable to XML Injection via CDATA Terminator",
10+
"details": "### Impact\n\n`guzzlehttp/guzzle-services` does not safely serialize scalar XML element values containing the CDATA terminator `]]>`. The XML request serializer writes values containing `<`, `>`, or `&` with `XMLWriter::writeCData($value)`. If attacker-controlled input contains `]]>`, the CDATA section closes early and the remainder is interpreted as XML markup. This is an outgoing request-body integrity issue, not a response parsing issue. The attacker does not need to control the service description or schema.\n\nUsers are affected when all of the following are true:\n\n1. The application uses `guzzlehttp/guzzle-services` to serialize outgoing requests.\n2. A request parameter or `additionalParameters` schema uses `location: xml`.\n3. The value is serialized as XML element text, not an XML attribute.\n4. The value can contain attacker-controlled, user-controlled, tenant-controlled, or otherwise untrusted input.\n5. The value is not constrained by a safe `enum`, `pattern`, or custom filter that excludes `]]>`.\n6. The downstream service parses the generated XML structurally and may act on unexpected, duplicated, or injected elements.\n\nApplications that serialize untrusted input into `location: xml` request parameters can emit XML containing attacker-controlled elements outside the intended text node. Depending on the receiving service, this can alter operation semantics, smuggle privileged fields, bypass modeled parameter boundaries, or create conflicting duplicated elements. Fixed service descriptions are sufficient if they contain an XML element parameter populated from attacker-controlled input.\n\nUsers are not directly affected if they only use Guzzle Services to deserialize HTTP response bodies. Response XML parsing uses the response XML location visitor and does not invoke the vulnerable request XML serializer. Response bodies matter only in a second-order flow, such as parsing attacker-controlled response XML, storing or forwarding a parsed string value, and later using it as a `location: xml` request parameter.\n\nExample fixed service description:\n\n```php\n'DisplayName' => ['location' => 'xml', 'type' => 'string']\n```\n\nIf an attacker-controlled display name is:\n\n```text\nAlice]]></DisplayName><Role>admin</Role><DisplayName><![CDATA[\n```\n\nthe vulnerable serializer can emit an injected element outside the intended `DisplayName` text node:\n\n```xml\n<Request><DisplayName><![CDATA[Alice]]></DisplayName><Role>admin</Role><DisplayName><![CDATA[]]></DisplayName></Request>\n```\n\nIf the downstream service treats `<Role>` as meaningful, the attacker has set a field the modeled `DisplayName` parameter was not intended to set.\n\n### Patches\n\nThe issue is patched in `1.5.4` and later by safely splitting embedded CDATA terminators before serialization. The fix preserves the original scalar value as XML text and prevents injected nodes.\n\n### Workarounds\n\nIf you cannot upgrade immediately, constrain attacker-controlled XML element values with a strict `enum`, `pattern`, or custom filter that excludes `]]>`, or avoid serializing untrusted data into `location: xml` element text until patched. Where appropriate for the service schema, XML attributes are not affected because they are written with XMLWriter attribute APIs rather than CDATA sections.\n\nTo determine whether action is needed, search service descriptions for request parameters using `location: xml`, including operation `parameters` and `additionalParameters`. Response-only `models` are not directly affected unless parsed values are reused for request serialization. For object and array parameters, review nested scalar properties because leaf element values can still be affected.\n\n### References\n\n- https://www.w3.org/TR/xml/#sec-cdata-sect\n- https://www.php.net/manual/en/xmlwriter.writecdata.php\n- https://www.php.net/manual/en/xmlwriter.text.php",
11+
"severity": [
12+
{
13+
"type": "CVSS_V3",
14+
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N"
15+
}
16+
],
17+
"affected": [
18+
{
19+
"package": {
20+
"ecosystem": "Packagist",
21+
"name": "guzzlehttp/guzzle-services"
22+
},
23+
"ranges": [
24+
{
25+
"type": "ECOSYSTEM",
26+
"events": [
27+
{
28+
"introduced": "0"
29+
},
30+
{
31+
"fixed": "1.5.4"
32+
}
33+
]
34+
}
35+
]
36+
}
37+
],
38+
"references": [
39+
{
40+
"type": "WEB",
41+
"url": "https://github.com/guzzle/guzzle-services/security/advisories/GHSA-q8r6-5hfw-5jff"
42+
},
43+
{
44+
"type": "PACKAGE",
45+
"url": "https://github.com/guzzle/guzzle-services"
46+
}
47+
],
48+
"database_specific": {
49+
"cwe_ids": [
50+
"CWE-20",
51+
"CWE-91"
52+
],
53+
"severity": "MODERATE",
54+
"github_reviewed": true,
55+
"github_reviewed_at": "2026-06-11T13:05:01Z",
56+
"nvd_published_at": null
57+
}
58+
}

0 commit comments

Comments
 (0)