Grandstream GXP2135 CWMP SelfDefinedTimeZone OS command injection vulnerability
The CWMP SelfDefinedTimeZone parameter on Grandstream GXP2135 phones is not filtered before being used to build a shell command, allowing an attacker who controls the Auto Configuration Server to execute arbitrary commands as root. This could lead to full compromise of the device.
Originally disclosed on Cisco Talos
An os command injection vulnerability exists in the CWMP SelfDefinedTimeZone functionality of Grandstream GXP2135 1.0.9.129, 1.0.11.74 and 1.0.11.79. A specially crafted network packet 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 timezone value from the CWMP set request is passed unsanitised into a shell command executed by system(), allowing command injection.
Impact
An attacker could execute arbitrary commands with root privileges on the device, leading to full compromise.
What the attacker needed
Control over the CWMP Auto Configuration Server; ability to send crafted CWMP set requests
The fix
The vendor released a patch; the timezone value should be validated and sanitised before being used in a shell command.
How it was found
- Control the Auto Configuration Server (ACS) for CWMP, either by authenticating to the web server or via man-in-the-middle methods such as DNS poisoning or DHCP.
- Send a CWMP set request for the Device.Time.X_GRANDSTREAM_SelfDefinedTimeZone parameter containing a crafted value that escapes the echo command.
- The crafted value is used in a system() call, executing arbitrary commands with root privileges.
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.
This phone has a remote management feature that lets a server send it settings. One setting, the timezone, is inserted directly into a system command without checking. If an attacker can control that server, they can sneak in extra commands that run with the highest privileges on the phone.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.