CVE-2021-40690 Overview
CVE-2021-40690 is an information disclosure vulnerability affecting Apache Santuario - XML Security for Java. All versions prior to 2.2.3 and 2.1.7 fail to properly pass the "secureValidation" property when creating a KeyInfo from a KeyInfoReference element. This security bypass allows attackers to exploit an XPath Transform within a RetrievalMethod element to extract arbitrary local .xml files from the target system.
The vulnerability stems from improper security validation propagation in the XML signature processing pipeline, enabling unauthorized access to sensitive configuration files, credentials, and other XML-based data stored on vulnerable systems.
Critical Impact
Attackers can leverage this vulnerability to exfiltrate sensitive XML files from affected systems through crafted XML signature requests, potentially exposing configuration data, credentials, and internal application structures.
Affected Products
- Apache Santuario XML Security for Java (versions prior to 2.2.3 and 2.1.7)
- Apache CXF 3.4.4
- Apache TomEE (multiple versions)
- Debian Linux 9.0, 10.0, 11.0
- Oracle Agile PLM 9.3.6
- Oracle Commerce Guided Search 11.3.2
- Oracle Commerce Platform 11.3.2
- Oracle Communications Diameter Intelligence Hub
- Oracle Communications Messaging Server 8.1
- Oracle FLEXCUBE Private Banking 12.1.0
- Oracle Outside In Technology 8.5.5
- Oracle PeopleSoft Enterprise PeopleTools 8.58, 8.59
- Oracle Retail Bulk Data Integration 16.0.3
- Oracle Retail Financial Integration (14.1.3.2, 15.0.3.1, 16.0.3, 19.0.1)
- Oracle Retail Integration Bus (14.1.3.2, 15.0.3.1, 16.0.3, 19.0.1)
- Oracle Retail Merchandising System (16.0.3, 19.0.1)
- Oracle Retail Service Backbone (14.1.3.2, 15.0.3.1, 16.0.3, 19.0.1)
- Oracle WebLogic Server (12.2.1.4.0, 14.1.1.0.0)
Discovery Timeline
- September 19, 2021 - CVE-2021-40690 published to NVD
- November 21, 2024 - Last updated in NVD database
Technical Details for CVE-2021-40690
Vulnerability Analysis
This vulnerability exploits a flaw in how Apache Santuario handles the secureValidation property during XML signature processing. When a KeyInfo element is created from a KeyInfoReference, the security validation settings are not properly inherited or applied to subsequent operations, including XPath Transform processing.
The root issue lies in the XML signature validation flow where security constraints established at a higher level fail to propagate to child element processing. This creates a security gap that allows potentially dangerous XPath operations to execute without the intended restrictions.
Attackers can craft malicious XML documents containing specially constructed RetrievalMethod elements with XPath Transform directives. When processed by a vulnerable version of the library, these transforms can read and exfiltrate local XML files from the server's file system.
Root Cause
The vulnerability is classified under CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor). The underlying cause is the failure to maintain security context when processing KeyInfoReference elements within the XML Security library. Specifically, when the library creates a KeyInfo object from a KeyInfoReference, it does not correctly pass the secureValidation boolean flag, which is designed to restrict potentially dangerous operations like external entity resolution and certain XPath expressions.
Attack Vector
The attack is network-based and requires no authentication or user interaction. An attacker can exploit this vulnerability by sending a crafted XML document to an application that processes XML signatures using a vulnerable version of Apache Santuario. The malicious document would include:
- A RetrievalMethod element pointing to a local XML file
- An XPath Transform that extracts data from the target file
- A KeyInfoReference structure that bypasses the secure validation checks
When the application processes this signature, the XPath Transform executes without security restrictions, allowing the attacker to read the contents of local XML files accessible to the application process.
Detection Methods for CVE-2021-40690
Indicators of Compromise
- Unexpected XML signature validation requests containing RetrievalMethod elements with file:// URIs
- Application logs showing access to local XML files through signature processing
- Network traffic containing XML documents with KeyInfoReference elements referencing local paths
- Unusual file system access patterns from Java-based web applications targeting XML configuration files
Detection Strategies
- Monitor for XML documents containing RetrievalMethod elements with local file paths (file://) in incoming requests
- Implement logging for XML signature validation operations, particularly those involving KeyInfoReference processing
- Deploy web application firewall rules to detect XPath Transform patterns in XML payloads targeting local resources
- Use static code analysis to identify applications using vulnerable versions of Apache Santuario XML Security
Monitoring Recommendations
- Enable verbose logging for XML signature processing components to capture RetrievalMethod and Transform operations
- Monitor file access patterns from Java application processes for unexpected reads of XML files outside normal application scope
- Implement network-level monitoring for large XML responses that may indicate successful data exfiltration
- Review application dependencies regularly to identify outdated Apache Santuario library versions
How to Mitigate CVE-2021-40690
Immediate Actions Required
- Upgrade Apache Santuario XML Security for Java to version 2.2.3 or 2.1.7 or later immediately
- Audit all applications using Apache CXF, TomEE, or Oracle products for vulnerable Santuario versions
- Apply Oracle Critical Patch Updates from April 2022 and July 2022 for affected Oracle products
- Implement input validation for XML documents to reject suspicious RetrievalMethod elements with local file references
Patch Information
Apache has released patched versions 2.2.3 and 2.1.7 of the Santuario XML Security for Java library that properly propagate the secureValidation property during KeyInfoReference processing. Organizations should update to these versions or later. For Oracle products, refer to the Oracle Security Alert April 2022 and Oracle Security Alert July 2022 for product-specific patches. Debian users should refer to the Debian Security Advisory DSA-5010 for distribution-specific updates.
Workarounds
- Implement application-level filtering to reject XML documents containing RetrievalMethod elements with file:// URIs
- Configure web application firewalls to block XML payloads containing XPath Transform elements referencing local paths
- Restrict file system permissions for Java application processes to limit potential data exposure
- Enable XML signature validation in strict mode where available, though this may not fully address the vulnerability without patching
# Maven dependency update example
# Update pom.xml to use patched version:
# <dependency>
# <groupId>org.apache.santuario</groupId>
# <artifactId>xmlsec</artifactId>
# <version>2.2.3</version>
# </dependency>
# Verify current version in use
mvn dependency:tree | grep xmlsec
# Force update to patched version
mvn versions:use-latest-versions -Dincludes=org.apache.santuario:xmlsec
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

