Skip to main content

xmlseclibs CVE-2025-66578

HIGH
Uncaught Exception (CWE-248)
2025-12-09 security-advisories@github.com
7.5
CVSS 3.1 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit crafted invalid XML to validator
  2. Exploit
    Force libxml2 canonicalization to empty string
  3. Execution
    Replay signature over empty canonical form
  4. Impact
    Bypass signature/authentication validation

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A10:2025 - Mishandling of Exceptional Conditions
ASVS 5.0
V16 - Security Logging and Error Handling Exception handling completeness
Exploitation Conditions

Exploitation targets xmlseclibs' signature-validation path (XMLSecurityDSig::canonicalizeData): the attacker must supply XML input that is invalid enough that libxml2's C14N canonicalization returns an empty string instead of a canonicalized node, causing the DigestValue to be computed over an empty string. The high-impact variant (signature replay/authentication bypass) additionally requires that a signature over the empty canonical form exists from a prior interaction or a misconfigured authentication flow, which can then be replayed indefinitely. Limiting factors: the attack is only exploitable against applications using xmlseclibs <= 3.1.3 for signature verification (e.g. SAML/XML-DSig consumers), the replay scenario depends on availability of a signature over an empty canonical form, and the flaw is neutralized by the 3.1.4 fix or by the documented workaround of treating nil/empty/exception canonicalization results as fatal.

Impact

Signals are mixed and point to a conditional, not mass-exploitable, flaw. The provided CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N, base 7.5) models a network-reachable, unauthenticated integrity-only impact, which maps to the digest/signature-validation bypass. However, EPSS is low at 0.24% (14th percentile), the CVE is NOT on CISA KEV, and the GHSA advisory itself frames the strongest impact (signature replay) as requiring that an empty canonical form was signed in a prior interaction or via a misconfigured flow - a meaningful precondition the AC:L rating understates. Publicly available exploit code exists (vendor GHSA), but POC availability is distinct from active exploitation and there is no evidence of exploitation in the wild. Net: this is a genuine authentication-bypass weakness in signature verification worth prioritizing for any PHP service that trusts xmlseclibs for XML signature validation (e.g. SAML SSO), but the low EPSS, absent KEV, and conditional replay prerequisite argue this is a targeted/opportunistic risk rather than a broadly wormable one. Note the CVSS AC:L versus the advisory's described preconditions is a conflict - the practical attack complexity is likely higher than the base score implies.

Exploit ScenarioDerived

An attacker crafts invalid XML that causes libxml2 canonicalization to return an empty string; xmlseclibs computes the DigestValue over that empty string and treats validation as successful, letting a signature produced over an empty canonical form be replayed to pass authentication checks. Publicly available exploit code is referenced in the vendor GHSA advisory. Because the CVSS vector is AV:N/AC:L/PR:N, the entry point is remote and unauthenticated, though successful replay realistically depends on a previously signed empty canonical form.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 07, 2026

Signature validation in the PHP library xmlseclibs 3.1.3 and earlier can be bypassed because a libxml2 canonicalization failure returns an empty string instead of an error, causing the library to compute the DigestValue over that empty string and accept the document as valid. The weakness is reachable by unauthenticated remote attackers (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N, 7.5) against PHP applications that use xmlseclibs for XML-DSig verification, most notably SAML and other XML-signature consumers; the more severe signature-replay/authentication-bypass variant additionally requires that a signature over the empty canonical form already exists from a prior interaction or misconfigured flow, so overall risk is conditional rather than mass-exploitable. Publicly available exploit code exists, but exploitation is not confirmed active (no CISA KEV listing) and EPSS is only 0.24% (14th percentile), while the vendor-released fix in 3.1.4 removes the flaw.

RemediationAI

