Anker Eufy Homebase 2 home_security wifi_country_code_update command execution vulnerability
The wifi_country_code_update command in the home_security binary parses a JSON field and passes it unsanitised into a shell command, allowing an authenticated attacker to execute arbitrary commands as root. An attacker could use this to run any command on the device.
Originally disclosed on Cisco Talos
A command execution vulnerability exists in the wificountrycodeupdate functionality of the homesecurity binary of Anker Eufy Homebase 2 2.1.6.9h. A specially-crafted set of network packets 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 country_code value from the JSON body is formatted into a shell command string without any sanitisation, and then executed by a shell.
Impact
An authenticated attacker could execute arbitrary commands as root on the device, potentially compromising the whole home security system.
What the attacker needed
Authentication (can be bypassed via other bugs); network access to the device
The fix
The country_code value should be validated and sanitised before being used in a shell command, or the command should be executed without a shell.
How it was found
- Send a wifi_country_code_update packet with a JSON body containing a country_code field.
- The device parses the JSON and extracts the country_code value.
- The value is inserted into a shell command and executed, running the injected command.
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.
The device takes a value from a network message and puts it directly into a system command without checking it. This means an attacker who can send such a message can make the device run any command they want, with the highest privileges.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.