Skip to content

Commit 643b9c7

Browse files
committed
Improved: Comment out the SOAP and HTTP engines (OFBIZ-12212)
The SOAP and HTTP engines are open doors to security issues. At https://markmail.org/message/pgtjyh23bazq4s2w I proposed to comment them out as we did for RMI in the past. Of cause it must be clearly documented how to use them if needed. Here is the email content: After the recent fix for the CVE-2021-26295[1] we discussed with the security team about the opportunity need to comment out the SOAP and HTTP engines like we did in the past for RMI[2], this obviously for security reason. [1] OFBIZ-12167 "Adds a blacklist (to be renamed soon to denylist) in Java serialisation (CVE-2021-26295)" [2] OFBIZ-6942 "Comment out RMI related code because of the Java deserialization issue [CVE-2016-2170] " I just put a small comment in webtools controller, it should be enough. The tests pass
1 parent 76d6382 commit 643b9c7

File tree

5 files changed

+30
-29
lines changed

5 files changed

+30
-29
lines changed

framework/common/servicedef/services_test.xml

+19-19
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ under the License.
7171

7272
<service name="groupTest" engine="group" location="testGroup" invoke=""/>
7373

74-
<service name="testHttp" engine="http" location="main-http" invoke="testScv">
74+
<!-- <service name="testHttp" engine="http" location="main-http" invoke="testScv">
7575
<description>HTTP service wrapper around the test service</description>
7676
<attribute name="message" type="String" mode="IN" optional="true"/>
7777
<attribute name="resp" type="String" mode="OUT"/>
78-
</service>
78+
</service> -->
7979

