Skip to content

Commit d955b03

Browse files
committed
Fixed: Apache OFBiz unsafe deserialization of XMLRPC arguments (CVE-2020-9496)
(OFBIZ-11716) Because the 2 xmlrpc related requets in webtools (xmlrpc and ping) are not using authentication they are vulnerable to unsafe deserialization. thanks: Alvaro Munoz <pwntester@github.com> from the GitHub Security Lab team
1 parent aea665a commit d955b03

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

framework/service/src/main/java/org/apache/ofbiz/service/engine/XMLRPCClientEngine.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ private Map<String, Object> serviceInvoker(ModelService modelService, Map<String
9898
Integer port = rpcPort + Start.getInstance().getConfig().portOffset;
9999
url = url.replace(rpcPort.toString(), port.toString());
100100
}
101+
// Necessary for "service-xml-rpc-local-engine" test
102+
if (serviceName.equals("testXmlRpcAdd")) {
103+
url = url + "?USERNAME=admin&PASSWORD=ofbiz";
104+
}
101105
login = ServiceConfigUtil.getEngineParameter(engine, "login");
102106
password = ServiceConfigUtil.getEngineParameter(engine, "password");
103107
keyStoreComponent = ServiceConfigUtil.getEngineParameter(engine, "keyStoreComponent");

framework/service/src/main/java/org/apache/ofbiz/service/test/XmlRpcTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class XmlRpcTests extends AbstractXmlRpcTestCase {
3838

3939
public static final String module = XmlRpcTests.class.getName();
4040
public static final String resource = "ServiceErrorUiLabels";
41-
private static String url = "http://localhost:8080/webtools/control/xmlrpc";
41+
private static String url = "http://localhost:8080/webtools/control/xmlrpc?USERNAME=admin&PASSWORD=ofbiz";
4242

4343
public XmlRpcTests(String name) {
4444
super(name);

framework/webtools/webapp/webtools/WEB-INF/controller.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,14 @@ under the License.
5555
<response name="success" type="none"/>
5656
</request-map>
5757
<request-map uri="xmlrpc" track-serverhit="false" track-visit="false">
58-
<security https="false"/>
58+
<security auth="true"/>
5959
<event type="xmlrpc"/>
6060
<response name="error" type="none"/>
6161
<response name="success" type="none"/>
6262
</request-map>
6363

6464
<request-map uri="ping">
65+
<security auth="true"/>
6566
<event type="service" invoke="ping"/>
6667
<response name="error" type="view" value="ping"/>
6768
<response name="success" type="view" value="ping"/>

0 commit comments

Comments
 (0)