CVE-2016-5699: Input Validation

Published Nov 24, 2014
·
Updated

A vulnerability in Python's http, ftp and url libraries was reported, allowing to inject additional HTTP headers and more.

Upstream bug: https://bugs.python.org/issue22928

Upstream patches Python 3.4 / 3.5 : revision 94952 : https://hg.python.org/cpython/rev/bf3e1c9b80e9 Python 2.7 : revision 94951 : https://hg.python.org/cpython/rev/1c45047c5102

Additional note : When used in combination with flaw described in BZ 1347549, an attacker could direct an HTTP connection to a malicious server, using the following combined issues:

Python's httplib does not validate HTTP header values. A malicious 'Host' header with quoted new lines can inject additional headers and more glibc's getaddrinfo() ignores new lines and everything after a new line character when the first part looks like a IPv4 address

See the following blog post for additional information: http://blog.blindspotsecurity.com/2016/06/advisory-http-header-injection-in.html

Other sources

CRLF injection vulnerability in the HTTPConnection.putheader function in urllib2 and urllib in CPython (aka Python) before 2.7.10 and 3.x before 3.4.4 allows remote attackers to inject arbitrary HTTP headers via CRLF sequences in a URL.

It was found that the Python's httplib library (used by urllib, urllib2 and others) did not properly check HTTPConnection.putheader() function arguments. An attacker could use this flaw to inject additional headers in a Python application that allowed user provided header names or values.

Affected Software

40 affected componentsFixes available
redhat/python<0:2.6.6-66.el6_8
0:2.6.6-66.el6_8
redhat/python<0:2.7.5-38.el7_2
0:2.7.5-38.el7_2
redhat/python27-python<0:2.7.8-18.el6
0:2.7.8-18.el6
redhat/python33-python<0:3.3.2-18.el6
0:3.3.2-18.el6
redhat/rh-python34-python<0:3.4.2-14.el6
0:3.4.2-14.el6
redhat/rh-python35-python<0:3.5.1-9.el7
0:3.5.1-9.el7
redhat/python27-python<0:2.7.8-16.el7
0:2.7.8-16.el7
redhat/python33-python<0:3.3.2-16.el7
0:3.3.2-16.el7
redhat/rh-python34-python<0:3.4.2-13.el7
0:3.4.2-13.el7
Python Python<=2.7.9
Python Python=3.0
Python Python=3.0.1
Python Python=3.1.0
Python Python=3.1.1
Python Python=3.1.2
Python Python=3.1.3
Python Python=3.1.4
Python Python=3.1.5
Python Python=3.2.0
Python Python=3.2.1
Python Python=3.2.2
Python Python=3.2.3
Python Python=3.2.4
Python Python=3.2.5
Python Python=3.2.6
Python Python=3.3.0
Python Python=3.3.1
Python Python=3.3.2
Python Python=3.3.3
Python Python=3.3.4
Python Python=3.3.5
Python Python=3.3.6
Python Python=3.4.0
Python Python=3.4.1
Python Python=3.4.2
Python Python=3.4.3
debian/python2.7<2.7.10~rc1-1
2.7.10~rc1-1
debian/python2.7
2.7.3-6+deb7u32.7.9-2+deb8u12.7.10~rc1-1
debian/python3.4
3.4.2-1+deb8u23.4.4~rc1-1
debian/python3.5

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

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

    Fixed in 0:2.6.6-66.el6_8
  2. Upgrade

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

    Fixed in 0:2.7.5-38.el7_2
  3. Upgrade

    Upgrade redhat/python27-python to a version that resolves this vulnerability.

    Fixed in 0:2.7.8-18.el6
  4. Upgrade

    Upgrade redhat/python33-python to a version that resolves this vulnerability.

    Fixed in 0:3.3.2-18.el6
  5. Upgrade

    Upgrade redhat/rh-python34-python to a version that resolves this vulnerability.

    Fixed in 0:3.4.2-14.el6
  6. Upgrade

    Upgrade redhat/rh-python35-python to a version that resolves this vulnerability.

    Fixed in 0:3.5.1-9.el7
  7. Upgrade

    Upgrade redhat/python27-python to a version that resolves this vulnerability.

    Fixed in 0:2.7.8-16.el7
  8. Upgrade

    Upgrade redhat/python33-python to a version that resolves this vulnerability.

    Fixed in 0:3.3.2-16.el7
  9. Upgrade

    Upgrade redhat/rh-python34-python to a version that resolves this vulnerability.

    Fixed in 0:3.4.2-13.el7
  10. Upgrade

    Upgrade debian/python2.7 to a version that resolves this vulnerability.

    Fixed in 2.7.10~rc1-1
  11. Upgrade

    Upgrade debian/python2.7 to a version that resolves this vulnerability.

    Fixed in 2.7.3-6+deb7u3Fixed in 2.7.9-2+deb8u1Fixed in 2.7.10~rc1-1
  12. Upgrade

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

    Fixed in 3.4.2-1+deb8u2Fixed in 3.4.4~rc1-1
  13. Upgrade

    Upgrade Python 2.7 to a version that resolves this vulnerability.

    Fixed in 2.7.10Patch revision 94951
  14. Upgrade

    Upgrade Python 3.x to a version that resolves this vulnerability.

    Fixed in 3.4.4Patch revision 94952

Event History

Nov 24, 2014
CVE Published
12:00 AM
Data Sourced
12:00 AM
RemedyDescriptionSeverityWeaknessAffected Software
Sep 2, 2016
CVE Published
via MITRE·02:00 PM
Data Sourced
via MITRE·02:00 PM
Description
Data Sourced
via OSV·02:59 PM
DescriptionSeverity
Data Sourced
via NVD·02:59 PM
RemedyDescriptionSeverityWeaknessAffected Software
Sep 29, 2019
Data Sourced
via Red Hat·01:43 PM
DescriptionSeverityAffected Software
Oct 21, 2026
Data Sourced
via Microsoft·08:06 AM
DescriptionSeverityWeakness
Nov 24, 2026
Withdrawn
via OSV·04:29 AM
Data Sourced
via OSV·04:29 AM
Affected Software

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is the severity of CVE-2016-5699?

CVE-2016-5699 has a medium severity level, allowing for the injection of additional HTTP headers in affected Python libraries.

2

How do I fix CVE-2016-5699?

To fix CVE-2016-5699, upgrade your Python package to a version that includes the upstream patches addressing this vulnerability.

3

Which versions of Python are affected by CVE-2016-5699?

CVE-2016-5699 affects multiple versions of Python, including versions prior to 2.7.9 and specific releases up to 3.5.1.

4

What libraries in Python does CVE-2016-5699 impact?

CVE-2016-5699 specifically impacts the http, ftp, and url libraries within Python.

5

Is there a specific package recommended for CVE-2016-5699 remediation?

Yes, updating to the specific recommended packages such as python-2.7.9 or later, python27-python-2.7.8-16.el7, or rh-python34-python-3.4.2-14.el6 is needed for remediation.

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