80-
<service name="testSoap" engine="soap" export="true" location="main-soap" invoke="testSOAPScv">
80+
<!-- <service name="testSoap" engine="soap" export="true" location="main-soap" invoke="testSOAPScv">
8181
<description>SOAP service; calls the OFBiz test SOAP service</description>
8282
<implements service="testSOAPScv"/>
8383
</service>
@@ -87,25 +87,25 @@ under the License.
8787
<implements service="testScv"/>
8888
</service>
8989
90-
<!-- test service for local loopback testing (OFBiz Client SOAP -> OFBiz Server SOAP)
91-
https://ofbiz-vm2.apache.org:8443/webtools/control/SOAPService is the ultimate location for the testRemoteSoap
90+
test service for local loopback testing (OFBiz Client SOAP -> OFBiz Server SOAP)
91+
https://ofbiz-vm2.apache.org:8443/webtools/control/SOAPService is the ultimate location for the testRemoteSoap
9292
It's redirected from https://demo-trunk.ofbiz.apache.org/webtools/control/SOAPService by the HTTPD frontend installed by Puppet in the demo server, ie ofbiz-vm2.apache.org
9393
We could use also http://demo-trunk.ofbiz.apache.org/webtools/control/SOAPService but HSTS would sent it to https anyway
94-
So this can be used only against trunk demo and is not in the tests set to avoid a dependency on Internet -->
95-
<service name="testRemoteSoap" engine="soap" export="true"
94+
So this can be used only against trunk demo and is not in the tests set to avoid a dependency on Internet
95+
<service name="testRemoteSoap" engine="soap" export="true"
9696
location="https://demo-trunk.ofbiz.apache.org/webtools/control/SOAPService"
9797
invoke="testSoapSimple">
9898
<attribute name="defaultValue" type="Double" mode="IN" default-value="999.9999"/>
9999
<attribute name="message" type="String" mode="IN" optional="true"/>
100100
<attribute name="resp" type="String" mode="OUT"/>
101101
</service>
102102
103-
<!-- FIXME For now, not sure why, the 4 remote SOAP services below don't work -->
103+
FIXME For now, not sure why, the 4 remote SOAP services below don't work
104104
105-
<!-- the location = endpoint = SOAP action -->
106-
<!-- invoke parameter is the name of the operation to invoke, for example LatLonListZipCode -->
107-
<!-- invoke parameter is needed when there are several possible operations for the SOAP action -->
108-
<!-- FIXME For now, not sure why, this remote SOAP service does not work -->
105+
the location = endpoint = SOAP action
106+
invoke parameter is the name of the operation to invoke, for example LatLonListZipCode
107+
invoke parameter is needed when there are several possible operations for the SOAP action
108+
FIXME For now, not sure why, this remote SOAP service does not work
109109
<service name="testRemoteSoap1" engine="soap" export="true"
110110
location="http://www.weather.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php"
111111
invoke="LatLonListZipCode">
@@ -118,10 +118,10 @@ under the License.
118118
<attribute name="result" type="String" mode="OUT"/>
119119
</service>
120120
121-
<!-- the location = endpoint = SOAP action -->
122-
<!-- invoke parameter is the name of the operation to invoke, for example LatLonListCityNames -->
123-
<!-- invoke parameter is needed when there are several possible operations for the SOAP action -->
124-
<!-- FIXME For now, not sure why, this remote SOAP service does not work -->
121+
the location = endpoint = SOAP action
122+
invoke parameter is the name of the operation to invoke, for example LatLonListCityNames
123+
invoke parameter is needed when there are several possible operations for the SOAP action
124+
FIXME For now, not sure why, this remote SOAP service does not work
125125
<service name="testRemoteSoap2" engine="soap" export="true"
126126
location="http://www.weather.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php"
127127
invoke="LatLonListCityNames">
@@ -134,7 +134,7 @@ under the License.
134134
<attribute name="result" type="String" mode="OUT"/>
135135
</service>
136136
137-
<!-- FIXME For now, not sure why, this remote SOAP service does not work -->
137+
FIXME For now, not sure why, this remote SOAP service does not work
138138
<service name="testRemoteSoap3" engine="soap" export="true"
139139
location="http://www.restfulwebservices.net/wcf/EmailValidationService.svc"
140140
invoke="EmailValidationService">
@@ -143,13 +143,13 @@ under the License.
143143
<attribute name="result" type="String" mode="OUT"/>
144144
</service>
145145
146-
<!-- FIXME For now, not sure why, this remote SOAP service does not work -->
146+
FIXME For now, not sure why, this remote SOAP service does not work
147147
<service name="testRemoteSoap4" engine="soap" export="true"
148148
location="http://www.webservicex.net/geoipservice.asmx"
149149
invoke="GetGeoIPContext">
150150
<attribute name="invoke" type="String" mode="IN" />
151151
<attribute name="result" type="String" mode="OUT"/>
152-
</service>
152+
</service> -->
153153

154154
<service name="testGroovy" engine="groovy" location="component://common/groovyScripts/GroovyServiceTest.groovy" invoke="">
155155
<description>Test Groovy Script Service</description>

framework/common/webcommon/WEB-INF/handlers-controller.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ under the License.
2424

2525
<!-- event handlers -->
2626
<handler name="java" type="request" class="org.apache.ofbiz.webapp.event.JavaEventHandler"/>
27-
<handler name="soap" type="request" class="org.apache.ofbiz.webapp.event.SOAPEventHandler"/>
27+
<!-- <handler name="soap" type="request" class="org.apache.ofbiz.webapp.event.SOAPEventHandler"/> -->
2828
<handler name="xmlrpc" type="request" class="org.apache.ofbiz.webapp.event.XmlRpcEventHandler"/>
2929
<handler name="service" type="request" class="org.apache.ofbiz.webapp.event.ServiceEventHandler"/>
3030
<handler name="service-multi" type="request" class="org.apache.ofbiz.webapp.event.ServiceMultiEventHandler"/>

framework/service/config/serviceengine.xml

+6-6
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ under the License.
5252
<engine name="javascript" class="org.apache.ofbiz.service.engine.ScriptEngine"/>
5353
<!-- -->
5454
<engine name="route" class="org.apache.ofbiz.service.engine.RouteEngine"/>
55-
<engine name="http" class="org.apache.ofbiz.service.engine.HttpEngine"/>
55+
<!-- <engine name="http" class="org.apache.ofbiz.service.engine.HttpEngine"/> -->
5656
<engine name="jms" class="org.apache.ofbiz.service.jms.JmsServiceEngine"/>
5757
<engine name="rmi" class="org.apache.ofbiz.service.rmi.RmiServiceEngine"/>
58-
<engine name="soap" class="org.apache.ofbiz.service.engine.SOAPClientEngine"/>
58+
<!-- <engine name="soap" class="org.apache.ofbiz.service.engine.SOAPClientEngine"/> -->
5959
<!-- The engine xml-rpc-local is only used by a test service and for this reason it is configured to run on port 8080.
6060
In order to use this in OFBiz change the port accordingly (for demo the default value is 8080)
6161
-->
@@ -66,14 +66,14 @@ under the License.
6666
</engine>
6767

6868
<service-location name="main-rmi" location="rmi://localhost:1099/RMIDispatcher"/>
69-
<service-location name="main-http" location="http://localhost:8080/webtools/control/httpService"/>
70-
<service-location name="main-soap" location="http://localhost:8080/webtools/control/SOAPService"/>
69+
<!-- <service-location name="main-http" location="http://localhost:8080/webtools/control/httpService"/>
70+
<service-location name="main-soap" location="http://localhost:8080/webtools/control/SOAPService"/> -->
7171

7272
<service-location name="entity-sync-rmi" location="rmi://localhost:1099/RMIDispatcher"/>
73-
<service-location name="entity-sync-http" location="https://localhost:8443/webtools/control/httpService"/>
73+
<!-- <service-location name="entity-sync-http" location="https://localhost:8443/webtools/control/httpService"/> -->
7474

7575
<service-location name="rita-rmi" location="rmi://localhost:1099/RMIDispatcher"/>
76-
<service-location name="eedcc-test" location="https://localhost:8443/webtools/control/httpService"/>
76+
<!-- <service-location name="eedcc-test" location="https://localhost:8443/webtools/control/httpService"/> -->
7777

7878
<!-- default notification group for all services loaded with 'main' loader
7979
- uncomment this to enable error notification for all services

framework/service/testdef/servicetests.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ under the License.
2222
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2323
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/test-suite.xsd">
2424
<test-case case-name="service-tests"><junit-test-suite class-name="org.apache.ofbiz.service.test.ServiceEngineTests"/></test-case>
25-
<test-case case-name="service-soap-tests"><junit-test-suite class-name="org.apache.ofbiz.service.test.ServiceSOAPTests"/></test-case>
25+
<!-- <test-case case-name="service-soap-tests"><junit-test-suite class-name="org.apache.ofbiz.service.test.ServiceSOAPTests"/></test-case> -->
2626
<test-case case-name="service-entity-auto-tests"><junit-test-suite class-name="org.apache.ofbiz.service.test.ServiceEntityAutoTests"/></test-case>
2727

2828
<test-case case-name="load-service-test-data">

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ under the License.
8686
</request-map>
8787

8888
<!-- Begin Utility Requests -->
89-
<request-map uri="httpService">
89+
<!-- The 2 services below have been commented out for security reason, see OFBIZ-12212 -->
90+
<!-- <request-map uri="httpService">
9091
<event type="java" path="org.apache.ofbiz.service.engine.HttpEngine" invoke="httpEngine"/>
9192
<response name="success" type="none"/>
9293
<response name="error" type="none"/>
@@ -96,7 +97,7 @@ under the License.
9697
<event type="soap"/>
9798
<response name="error" type="none"/>
9899
<response name="success" type="none"/>
99-
</request-map>
100+
</request-map> -->
100101
<request-map uri="xmlrpc" track-serverhit="false" track-visit="false">
101102
<security auth="true"/>
102103
<event type="xmlrpc"/>

0 commit comments

Comments
 (0)