Tp-Link Archer AX53 v1.0 Openvpn configuration restore client_connect OS command injection vulnerability
The router's OpenVPN configuration restore feature passes user-supplied values such as client_connect straight into the OpenVPN server configuration, so a crafted backup file can make the device run arbitrary commands. An attacker who can upload such a file could start a remote login service and gain a shell beyond what the web interface allows.
Originally disclosed on Cisco Talos
An os command injection vulnerability exists in the Openvpn configuration restore clientconnect functionality of Tp-Link Archer AX53 v1.0 1.3.1 Build 20241120 rel.54901(5553). A specially crafted configuration value can lead to arbitrary command execution.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The init script copies configuration values such as client_connect into the OpenVPN server config without validating or escaping them, and OpenVPN then executes that value as a command.
Impact
An attacker with the ability to restore a configuration could run commands on the device and gain a remote shell with web GUI credentials, though the CVSS score notes high privileges are required.
What the attacker needed
Ability to upload a router configuration; high privileges on the device; attacker connects to the OpenVPN server
The fix
The vendor released a patch; the underlying fix is to validate or reject dangerous OpenVPN options such as client_connect when restoring a configuration.
How it was found
- Back up the router configuration from the web interface to get a binary file.
- Decrypt the file with the static AES key and IV, then unpack it as gzip and tar.
- Decrypt and unpack the user-config file to obtain a readable config.xml.
- Edit config.xml to add a client_connect value that starts a login service.
- Repack and re-encrypt the file, then restore it on the router.
- Connect to the OpenVPN server so the command runs, then log in to the new service.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A router lets you save its settings to a file and load them back later. This report shows that one of those settings is handed to a background program (OpenVPN) without being checked, and that program can be told to run a command. So someone who can load a tampered settings file can make the router run their own command, here starting a login service.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.