OS Command Injection in cPH2 Charging Station <2.0.0 (CVE-2023-46359 and CVE-2023-46360)
A hidden PHP endpoint on the charging station's web interface passed an IP address parameter into a shell command, allowing an attacker to run arbitrary operating system commands. The web service user also had passwordless sudo rights, so an attacker who reached that context could escalate privileges on the device.
Published on offensity.com
During a web application penetration test for one of our clients we identified an OS Command Injection in the cPH2 charging station produced by eCharge Hardy Barth GmbH.
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 endpoint built a shell command from unsanitised user input instead of validating the IP address or calling the ping tool safely.
Impact
An attacker could execute commands on the charging station as the web user and, because that user had passwordless sudo, could escalate to full control of the device.
What the attacker needed
Network access to the web interface; admin or config page reachable
The fix
The vendor released version 2.0.0 and affected customers were advised to update.
How it was found
- Inspect the page source of the configuration page to find the hidden connection check endpoint.
- Send an IP value with an appended command and observe the success response.
- Use an out-of-band request to a controlled domain to confirm command execution.
- Send a reverse shell payload to obtain a shell as the web user.
- Note that the web user can run sudo commands without a 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 charging station's web page had a hidden feature that checked whether an IP address was reachable, probably by running a ping command. It put the user's input straight into that command, so extra shell instructions typed into the field were also run. The web server account also had extra powers, letting an attacker take fuller control of the device.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.