CVE-2021-21707: In PHP versions 7.3.x below 7.3.33, 7.4.x below 7.4.26 and 8.0.x below 8.0.13, certain XML parsing functions, like simplexml_load_file(), URL-decode the filename passed to them.
Medium CVSS 5.3
- CVE id
- CVE-2021-21707
- Published
- Last modified
Affected packages
| Package | Affected versions | Fixed in |
|---|---|---|
| PHP Runtimes and servers |
>= 7.3.0, < 7.3.33 >= 7.4.0, < 7.4.26 >= 8.0.0, < 8.0.13 |
7.3.33, 7.4.26, 8.0.13 |
How to fix it
Upgrade PHP to the fixed release of the line you run: 7.3.33, 7.4.26, 8.0.13.
php --version
- Install the patched PHP release of your minor line (the php image tag or your OS packages) and restart PHP-FPM.
A free AIssue account reads the runtime versions your repositories pin (version files, Dockerfiles, build files) and tells you when one is affected.
Details
In PHP versions 7.3.x below 7.3.33, 7.4.x below 7.4.26 and 8.0.x below 8.0.13, certain XML parsing functions, like simplexmlloadfile(), URL-decode the filename passed to them. If that filename contains URL-encoded NUL character, this may cause the function to interpret this as the end of the filename, thus interpreting the filename differently from what the user intended, which may lead it to reading a different file than intended.
References
- CVE-2021-21707 on the NVD
- Advisory: https://nvd.nist.gov/vuln/detail/CVE-2021-21707
- Web: https://bugs.php.net/bug.php?id=79971
- Web: https://lists.debian.org/debian-lts-announce/2022/12/msg00030.html
- Web: https://security.netapp.com/advisory/ntap-20211223-0005/
- Web: https://www.debian.org/security/2022/dsa-5082
- Web: https://www.tenable.com/security/tns-2022-09
- Web: https://bugs.php.net/bug.php?id=79971
- Web: https://lists.debian.org/debian-lts-announce/2022/12/msg00030.html
- Web: https://security.netapp.com/advisory/ntap-20211223-0005/
- Web: https://www.debian.org/security/2022/dsa-5082
- Web: https://www.tenable.com/security/tns-2022-09
Am I affected?
Upload or paste your lockfile. We check every package version in it against OSV.dev, this advisory included, and email you the vulnerable ones with the version that fixes them. Free, and no account needed.
About this data
Source: National Vulnerability Database (NVD) (public domain). Severity comes from the advisory's own rating when it has one, else from its CVSS score.