CVE-2022-39987
PHP vulnerability analysis and mitigation

Overview

A Command injection vulnerability exists in RaspAP versions 2.8.0 through 2.9.2. The vulnerability allows an authenticated attacker to execute arbitrary OS commands as root via the "entity" POST parameters in /ajax/networking/get_wgkey.php (Medium Blog, NVD).

Technical details

The vulnerability exists due to insufficient sanitization of the "entity" POST parameter in the /ajax/networking/get_wgkey.php file. When generating Private/Public key pairs, the application takes the "entity" parameter from POST without proper sanitization. The parameter is passed as a path which gets executed with exec('sudo path'), therefore any injected command gets executed with root privileges (Medium Blog). The vulnerability has been assigned a CVSS v3.1 Base Score of 8.8 HIGH with vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H (NVD).

Impact

Successful exploitation of this vulnerability allows authenticated attackers to execute arbitrary operating system commands with root privileges. This could lead to complete system compromise, including the ability to read, write, or delete any files, install malware, or perform any other actions available to the root user (NVD).

Mitigation and workarounds

The recommended mitigation is to use PHP's built-in escapeshellarg() function to properly sanitize the "entity" parameter before it is used in command execution (Medium Blog).

Additional resources


SourceThis report was generated using AI

Related PHP vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-23622HIGH8.7
  • PHPPHP
  • alextselegidis/easyappointments
NoNoJan 15, 2026
CVE-2026-23493HIGH8.6
  • PHPPHP
  • pimcore/pimcore
NoYesJan 15, 2026
CVE-2026-23496MEDIUM5.4
  • PHPPHP
  • pimcore/web2print-tools-bundle
NoYesJan 15, 2026
CVE-2026-23495MEDIUM4.3
  • PHPPHP
  • pimcore/admin-ui-classic-bundle
NoYesJan 15, 2026
CVE-2026-23494MEDIUM4.3
  • PHPPHP
  • pimcore/pimcore
NoYesJan 15, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management