CVE-2020-7066: get_headers() silently truncates after a null byte

Published Mar 17, 2020
·
Updated

A vulnerability was found in PHP versions 7.2.x below 7.2.9, 7.3.x below 7.3.16 and 7.4.x below 7.4.34, while using getheaders() with user-supplied URL, if the URL contains zero (\0) character, the URL will be silently truncated at it. This may cause some software to make incorrect assumptions about the target of the getheaders() and possibly send some information to a wrong server.

Other sources

Fixed bug (getheaders() silently truncates after a null byte) (CVE-2020-7066) (cmb)

PHP

In PHP versions 7.2.x below 7.2.29, 7.3.x below 7.3.16 and 7.4.x below 7.4.4, while using getheaders() with user-supplied URL, if the URL contains zero (\0) character, the URL will be silently truncated at it. This may cause some software to make incorrect assumptions about the target of the getheaders() and possibly send some information to a wrong server.

Affected Software

15 affected componentsFixes available
redhat/rh-php73-php<0:7.3.20-1.el7
0:7.3.20-1.el7
redhat/php<7.2.29
7.2.29
redhat/php<7.3.16
7.3.16
redhat/php<7.4.4
7.4.4
PHP PHP<7.2.29
7.2.29
PHP PHP>=7.2.0<7.2.29
PHP PHP>=7.3.0<7.3.16
PHP PHP>=7.4.0<7.4.4
Tenable Tenable.Sc<5.19.0
Tenable Tenable.Sc=5.19.0
openSUSE Leap=15.1
Debian Debian Linux=8.0
Debian Debian Linux=9.0
Debian Debian Linux=10.0
debian/php7.4
7.4.33-1+deb11u57.4.33-1+deb11u11

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade redhat/rh-php73-php to a version that resolves this vulnerability.

    Fixed in 0:7.3.20-1.el7
  2. Upgrade

    Upgrade redhat/php to a version that resolves this vulnerability.

    Fixed in 7.2.29
  3. Upgrade

    Upgrade redhat/php to a version that resolves this vulnerability.

    Fixed in 7.3.16
  4. Upgrade

    Upgrade redhat/php to a version that resolves this vulnerability.

    Fixed in 7.4.4
  5. Upgrade

    Upgrade PHP to a version that resolves this vulnerability.

    Fixed in 7.2.29
  6. Upgrade

    Upgrade debian/php7.4 to a version that resolves this vulnerability.

    Fixed in 7.4.33-1+deb11u5Fixed in 7.4.33-1+deb11u11
  7. Upgrade

    Upgrade php to a version that resolves this vulnerability.

    Fixed in 7.2.29
  8. Upgrade

    Upgrade php to a version that resolves this vulnerability.

    Fixed in 7.3.16
  9. Upgrade

    Upgrade php to a version that resolves this vulnerability.

    Fixed in 7.4.4
  10. Upgrade

    Upgrade php to a version that resolves this vulnerability.

    Fixed in 7.2.9
  11. Upgrade

    Upgrade php to a version that resolves this vulnerability.

    Fixed in 7.4.34
  12. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Patch CVE-2020-7066

Event History

Mar 19, 2020
CVE Published
via PHP·12:00 AM
Apr 1, 2020
CVE Published
via MITRE·03:35 AM
Data Sourced
via MITRE·03:35 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·04:15 AM
RemedyDescriptionSeverityWeaknessAffected Software
Jan 11, 2024
Data Sourced
via Launchpad·11:52 PM
Description
Feb 24, 2026
Data Sourced
via Ubuntu·12:24 AM
RemedyDescriptionSeverityAffected Software
Jul 7, 2026
Data Sourced
via Debian·03:59 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is CVE-2020-7066?

CVE-2020-7066 is a vulnerability in PHP versions 7.2.x, 7.3.x, and 7.4.x that allows an attacker to truncate URLs containing null bytes when using the get_headers() function.

2

How severe is CVE-2020-7066?

CVE-2020-7066 has a severity rating of 4.3 (medium).

3

How does CVE-2020-7066 affect PHP versions?

CVE-2020-7066 affects PHP versions 7.2.x below 7.2.29, 7.3.x below 7.3.16, and 7.4.x below 7.4.4.

4

What is the impact of CVE-2020-7066?

The impact of CVE-2020-7066 is that certain software may make incorrect assumptions about the target of the get_headers() function when the URL is truncated.

5

How can I fix CVE-2020-7066?

To fix CVE-2020-7066, you should update PHP to version 7.2.29, 7.3.16, or 7.4.4 depending on the version you are currently using.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203