CVE-2025-66578: Robrichards/xmlseclibs Robrichards/xmlseclibs Has An Libxml2 Canonicalization Vulnerability

MODERATE
Advisory Identifier: GHSA-c4cc-x928-vjw9
CVSS 6.0
CWE-248
Published
Advisory Summary

CVE-2025-66578 is a MODERATE (CVSS 6.0) robrichards/xmlseclibs has an libxml2 canonicalization vulnerability (CWE-248: Uncaught Exception) affecting Robrichards/xmlseclibs libraries in the Packagist ecosystem. The issue involves robrichards/xmlseclibs has an libxml2 canonicalization error which can bypass digest/signature validation. Remediation is available by upgrading affected packages to version 3.1.4.

CVE-2025-66578 at a Glance

CVE Identifier CVE-2025-66578
GHSA Identifier GHSA-c4cc-x928-vjw9
Severity MODERATE
CVSS v3.1 Base Score 6.0
CWE Classification CWE-248: Uncaught Exception
Affected Product Robrichards/xmlseclibs
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 6.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:L/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2025-66578

To remediate this vulnerability, upgrade all affected Robrichards/xmlseclibs dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

robrichards/xmlseclibs fixed: 3.1.4
Upgrade robrichards/xmlseclibs to 3.1.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for robrichards/xmlseclibs

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-66578, inspect your project dependencies for Robrichards/xmlseclibs:

inspect dependencies for robrichards/xmlseclibs

Analyze the terminal output to locate any version of Robrichards/xmlseclibs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.1.4), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-248: Uncaught Exception, where an exception is thrown from a function, but it is not caught. In Robrichards/xmlseclibs, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary An authentication bypass vulnerability exists due to a flaw in the libxml2 canonicalization process, which is used by [xmlseclibs](https://github.com/robrichards/xmlseclibs) during document transformation. This weakness allows an attacker to generate a valid signature once and reuse it indefinitely. In practice, a signature created during a previous interaction - or through a misconfigured authentication flow - can be replayed to bypass authentication checks. ### Details When libxml2’s canonicalization is invoked on an invalid XML input, it may return an empty string rather than a canonicalized node. [xmlseclibs](https://github.com/robrichards/xmlseclibs) then proceeds to compute the DigestValue over this empty string, treating it as if canonicalization succeeded. https://github.com/robrichards/xmlseclibs/blob/f4131320c6dcd460f1b0c67f16f8bf24ce4b5c3e/src/XMLSecurityDSig.php#L296 ### Impact Digest bypass: By crafting input that causes canonicalization to yield an empty string, the attacker can manipulate validation to pass incorrectly. Signature replay on empty canonical form: If an empty string has been signed once (e.g., in a prior interaction or via a misconfigured flow), that signature can potentially be replayed to bypass authentication. ### Suggested remediation Treat canonicalization failures (exceptions or nil/empty outputs) as fatal and abort validation. Add explicit checks: reject when canonicalize returns nil/empty or raise

CVE-2025-66578 Affected Robrichards/xmlseclibs Versions

1 component(s)
Fixed Versions:
3.1.4
Product / Package Ecosystem Affected Versions Fixed Version
robrichards/xmlseclibs
Packagist
< 3.1.4
3.1.4

References

Frequently Asked Questions

What is CVE-2025-66578?
CVE-2025-66578 is a security vulnerability in Robrichards/xmlseclibs involving robrichards/xmlseclibs has an Libxml2 Canonicalization error which can bypass Digest/Signature validation under CWE-248: Uncaught Exception.
Which Robrichards/xmlseclibs versions are affected?
Affected versions include releases prior to 3.1.4 across affected packages: robrichards/xmlseclibs.
What version fixes CVE-2025-66578?
Upgrading to 3.1.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is robrichards/xmlseclibs affected?
Yes, robrichards/xmlseclibs is affected in releases prior to 3.1.4. Upgrade your dependency to 3.1.4 or later.
What is the CVSS score of CVE-2025-66578?
CVE-2025-66578 has a CVSS v3.1 base score of 6.0 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:L/A:L.
What CWE is associated with CVE-2025-66578?
CVE-2025-66578 is classified under CWE-248: Uncaught Exception (An exception is thrown from a function, but it is not caught.).
How can I check Packagist dependencies for CVE-2025-66578?
Run the dependency tree command: 'inspect dependencies for robrichards/xmlseclibs'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-c4cc-x928-vjw9",
  "modified" : "2025-12-09T19:17:52Z",
  "published" : "2025-12-08T17:57:33Z",
  "aliases" : [ "CVE-2025-66578" ],
  "summary" : "robrichards/xmlseclibs has an Libxml2 Canonicalization error which can bypass Digest/Signature validation",
  "details" : "### Summary\nAn authentication bypass vulnerability exists due to a flaw in the libxml2 canonicalization process, which is used by [xmlseclibs](https://github.com/robrichards/xmlseclibs) during document transformation. This weakness allows an attacker to generate a valid signature once and reuse it indefinitely. In practice, a signature created during a previous interaction - or through a misconfigured authentication flow - can be replayed to bypass authentication checks.\n\n### Details\nWhen libxml2’s canonicalization is invoked on an invalid XML input, it may return an empty string rather than a canonicalized node. [xmlseclibs](https://github.com/robrichards/xmlseclibs) then proceeds to compute the DigestValue over this empty string, treating it as if canonicalization succeeded.\n\nhttps://github.com/robrichards/xmlseclibs/blob/f4131320c6dcd460f1b0c67f16f8bf24ce4b5c3e/src/XMLSecurityDSig.php#L296\n\n### Impact\nDigest bypass: By crafting input that causes canonicalization to yield an empty string, the attacker can manipulate validation to pass incorrectly.\n\nSignature replay on empty canonical form: If an empty string has been signed once (e.g., in a prior interaction or via a misconfigured flow), that signature can potentially be replayed to bypass authentication.\n\n### Suggested remediation\nTreat canonicalization failures (exceptions or nil/empty outputs) as fatal and abort validation.\nAdd explicit checks: reject when canonicalize returns nil/empty or raise",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "robrichards/xmlseclibs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.1.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.1.3"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/robrichards/xmlseclibs/security/advisories/GHSA-c4cc-x928-vjw9"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-66578"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/robrichards/xmlseclibs/commit/69fd63080bc47a8d51bc101c30b7cb756862d1d6"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/robrichards/xmlseclibs"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/robrichards/xmlseclibs/blob/f4131320c6dcd460f1b0c67f16f8bf24ce4b5c3e/src/XMLSecurityDSig.php#L296"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-248" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-12-08T17:57:33Z",
    "nvd_published_at" : "2025-12-09T16:18:21Z"
  }
}