Class SecureWSDLLocator

java.lang.Object
org.apache.axis2.util.SecureWSDLLocator
All Implemented Interfaces:
javax.wsdl.xml.WSDLLocator

public class SecureWSDLLocator extends Object implements 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 Details

    • SecureWSDLLocator

      public SecureWSDLLocator(String baseURI)
  • Method Details

    • getBaseInputSource

      public InputSource getBaseInputSource()
      Specified by:
      getBaseInputSource in interface javax.wsdl.xml.WSDLLocator
    • getBaseURI

      public String getBaseURI()
      Specified by:
      getBaseURI in interface javax.wsdl.xml.WSDLLocator
    • getImportInputSource

      public InputSource getImportInputSource(String parentLocation, String importLocation)
      Specified by:
      getImportInputSource in interface javax.wsdl.xml.WSDLLocator
    • getLatestImportURI

      public String getLatestImportURI()
      Specified by:
      getLatestImportURI in interface javax.wsdl.xml.WSDLLocator
    • close

      public void close()
      Specified by:
      close in interface javax.wsdl.xml.WSDLLocator