XML::Sig (Perl), XPath Injection, CVE-2026-9390 (CRITICAL) -DC-Aug2026-1379

Listen to this Post

Technical Deep Dive: How CVE-2026-9390 Works

This vulnerability resides in the ID lookup mechanism of XML::Sig, a Perl module used for verifying XML digital signatures. The core issue is an XPath injection flaw in versions prior to 0.71, arising from improper handling of the `SignedInfo/Reference/@URI` attribute during signature verification.
When XML::Sig processes a signed XML document, it constructs an XPath expression to locate the element referenced by the signature. This is done in the `verify()` and `_get_signed_xml()` functions within lib/XML/Sig.pm. The library builds this XPath by directly concatenating the value of the `URI` attribute from the `SignedInfo/Reference` element. For example, if the `URI` is id123, the generated XPath might look like //[@ID='id123'].
The critical flaw is that this `URI` value is taken from the XML document being verified without any escaping or validation against the NCName grammar that XML requires for an ID. An attacker can craft a malicious `URI` containing a single quote ('). This single quote prematurely closes the string literal in the generated XPath expression. The attacker can then append arbitrary XPath operators and predicates.
Consider a legitimate XPath: //[@ID='id123']. If an attacker sets the `URI` to ' or 1=1 or 'a'='a, the concatenated XPath becomes //[@ID='' or 1=1 or 'a'='a']. This injected expression evaluates to true for every element in the document, causing the lookup to select all nodes rather than the intended one. The attacker can craft more sophisticated injections to select arbitrary nodes, including elements the reference does not name, or even every element in the document.
Consequently, the digest verification step, which is supposed to confirm the integrity of a specific signed element, is tricked into validating a different, attacker-chosen node. This allows an attacker to bypass the signature validation entirely, potentially making a tampered XML document appear as validly signed. The vulnerability is severe because XML signatures are often used in security-critical contexts like SAML assertions, WS-Security, and document authentication, where a signature bypass can lead to authentication bypass, privilege escalation, or data tampering.

DailyCVE Form:

Platform: Perl Module
Version: < 0.71
Vulnerability: XPath Injection
Severity: CRITICAL (CVSS 9.1)
date: 2026-08-03

Prediction: 2026-08-10

What Undercode Say:

Analytics & Verification

To determine if your system is using a vulnerable version, check the installed XML::Sig module version:

perl -MXML::Sig -e 'print $XML::Sig::VERSION'

If the output is less than 0.71, the system is vulnerable.
The vulnerability can be reproduced by crafting a malicious XML document. Below is a conceptual illustration of the injection point. The `URI` attribute in the `Reference` element is the source of the tainted data.

<Signature xmlns="http://www.w3.org/2000/09/xmldsig">
<SignedInfo>
<Reference URI="' or 1=1 or 'a'='a">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsigenveloped-signature"/>
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsigsha1"/>
<DigestValue>...</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>...</SignatureValue>
</Signature>

The Perl code responsible for the vulnerable XPath construction is in lib/XML/Sig.pm:

Vulnerable code snippet (conceptual)
my $xpath = "//[\@ID='$uri']"; $uri is directly concatenated

This lack of sanitization allows the injection of arbitrary XPath logic.

Exploit:

An unauthenticated attacker can exploit this vulnerability by supplying a specially crafted XML document to an application that uses a vulnerable version of XML::Sig to verify signatures. The attacker controls the `SignedInfo/Reference/@URI` value. By injecting XPath expressions, they can manipulate the ID lookup to select an unintended XML node for digest verification. This can lead to a complete bypass of the signature validation process, allowing the attacker to modify the XML document’s content while still having it appear as validly signed. As of the current date, there is no public exploit code available, and the CVE has not been added to CISA’s Known Exploited Vulnerabilities (KEV) catalog. However, the vulnerability is considered highly exploitable due to the low attack complexity and network attack vector.

Protection:

The primary and definitive protection against CVE-2026-9390 is to upgrade XML::Sig to version 0.71 or later. The vendor has addressed this vulnerability in the patched release. If an immediate upgrade is not possible, implement strict input validation and sanitization for all `URI` attributes in XML documents before they are processed by XML::Sig. Specifically, ensure that any `URI` value used in XPath construction conforms to the NCName grammar and is properly escaped to prevent injection. As a general security best practice, avoid processing untrusted XML documents with vulnerable versions of the library.

Impact:

Successful exploitation of this XPath injection vulnerability allows an attacker to completely subvert the XML signature verification process. This can have severe consequences depending on the application context:
– Authentication Bypass: In systems using SAML or similar single sign-on (SSO) protocols, a forged signature can allow an attacker to impersonate another user.
– Data Tampering: An attacker can modify the contents of a signed XML document (e.g., altering transaction amounts, user roles, or configuration settings) without invalidating the signature.
– Privilege Escalation: By manipulating the verified data, an attacker could potentially gain elevated privileges within the application.
– Loss of Trust: The core purpose of digital signatures—to provide non-repudiation and integrity—is defeated. The system can no longer trust the authenticity of signed XML documents.
The vulnerability has a CVSS v3.1 base score of 9.1 (CRITICAL), reflecting its network exploitable nature, low attack complexity, no required privileges, and high impact on confidentiality and integrity.

🎯Let’s Practice Exploiting & Learn Patching For Free:

🎓 Live Courses & Certifications:

Join Undercode Academy for Verified Certifications

🚀 Request a Custom Project:

Secure, high-velocity infrastructure and disruptive technological engineering. Contact our engineering team for high-tier development and proprietary systems:
[email protected]
💎 Smart Architecture | 🛡️ Secure by Design | ⭐ Trusted by Thousands

Sources:

Reported By: nvd.nist.gov
Extra Source Hub:
Undercode

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow DailyCVE & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin Featured Image

Scroll to Top