Summary
Apache Axis2/Java may process external entities when wsdl4j parses WSDL documents and their imports while building a client-side AxisService. If an attacker can control the WSDL or an imported document, this could expose local files or cause the JVM to make network requests.
Affected context
The issue occurs when an Axis2/Java client builds an AxisService from a WSDL URL through ServiceClient or AxisService.createClientSideAxisService. In this flow, wsdl4j resolves wsdl:import and xsd:import documents using its own XML parser, which processes DOCTYPE declarations and external entities. Risk depends on whether an attacker can influence the WSDL or any document it imports.
Exploit preconditions
- Attack surface: Client-side AxisService creation from a WSDL URL, including resolution of imported WSDL or XSD documents
- Required access: Ability to provide or modify the WSDL, or a document referenced by its imports
- Trigger point: wsdl4j parses the WSDL or an imported document during client construction
- Why exploitation is possible: The XML parser processes external entity references, potentially accessing local resources or initiating network requests from the JVM
Why this happens
The underlying issue is that XML parsing processes external entity references in attacker-influenced WSDL documents. When DOCTYPE declarations and external entities are not disabled or restricted, the parser may resolve references to local files or external systems. This is an XML External Entity (XXE) weakness mapped to CWE-611: Improper Restriction of XML External Entity Reference.
Potential impact
- An attacker may read files accessible to the JVM process.
- The JVM could make network requests to attacker-selected or otherwise restricted destinations.
- Sensitive information returned through file or network access could be exposed.
- Internal services reachable from the application environment could be probed.
General mitigation guidance
Defensive approaches focus on preventing untrusted XML from resolving external resources and reducing the trust placed in WSDL inputs.
- Disable DOCTYPE declarations and external general and parameter entities in XML parsing paths.
- Use parser configurations and libraries that reject external entity resolution by default.
- Restrict WSDL and import sources to trusted locations, and validate documents against expected schemas and policies.
- Apply network egress controls and limit the JVM process's access to sensitive local files and internal services.
- Prefer least-privilege runtime permissions and avoid accepting client configuration from untrusted sources.
How teams detect issues like this
- Review client-side WSDL handling and trace how wsdl:import and xsd:import documents are resolved.
- Use static analysis to flag XML parser configurations that permit DOCTYPE or external entity processing.
- Check code and configuration for parser hardening controls across all XML parsing paths, including third-party libraries.
- Enforce policies that restrict WSDL sources and outbound network access from application runtimes.
- Monitor for unexpected file access or outbound requests during WSDL processing; automated code review tools may help identify risky parser patterns.

