Skip to content

Latest commit

 

History

History
55 lines (41 loc) · 6.43 KB

File metadata and controls

55 lines (41 loc) · 6.43 KB

Mitigation Strategies Analysis for jwagenleitner/groovy-wslite

Description:

  1. Understand groovy-wslite's XML Handling: Recognize that groovy-wslite relies on Groovy's XML parsing capabilities (primarily XmlSlurper and XmlParser) for processing SOAP messages. These, in turn, use Java's XML processing libraries.
  2. Identify XML Parsing Contexts: Determine if your application directly manipulates XML using XmlSlurper or XmlParser in conjunction with groovy-wslite, especially when pre-processing requests or post-processing responses before or after using groovy-wslite's SOAPClient.
  3. Configure Underlying XML Parsers (if directly used): If you are directly using XmlSlurper or XmlParser, configure the underlying SAXParserFactory or DocumentBuilderFactory to disable external entity resolution. This is crucial to prevent XXE vulnerabilities if you are handling XML outside of groovy-wslite's core request/response handling but still within the application's interaction flow with web services.
    • Example (Conceptual Groovy code for direct XML parsing):
      import javax.xml.parsers.SAXParserFactory
      
      def factory = SAXParserFactory.newInstance()
      factory.setFeature("http://xml.org/sax/features/external-general-entities", false)
      factory.setFeature("http://xml.org/sax/features/external-parameter-entities", false)
      factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false)
      def parser = factory.newSAXParser()
      // ... use parser for XML processing related to groovy-wslite ...
  4. Indirect Protection via Global XML Configuration: If your project has a global XML configuration mechanism (as described in "Currently Implemented" below), ensure this configuration, which disables external entities, is consistently applied to all XML parsing within the application, including any XML processing related to groovy-wslite usage.
  5. Testing: Test SOAP interactions and any custom XML processing logic to confirm that external entity resolution is disabled in the context of your groovy-wslite usage.

List of Threats Mitigated:

  • XML External Entity (XXE) Injection (in context of SOAP/XML processing related to groovy-wslite): Severity: High. XXE vulnerabilities arising from XML processing during SOAP interactions (even if indirectly through application-level XML handling around groovy-wslite usage) can be mitigated.

Impact:

  • XXE Injection: Significantly reduces the risk of XXE vulnerabilities that could be exploited through XML processing related to groovy-wslite interactions.

Currently Implemented:

  • The project globally disables external entity resolution for all XML parsing operations using a custom XML configuration utility class. This utility is designed to be used wherever XML parsing is performed within the application, providing indirect protection for XML processing related to groovy-wslite usage.

Missing Implementation:

  • No known missing implementations in terms of global XML configuration. However, it's crucial to maintain awareness and ensure that any new XML parsing code introduced in the project, especially if it's in the context of SOAP request/response handling or data manipulation around groovy-wslite, utilizes this secure XML configuration to prevent XXE vulnerabilities. Regular code reviews should verify this.

Description:

  1. Utilize groovy-wslite Parameterization Features: Employ groovy-wslite's built-in features for constructing SOAP requests using parameters or data maps. This is the primary way to safely incorporate dynamic data into SOAP requests when using this library. Consult the groovy-wslite documentation for specific methods of parameterization (e.g., using maps for request bodies in SOAPClient.send()).
  2. Avoid String Concatenation for Request Bodies: Refrain from constructing SOAP request XML bodies by directly concatenating strings, especially when including user-provided data. This practice is highly vulnerable to SOAP injection.
  3. XML Encode Parameter Values (if manual construction is unavoidable): In rare cases where you might need to manually construct parts of the XML request (ideally avoid this), always XML-encode any user-provided data before embedding it into the XML string. Use a reliable XML encoding function to escape characters like <, >, &, ', and ".
  4. Code Review for Request Construction: Conduct code reviews specifically focusing on how SOAP requests are built using groovy-wslite. Ensure that parameterized methods are used and that direct string concatenation of user input into XML is avoided.
  5. Testing for SOAP Injection: Perform security testing, including attempting SOAP injection attacks, to verify that your request construction methods using groovy-wslite are secure and prevent injection vulnerabilities.

List of Threats Mitigated:

  • SOAP Injection (via groovy-wslite request construction): Severity: High. Improperly constructed SOAP requests using groovy-wslite, especially when directly embedding user input, can lead to SOAP injection vulnerabilities.

Impact:

  • SOAP Injection: Significantly reduces the risk of SOAP injection by promoting secure request construction practices within groovy-wslite.

Currently Implemented:

  • For most SOAP operations, the project uses groovy-wslite's parameterized request construction. The SoapRequestService class is designed to build requests using maps for parameters, which is the recommended approach with groovy-wslite. XML encoding is also applied to parameter values within this service.

Missing Implementation:

  • Legacy SOAP endpoints in the LegacyAdminSoapClient class still utilize string templates for request construction with potentially incomplete manual escaping. These sections need to be refactored to fully leverage groovy-wslite's parameterized request features and the existing XML encoding utility to ensure consistent and robust protection against SOAP injection across all groovy-wslite interactions.