Security
Headlines
HeadlinesLatestCVEs

Headline

CVE-2023-30260: Security advisory

Command injection vulnerability in RaspAP raspap-webgui 2.8.8 and earlier allows remote attackers to run arbitrary commands via crafted POST request to hostapd settings form.

CVE
#vulnerability#web#php#auth

…/ advisories/

Multiple command injection vulnerabilities are present in the RaspAP web interface. They allow an authenticated user to execute arbitrary OS commands with the privileges of the web server. Additional factors in the default configuration allow elevation to root privileges.

Affected products

RaspAP v2.8.9 and older

Steps to reproduce

  1. Obtain credentials for RaspAP

  2. Configure and execute the following script

  3. Observe that the file /tmp/hax has been created on the raspi, and contains the output of uptime.

Cause

There are two almost identical instances of the vulnerability, at hostapd.php:103 and hostapd.php:108. In both instances, an unsanitized POST variable is fed into a command executed using exec().

A third instance exists at configure_client.php:20, exploitable in a similar manner.

Impact

An authenticated user is able to execute arbitrary commands as www-data.

In the default RaspAP configuration, this can be leveraged to gain root access by exploiting two of the configured sudo permissions; overwrite the openvpn client configuration to set the following:

script-security 2
up /tmp/payload.sh

and establish an OpenVPN connection. /tmp/payload.sh will be executed with root privileges.

Proposed Mitigation

Apply sanitization to the txpower and interface parameters, and use the PHP built-in escapeshellarg() before passing them to exec().

History

  • 2023-03-30: Additional fix submitted
  • 2023-03-30: Report merged for all three vulnerabilities
  • 2023-03-29: Additional vulnerability reported (configure_client.php)
  • 2023-03-29: Initial report removed
  • 2023-03-29: Fix applied and released as v2.8.9
  • 2023-03-28: Initial report filed (hostapd.php)

Related news

GHSA-hhqm-f4m4-pq39: RaspAP raspap-webgui Command Injection vulnerability

Command injection vulnerability in RaspAP raspap-webgui 2.8.8 and earlier allows remote attackers to run arbitrary commands via crafted POST request to hostapd settings form.

CVE: Latest News

CVE-2023-50976: Transactions API Authorization by oleiman · Pull Request #14969 · redpanda-data/redpanda
CVE-2023-6905
CVE-2023-6903
CVE-2023-6904
CVE-2023-3907