CVE-2023-40743: Improper Input Validation (CWE-20)
value: ** UNSUPPORTED WHEN ASSIGNED ** When integrating Apache Axis 1.x in an application, it may not have been obvious that looking up a service through "ServiceFactory.getService" allows potentially dangerous lookup mechanisms such as LDAP. When passing untrusted input to this API method, this could expose the application to DoS, SSRF and even attacks leading to RCE.

As Axis 1 has been EOL we recommend you migrate to a different SOAP engine, such as Apache Axis 2/Java. As a workaround, you may review your code to verify no untrusted or unsanitized input is passed to "ServiceFactory.getService", or by applying the patch from  https://github.com/apache/axis-axis1-java/commit/7e66753427466590d6def0125e448d2791723210 . The Apache Axis project does not expect to create an Axis 1.x release fixing this problem, though contributors that would like to work towards this are welcome.


CWE description: The product receives input or data, but it does
        not validate or incorrectly validates that the input has the
        properties that are required to process the data safely and
        correctly.
CVSS v3 base score: 9.8
Published: 2023-09-05T15:15Z
Repository: https://github.com/apache/axis-axis1-java
Language: Java
Files changed: axis-rt-core/src/main/java/org/apache/axis/client/ServiceFactory.java
Commit date: 2023-08-01 15:40:18 -0400
Commit message: Filter out unsupported protocols in the client class ServiceFactory

Diff: diff --git a/axis-rt-core/src/main/java/org/apache/axis/client/ServiceFactory.java b/axis-rt-core/src/main/java/org/apache/axis/client/ServiceFactory.java
index 33054a557..73e89ee1b 100644
--- a/axis-rt-core/src/main/java/org/apache/axis/client/ServiceFactory.java
+++ b/axis-rt-core/src/main/java/org/apache/axis/client/ServiceFactory.java
@@ -104,10 +104,14 @@ public class ServiceFactory extends javax.xml.rpc.ServiceFactory
         } catch (NamingException e) {
         }
         
         if (context != null) {
             String name = (String)environment.get("jndiName");
+
+	    if(name!=null && (name.toUpperCase().indexOf("LDAP")!=-1 || name.toUpperCase().indexOf("RMI")!=-1 || name.toUpperCase().indexOf("JMS")!=-1 || name.toUpperCase().indexOf("JMX")!=-1) || name.toUpperCase().indexOf("JRMP")!=-1 || name.toUpperCase().indexOf("JAVA")!=-1 || name.toUpperCase().indexOf("DNS")!=-1)  {
+	        return null;
+            }
             if (name == null) {
                 name = "axisServiceName";
             }
 
             // We've got JNDI, so try to find an AxisClient at the
@@ -118,10 +122,11 @@ public class ServiceFactory extends javax.xml.rpc.ServiceFactory
                 service = new Service(configProvider);
                 try {
                     context.bind(name, service);
                 } catch (NamingException e1) {
                     // !!! Couldn't do it, what should we do here?
+	            return null;
                 }
             }
         } else {
             service = new Service(configProvider);
         }

Fixed code: 
	    if(name!=null && (name.toUpperCase().indexOf("LDAP")!=-1 || name.toUpperCase().indexOf("RMI")!=-1 || name.toUpperCase().indexOf("JMS")!=-1 || name.toUpperCase().indexOf("JMX")!=-1) || name.toUpperCase().indexOf("JRMP")!=-1 || name.toUpperCase().indexOf("JAVA")!=-1 || name.toUpperCase().indexOf("DNS")!=-1)  {
	        return null;
            }
	            return null;