Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2025-9714 Overview
CVE-2025-9714 is an uncontrolled recursion vulnerability in the XPath evaluation engine of libxml2 through version 2.9.14. The flaw resides in the xmlXPathRunEval, xmlXPathCtxtCompile, and xmlXPathEvalExpr functions, which reset recursion depth to zero before making potentially recursive calls. A local attacker can supply a crafted XPath expression that triggers deeply nested recursion, exhausts the stack, and crashes the host process. The issue is tracked under [CWE-674: Uncontrolled Recursion] and affects any application that evaluates untrusted XPath expressions through libxml2.
Critical Impact
A local attacker supplying crafted XPath expressions can trigger a stack overflow in any process linked against vulnerable libxml2 versions, producing a denial-of-service condition.
Affected Products
- xmlsoft libxml2 versions up to and including 2.9.14
- Debian LTS distributions bundling vulnerable libxml2 packages
- Siemens industrial products referenced in advisory SSA-577017
Discovery Timeline
- 2025-09-10 - CVE-2025-9714 published to the National Vulnerability Database
- 2026-10-19 - Last updated in NVD database
Technical Details for CVE-2025-9714
Vulnerability Analysis
The vulnerability affects the XPath 1.0 evaluation pipeline inside libxml2. Three entry points, xmlXPathRunEval, xmlXPathCtxtCompile, and xmlXPathEvalExpr, initialize the context recursion depth counter to zero at the start of each invocation. When these functions are reached through a nested XPath evaluation path, the counter is reset even though the stack is already partially consumed. The depth-limit safeguard is therefore bypassed and the evaluator continues recursing until the process stack is exhausted.
A crafted expression that nests predicates, function calls, or sub-expressions can force the parser into reentrant evaluation. Each reentry trims the depth counter back to zero while the native call stack keeps growing. The result is a stack overflow that aborts the host process.
Root Cause
The root cause is improper preservation of recursion state across reentrant calls. The affected functions treated recursion depth as a per-call value rather than a per-context value. The fix, applied in upstream commit 677a42645ef22b5a50741bad5facf9d8a8bc6d21, preserves the recursion depth across recursive calls so that the configured depth limit is enforced globally.
Attack Vector
Exploitation requires local access and low privileges on a host running an application that evaluates attacker-controlled XPath expressions through libxml2. The attacker does not need user interaction. Successful exploitation produces a crash of the consuming application. Confidentiality and integrity are not affected, but availability loss is complete for the targeted process. See the GitLab commit and the Debian LTS Security Announcement for technical details.
No public proof-of-concept code has been released. The upstream fix describes the recursion-depth semantics rather than a weaponized exploit, so no sanitized exploitation example is provided here.
Detection Methods for CVE-2025-9714
Indicators of Compromise
- Unexpected SIGSEGV or stack-overflow termination of processes linked against libxml2, especially services that parse XML or XSLT from untrusted sources.
- Core dumps whose backtraces show deep recursion through xmlXPathRunEval, xmlXPathCompOpEval, or related XPath evaluator frames.
- Repeated restarts of XML-processing daemons triggered by locally supplied inputs.
Detection Strategies
- Inventory all packages and container images that bundle libxml2 and flag versions at or below 2.9.14.
- Enable core-dump collection on hosts running XML-heavy workloads and parse stack frames for recursive XPath call chains.
- Correlate process-crash telemetry with recent file writes or user activity to identify local actors supplying crafted XPath expressions.
Monitoring Recommendations
- Monitor application logs and systemd crash counters for repeated terminations of XML-processing services.
- Alert on abnormal CPU and stack-growth patterns in long-running libxml2-dependent processes.
- Track vendor advisories such as Siemens SSA-577017 for product-specific patch availability.
How to Mitigate CVE-2025-9714
Immediate Actions Required
- Upgrade libxml2 to a version that includes upstream commit 677a42645ef22b5a50741bad5facf9d8a8bc6d21.
- Apply distribution updates from Debian LTS and other maintainers that ship a backported fix.
- Restrict local accounts and sandboxing policies on hosts that parse XPath expressions supplied by lower-privileged users.
Patch Information
The upstream fix is tracked in the GNOME GitLab repository under commit 677a42645ef22b5a50741bad5facf9d8a8bc6d21. The patch modifies xmlXPathRunEval, xmlXPathCtxtCompile, and xmlXPathEvalExpr so that the recursion depth counter is preserved across reentrant calls, allowing the existing XPATH_MAX_RECURSION_DEPTH limit to take effect. Debian LTS users should install the fixed package per the Debian LTS Security Announcement. Siemens customers should follow guidance in SSA-577017.
Workarounds
- Reject or sanitize XPath expressions originating from untrusted local users until patches are deployed.
- Lower the compiled-in XPath recursion limit for applications that embed libxml2 and rebuild where feasible.
- Run XML-processing services under resource-limited accounts with RLIMIT_STACK constraints to contain stack-exhaustion impact.
# Example: verify the installed libxml2 version on Debian-based systems
dpkg -l | grep libxml2
apt-get update && apt-get install --only-upgrade libxml2
# Constrain stack size for a service to reduce blast radius
ulimit -s 2048
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

