guzzlehttp/guzzle-services' XML Request Serialization Vulnerable to XML Injection via CDATA TerminatorGHSA-q8r6-5hfw-5jff
MEDIUMGHSA-q8r6-5hfw-5jff is a medium-severity (CVSS 5.8) Improper Input Validation vulnerability in guzzlehttp/guzzle-services. A fix is available for guzzlehttp/guzzle-services — see the affected versions and patch details below.
Exploitation Status
No confirmed exploitation observed yet
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-q8r6-5hfw-5jff.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
GHSA-q8r6-5hfw-5jff by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 395,249 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
guzzlehttp/guzzle-servicesReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Packagist packages — download data is not available via public APIs for these ecosystems.
Description
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:
- The application uses
guzzlehttp/guzzle-servicesto serialize outgoing requests. - A request parameter or
additionalParametersschema useslocation: xml. - The value is serialized as XML element text, not an XML attribute.
- The value can contain attacker-controlled, user-controlled, tenant-controlled, or otherwise untrusted input.
- The value is not constrained by a safe
enum,pattern, or custom filter that excludes]]>. - 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
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐘Packagist | guzzlehttp/guzzle-services | all versions | 1.5.4composer require guzzlehttp/guzzle-services:^1.5.4 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for guzzlehttp/guzzle-services, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update guzzlehttp/guzzle-services to 1.5.4 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-q8r6-5hfw-5jff is resolved across your whole dependency graph.
Workarounds
Do not deserialise data from untrusted sources: where the format allows it, restrict deserialisation to an explicit allowlist of expected types, and prefer a data-only format (JSON, Protobuf) over one that can reconstruct arbitrary objects until you can upgrade.
Frequently Asked Questions
Is GHSA-q8r6-5hfw-5jff in your dependencies?
Find it across Packagist, including transitive dependencies.