Getting root on a Zyxel VMG8825-T50 router
The router's configuration backup file contains encrypted fields, and a DDNS password field acts as an encryption/decryption oracle. By manipulating the backup file, an attacker with admin access can enable hidden services, bypass privilege checks, and recover the root password.
th0mas.nl
Published on th0mas.nl
hack embedded router
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 write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the encryption scheme uses a static key and lacks context, so any encrypted field can be decrypted by swapping it into a user-editable field.
Impact
An attacker with admin access to the web interface could gain root access to the router, but the author states there is no risk of abuse by an external attacker as long as the admin password is secure.
What the attacker needed
Access to the router's web interface; valid admin credentials
The fix
The vulnerabilities were patched by Zyxel, as mentioned in an update.
How it was found
- Download the configuration backup file from the web interface.
- Modify the backup to enable SSH and other services by setting their Mode and BoundInterfaceList fields.
- Restore the modified backup to activate the services.
- Use the DDNS password field as a decryption oracle to read encrypted values.
- Set the SPTrustDomain to the local subnet to bypass privilege checks.
- Log in via SSH or telnet and use the DLNA symlink trick to read /data/zcfg_config.json, then decrypt the root default password.
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 write-up has not been written yet. The Original tab links to the source.
The router stores its settings in a backup file that includes some encrypted values. One of those values, the password for a dynamic DNS service, can be changed through the web interface and then read back after restoring a backup, letting you encrypt or decrypt any text. Using this, you can unlock hidden features and eventually find the root password.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.