Upgrade to xmlseclibs 3.1.4, the vendor-released patched version (composer require robrichards/xmlseclibs:^3.1.4), which adds an explicit failure check in canonicalizeData() so that a false return from DOMNode::C14N() raises an exception instead of silently succeeding; the fix is in commit 69fd63080bc47a8d51bc101c30b7cb756862d1d6 and documented at https://github.com/robrichards/xmlseclibs/security/advisories/GHSA-c4cc-x928-vjw9. If immediate upgrade is not possible, apply the documented workaround in application code: treat canonicalization failure as fatal by aborting signature validation whenever canonicalize returns nil/empty or throws, and reject documents whose canonical form is an empty string - the trade-off is that you are modifying validation logic yourself and risk introducing new failure modes, so this should be treated as temporary. Because replay of a previously captured signature over the empty canonical form is a prerequisite for the authentication-bypass scenario, tightening replay defenses (short signature/assertion validity windows, one-time use of SAML assertion IDs, and rejecting assertions that were valid longer than the expected clock skew) reduces exposure without patching, at the cost of potentially rejecting legitimate clock-skewed messages. No KEV status applies, and EPSS is low (0.24%), so prioritization should focus on internet-facing SAML/XML-DSig endpoints running the unpatched library.

Affected Packages

composer robrichards/xmlseclibs fix: 3.1.4

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in composer

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

xmlseclibs is a PHP implementation of XML Encryption and XML Signature (XML-DSig/SAML) processing that relies on PHP's libxml2 binding for canonicalization. When building the signed-info digest it calls XMLSecurityDSig::canonicalizeData(), which invokes DOMNode::C14N() (exclusive/inclusive canonical XML) via $node->C14N($exclusive, $withComments, $arXPath, $prefixList). On malformed or otherwise invalid XML input, libxml2's canonicalization can return an empty string rather than raising, and the pre-3.1.4 code returned that value directly. Because the return value was treated as a successful canonical form, the DigestValue was computed over an empty string and the digest/signature check could pass incorrectly, allowing digest bypass and - when a signature over the empty canonical form is available - indefinite signature replay. The 3.1.4 commit (69fd63080bc47a8d51bc101c30b7cb756862d1d6) adds an explicit check that throws an Exception('Canonicalization failed') when C14N() returns false. The issue maps to CWE-248 (Uncaught Exception), reflecting improper handling of a library failure condition rather than a memory-safety or crypto-primitive break.

Know when Xmlseclibs gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

NVD PRIMARY 7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
vuln.today AI 5.9 MEDIUM

Remote and unauthenticated (AV:N/PR:N), but reliable bypass depends on a replayable signature over an empty canonical form, so AC:H; impact is integrity-only on signature validation (I:H, C/A:N).

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
4.0 AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N

Primary rating from NVD.

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
None

DescriptionNVD

xmlseclibs is a library written in PHP for working with XML Encryption and Signatures. Versions 3.1.3 contain an authentication bypass vulnerability due to a flaw in the libxml2 canonicalization process during document transformation. When libxml2’s canonicalization is invoked on an invalid XML input, it may return an empty string rather than a canonicalized node. xmlseclibs then proceeds to compute the DigestValue over this empty string, treating it as if canonicalization succeeded. This issue is fixed in version 3.1.4. Workarounds include treating canonicalization failures (exceptions or nil/empty outputs) as fatal and aborting validation, and/or adding explicit checks to reject when canonicalize returns nil/empty or raises errors.

Executive ViewAI

Why It Matters

PHP applications that depend on the xmlseclibs library (3.1.3 and earlier) to validate XML digital signatures - most prominently SAML-based single sign-on and other XML-Signature consumers - can be induced to accept a signature that should have been rejected, meaning an unauthenticated remote party may be able to obtain a trusted identity assertion or session. The dependency is embedded widely and often pulled in transitively, so affected systems are likely undercounted without a deliberate inventory. Leadership should care because the exposure sits directly in the identity and access path, and the more severe authentication-bypass variant requires an attacker to already possess a signature over an empty canonical form from a prior interaction, making risk conditional but still material for internet-facing SAML endpoints.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.2%
Top 86% exploitable
Prevalence
Medium
de facto standard PHP library for XML signatures and SAML SSO
Exploit
POC
Public exploit code exists
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC Yes
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
High

Priority Score

58
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

Affected Products (CPE)NVD

cpe:2.3:a:xmlseclibs_project:xmlseclibs:*:*:*:*:*:*:*:*

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy