CVE-2021-21703
PHP vulnerability analysis and mitigation

Overview

CVE-2021-21703 affects PHP versions 7.3.x up to and including 7.3.31, 7.4.x below 7.4.25 and 8.0.x below 8.0.12. When running PHP-FPM SAPI with main FPM daemon process running as root and child worker processes running as lower-privileged users, it is possible for the child processes to access memory shared with the main process and write to it, modifying it in a way that would cause the root process to conduct invalid memory reads and writes. The vulnerability was discovered in May 2021 and publicly disclosed in October 2021 (PHP Bug).

Technical details

The vulnerability exists in PHP-FPM's scoreboard mechanism where each worker has an associated scoreboard structure containing PID, state and stats information stored in shared memory. The main process controls a scoreboard structure containing pointers to worker scoreboards, also located in shared memory. Since these pointers are in shared memory, they can be modified by worker processes to make the root process read/write at arbitrary locations. The vulnerability has a CVSS score of 7.0 (High) with vector CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H (NVD).

Impact

Successful exploitation of this vulnerability allows a low-privilege user (such as www-data) to escalate privileges to root by manipulating shared memory pointers used by the PHP-FPM master process. This affects most installations where PHP-FPM runs with its main process as root, which is the default configuration in many Linux distributions (PHP Bug).

Mitigation and workarounds

The vulnerability is fixed in PHP versions 7.4.25, 8.0.12 and later. Users should upgrade to these versions or later. The fix involves changing the scoreboard structure to eliminate access through pointers and modifying how the scoreboard is retrieved in the master process. For systems that cannot be immediately upgraded, restricting shell access and prohibiting program execution functions (exec, system, etc.) may help reduce the risk (PHP Bug, Debian Security).

Community reactions

The vulnerability was initially rated as medium severity by PHP maintainers but was later upgraded to high severity after security researchers emphasized its impact. Multiple Linux distributions issued security advisories and patches, including Debian (DSA-4992-1, DSA-4993-1), Fedora, and others. The security community noted this vulnerability's significance as it could turn many PHP-FPM remote code execution vulnerabilities into potential root compromises (PHP Bug).

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

GHSA-898v-775g-777cCRITICAL9.4
  • PHPPHP
  • neuron-core/neuron-ai
NoYesDec 09, 2025
GHSA-5j8p-438x-rgg5CRITICAL9.3
  • PHPPHP
  • onelogin/php-saml
NoYesDec 09, 2025
GHSA-j8g6-5gqc-mq36HIGH8.2
  • PHPPHP
  • neuron-core/neuron-ai
NoYesDec 09, 2025
GHSA-pvcv-q3q7-266gHIGH8.1
  • PHPPHP
  • filament/filament
NoYesDec 09, 2025
GHSA-6w82-v552-wjw2HIGH7.1
  • PHPPHP
  • shopware/shopware
NoYesDec 09, 2025

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