CVE-2021-21703
PHP-FPM memory access in root process leading to privilege escalation
Check your servers for CVE-2021-21703
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2021-21703 affects php, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
In 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, which can be used to escalate privileges from local unprivileged user to the root user.
Severity (CVSS)
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H
- Attack vector
- local: the attacker needs local access, or a user has to open a prepared file
- Attack complexity
- high: an attack depends on conditions outside the control of the attacker, such as a race
- Privileges required
- low: the attacker needs an ordinary user account
- User interaction
- none: nobody has to click or open anything
- Scope
- changed: the damage reaches other components, such as the host of a container or other users
- Impact
- confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 1.43%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 73.7% of all scored CVEs. Scores of 1 Dec 2026.
Weakness
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| PHP |
affected from 7.3.x up to and including 7.3.31 affected from 7.4.x, before 7.4.25 affected from 8.0.X, before 8.0.12
|
Is my server affected?
Find the installed version of php and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.
Debian, Ubuntu
dpkg -l | grep -i php
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2021-21703 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2021-21703RHEL, Rocky, Alma, Fedora
rpm -q php
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2021-21703Alpine
apk list --installed | grep -i phpWith Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2021-21703
trivy image --scanners vuln IMAGE | grep CVE-2021-21703
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Advisories
- DSA-4992 debian.org · vendor advisory
- DSA-4993 debian.org · vendor advisory
- FEDORA-2021-9f68f5f752 lists.fedoraproject.org · vendor advisory
- FEDORA-2021-4140b54de2 lists.fedoraproject.org · vendor advisory
- FEDORA-2021-02d218c3be lists.fedoraproject.org · vendor advisory
- https://security.netapp.com/advisory/ntap-20211118-0003/ security.netapp.com
- GLSA-202209-20 security.gentoo.org · vendor advisory
Other references
- https://bugs.php.net/bug.php?id=81026 bugs.php.net
- [oss-security] 20211026 CVE-2021-21703: PHP-FPM 5.3.7 <= 8.0.12 Local Root openwall.com · mailing list
- [debian-lts-announce] 20211027 [SECURITY] [DLA 2794-1] php7.0 security update lists.debian.org · mailing list
- https://www.oracle.com/security-alerts/cpujan2022.html oracle.com
- https://www.oracle.com/security-alerts/cpuapr2022.html oracle.com
Source: the record CVE-2021-21703 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse