Package org.apache.axis2.util
Class SecureWSDLLocator
java.lang.Object
org.apache.axis2.util.SecureWSDLLocator
- All Implemented Interfaces:
javax.wsdl.xml.WSDLLocator
A
WSDLLocator that fetches imported WSDL/XSD documents and
validates them with a hardened XML parser before returning them to
wsdl4j. This prevents XXE (XML External Entity) attacks via
<!DOCTYPE> declarations in imported documents.
wsdl4j's internal WSDLReaderImpl.getDocument() creates its
own DocumentBuilderFactory without XXE hardening. By supplying
this locator, Axis2 intercepts import resolution and ensures that
every imported document is parsed by a secure parser first. If the
document contains a DOCTYPE declaration, parsing fails and the
import is rejected before wsdl4j's vulnerable parser sees it.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()getImportInputSource(String parentLocation, String importLocation)
-
Constructor Details
-
SecureWSDLLocator
-
-
Method Details
-
getBaseInputSource
- Specified by:
getBaseInputSourcein interfacejavax.wsdl.xml.WSDLLocator
-
getBaseURI
- Specified by:
getBaseURIin interfacejavax.wsdl.xml.WSDLLocator
-
getImportInputSource
- Specified by:
getImportInputSourcein interfacejavax.wsdl.xml.WSDLLocator
-
getLatestImportURI
- Specified by:
getLatestImportURIin interfacejavax.wsdl.xml.WSDLLocator
-
close
public void close()- Specified by:
closein interfacejavax.wsdl.xml.WSDLLocator
-