Skip to content
Heist/ feed
Back to feed
Medium

Security advisory

Type: advisorySources: OSVCVE: 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. 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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2021-21707
Confirmed fixed CVEs
Not specified
Updated in this feed
1 Nov 2026, 06:20 UTC · Revision 1

Source evidence

CVE-2021-21707

core-osv · Original source

Published 29 Nov 2021, 07:15 UTC

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.

osv:CVE-2021-21707
Complete source record
{
  "id": "9a82dcbb831ea56313c742171ec096e45eafabf9370266622106da9940b01ee0",
  "url": "https://osv.dev/vulnerability/CVE-2021-21707",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-21707",
    "summary": "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.",
    "evidence": "osv:CVE-2021-21707",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2021-21707",
      "aliases": [
        "BIT-libphp-2021-21707",
        "BIT-php-2021-21707",
        "BIT-php-min-2021-21707",
        "CVE-2021-21707"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/php/php-src",
              "type": "GIT",
              "events": [
                {
                  "introduced": "52ace952a1b65ca80fc2617f11c2fa6dd03f51bd"
                },
                {
                  "fixed": "c796a801599b13943c2413589e339c39d1d4bb47"
                },
                {
                  "introduced": "3c7824e16ec4c3cee417262445d2c2b66531c10f"
                },
                {
                  "fixed": "5f762668c9b57fa860ade2936796a24c258ca48e"
                },
                {
                  "introduced": "5dc92c2117cafc61daaaaa240fd46c3ac33872a4"
                },
                {
                  "fixed": "4850f51d29ae7ede1c528387b595f671bb81a79f"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:php:php:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "7.3.0"
                      },
                      {
                        "fixed": "7.3.33"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:php:php:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "7.4.0"
                      },
                      {
                        "fixed": "7.4.26"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:php:php:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "8.0.0"
                      },
                      {
                        "fixed": "8.0.13"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-21707.json"
          }
        }
      ],
      "modified": "2026-10-24T10:30:37.596799237Z",
      "provider": "osv",
      "references": [
        "https://security.netapp.com/advisory/ntap-20211223-0005/",
        "https://www.debian.org/security/2022/dsa-5082",
        "https://lists.debian.org/debian-lts-announce/2022/12/msg00030.html",
        "https://bugs.php.net/bug.php?id=79971",
        "https://www.tenable.com/security/tns-2022-09"
      ],
      "provider_metadata": {
        "unresolved_ranges": [
          {
            "cpes": [
              "cpe:2.3:a:tenable:tenable.sc:*:*:*:*:*:*:*:*"
            ],
            "vendor_product": "tenable:tenable.sc",
            "extracted_events": [
              {
                "range": [
                  {
                    "fixed": "5.21.0"
                  }
                ],
                "source": "CPE_RANGE"
              }
            ]
          },
          {
            "cpes": [
              "cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*",
              "cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*"
            ],
            "vendor_product": "debian:debian_linux",
            "extracted_events": [
              {
                "range": [
                  {
                    "introduced": "10.0"
                  },
                  {
                    "last_affected": "10.0"
                  },
                  {
                    "introduced": "11.0"
                  },
                  {
                    "last_affected": "11.0"
                  }
                ],
                "source": "CPE_STRING"
              }
            ]
          }
        ]
      }
    },
    "related_cves": [
      {
        "value": "CVE-2021-21707",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 434261,
  "published_at": "2021-11-29T07:15:06.397+00:00"
}