GHSA-Q8R6-5HFW-5JFF

Vulnerability from github – Published: 2026-06-11 13:05 – Updated: 2026-06-12 19:24
VLAI
Summary
guzzlehttp/guzzle-services' XML Request Serialization Vulnerable to XML Injection via CDATA Terminator
Details

Impact

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.

Users are affected when all of the following are true:

  1. The application uses guzzlehttp/guzzle-services to serialize outgoing requests.
  2. A request parameter or additionalParameters schema uses location: xml.
  3. The value is serialized as XML element text, not an XML attribute.
  4. The value can contain attacker-controlled, user-controlled, tenant-controlled, or otherwise untrusted input.
  5. The value is not constrained by a safe enum, pattern, or custom filter that excludes ]]>.
  6. The downstream service parses the generated XML structurally and may act on unexpected, duplicated, or injected elements.

Applications 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.

Users 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.

Example fixed service description:

'DisplayName' => ['location' => 'xml', 'type' => 'string']

If an attacker-controlled display name is:

Alice]]></DisplayName><Role>admin</Role><DisplayName><![CDATA[

the vulnerable serializer can emit an injected element outside the intended DisplayName text node:

<Request><DisplayName><![CDATA[Alice]]></DisplayName><Role>admin</Role><DisplayName><![CDATA[]]></DisplayName></Request>

If the downstream service treats <Role> as meaningful, the attacker has set a field the modeled DisplayName parameter was not intended to set.

Patches

The 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.

Workarounds

If 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.

To 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.

References

  • https://www.w3.org/TR/xml/#sec-cdata-sect
  • https://www.php.net/manual/en/xmlwriter.writecdata.php
  • https://www.php.net/manual/en/xmlwriter.text.php
Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Packagist",
        "name": "guzzlehttp/guzzle-services"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "1.5.4"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-53723"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-20",
      "CWE-91"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-06-11T13:05:01Z",
    "nvd_published_at": "2026-06-11T14:16:31Z",
    "severity": "MODERATE"
  },
  "details": "### Impact\n\n`guzzlehttp/guzzle-services` does not safely serialize scalar XML element values containing the CDATA terminator `]]\u003e`. The XML request serializer writes values containing `\u003c`, `\u003e`, or `\u0026` with `XMLWriter::writeCData($value)`. If attacker-controlled input contains `]]\u003e`, 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 `]]\u003e`.\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\u0027DisplayName\u0027 =\u003e [\u0027location\u0027 =\u003e \u0027xml\u0027, \u0027type\u0027 =\u003e \u0027string\u0027]\n```\n\nIf an attacker-controlled display name is:\n\n```text\nAlice]]\u003e\u003c/DisplayName\u003e\u003cRole\u003eadmin\u003c/Role\u003e\u003cDisplayName\u003e\u003c![CDATA[\n```\n\nthe vulnerable serializer can emit an injected element outside the intended `DisplayName` text node:\n\n```xml\n\u003cRequest\u003e\u003cDisplayName\u003e\u003c![CDATA[Alice]]\u003e\u003c/DisplayName\u003e\u003cRole\u003eadmin\u003c/Role\u003e\u003cDisplayName\u003e\u003c![CDATA[]]\u003e\u003c/DisplayName\u003e\u003c/Request\u003e\n```\n\nIf the downstream service treats `\u003cRole\u003e` 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 `]]\u003e`, 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",
  "id": "GHSA-q8r6-5hfw-5jff",
  "modified": "2026-06-12T19:24:06Z",
  "published": "2026-06-11T13:05:01Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/guzzle/guzzle-services/security/advisories/GHSA-q8r6-5hfw-5jff"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-53723"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/guzzle/guzzle-services"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "guzzlehttp/guzzle-services\u0027 XML Request Serialization Vulnerable to XML Injection via CDATA Terminator"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…