SEVERITY NOT PROVIDED · CVSS 4.0 EPSS 0.2% · 6th percentile CWE-91

CVE-2026-66293: XML comment injection in Saxy encoder via unescaped double hyphen

Published 2026-11-06 · Updated 2026-11-25 · Also known as EEF-CVE-2026-66293, GHSA-mm3m-xwmf-v698

Summary

An XML comment injection vulnerability exists in the Saxy encoder due to insufficient sanitization of double hyphen sequences. Application maintainers serializing untrusted data into XML comments using Saxy versions 0.7.0 up to 1.7.0 should update their dependencies.

Who is affected

Applications that pass attacker-controlled text into Saxy XML comments via Saxy.XML.comment/1 or the {:comment, text} simple form are affected when serialized using Saxy encoding functions. An attacker can close the comment prematurely with a '-->' sequence and inject arbitrary sibling markup, potentially leading to stored cross-site scripting in HTML/SVG outputs or data forgery in XML parsers. Documents processed only by Saxy parsers are not affected.

Exploitability

The vulnerability requires local or physical adjacent access with low attack complexity, though attack requirements are present and privileges required are none. Based on an EPSS score of 0.002 and absence from the CISA KEV list, active exploitation is currently minimal.

Remediation

How to check your project

Automated analysis of the published advisory data, generated 2026-11-25. Not human-reviewed; verify against the official advisory. How this works.

Affected packages

EcosystemPackageAffected versionsFixed inUpgrade
Hex saxy >= 0.7.0, < 1.7.0 1.7.0 mix deps.update saxy

CVSS 4.0 vector

CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N

Attack vectorLocal
Attack complexityLow
Attack requirementsPresent
Privileges requiredNone
User interactionNone
Confidentiality (vulnerable system)None
Integrity (vulnerable system)Low
Availability (vulnerable system)None
Confidentiality (subsequent systems)Low
Integrity (subsequent systems)Low
Availability (subsequent systems)None

Base score is not computed for CVSS 4.0 vectors; severity is taken from the advisory.

FAQ

What causes the XML comment injection vulnerability in Saxy?

The Saxy encoder fails to neutralize or escape the '--' sequence within XML comment content, allowing comment delimiters to be forged.

Which Saxy versions are affected?

Versions from 0.7.0 up to, but not including, 1.7.0 are affected.

Are applications that only parse XML documents using Saxy vulnerable?

No, documents that Saxy only parses do not reach the vulnerable encoder and are not a vector.

Original advisory description
## Summary XML injection in the encoder of Saxy. `Saxy.Encoder` does not neutralize the `--` sequence in XML comment content: `escape_comment/2` returns the comment binary unchanged in every clause and only appends a space when the comment ends in a single `-`, so neither an interior `--` nor a full `-->` is escaped or rejected before the encoder wraps the content in the `<!--` and `-->` delimiters. When an application serializes attacker-controlled text as a comment, through `Saxy.XML.comment/1` or a raw `{:comment, text}` simple form child, the attacker can close the comment early with `-->` and inject arbitrary sibling markup into the serialized document. A downstream parser then sees elements, attributes, and text that the application never built. Where the document is rendered as HTML or SVG, the injected markup executes as stored cross-site scripting; where it is consumed by another XML processor, the attacker can forge data that the producing application never emitted. Documents that Saxy only parses are not a vector. This issue affects saxy: from 0.7.0 before 1.7.0. ## Workarounds Reject or rewrite the `--` sequence in untrusted text before passing it to `Saxy.XML.comment/1`, for example by replacing `--` with `- -`. Alternatively, stop emitting untrusted data as XML comments. Comments carry no semantic payload for consumers, so the text can usually be moved into an element or a CDATA section instead. ## Configurations Only applications that place untrusted text into an XML comment node are affected. The untrusted value must reach `Saxy.XML.comment/1` or a raw `{:comment, text}` simple form child that is then serialized with `Saxy.encode!/2` or `Saxy.encode_to_iodata!/2`. Documents that are only parsed by Saxy never reach the encoder and are not a vector.

References

Source records: EEF-CVE-2026-66293 (OSV.dev) · EPSS by FIRST, 2026-11-25.