CVE-2019-18348: CRLF Injection

Published Jul 4, 2019
·
Updated

A CRLF injection flaw was discovered in python in the way URLs are handled when doing an HTTP/HTTPS connection (e.g. through urlopen() or HTTPConnection). An attacker who can control the url parameter passed to urlopen method in the urllib/urllib2 modules can inject CRLF sequences and HTTP headers by abusing the "host" part of the URL.

Other sources

An issue was discovered in urllib/urllib2 in Python. CRLF injection is possible if the attacker controls the host part of the url parameter passed to urlopen().

The fix for CVE-2019-9947 is ineffective if the glibc version used by python is still affected by CVE-2016-10739. The original fix for CVE-2019-9947 only checked the part of the URL after the port (e.g. in "http://server:7777/my/path?query" only "/my/path?query" was checked for invalid characters) so if an attacker can control the hostname part he is still able to inject HTTP headers. Due to CVE-2016-10739, getaddrinfo() resolves an invalid hostname as a valid one, so the URL can contain CLRF sequences and, at the same time, it can be resolved to a valid host.

Reference: https://bugs.python.org/issue30458#msg347282

Red Hat

An issue was discovered in urllib2 in Python 2.x through 2.7.17 and urllib in Python 3.x through 3.8.0. CRLF injection is possible if the attacker controls a url parameter, as demonstrated by the first argument to urllib.request.urlopen with \r\n (specifically in the host component of a URL) followed by an HTTP header. This is similar to the CVE-2019-9740 query string issue and the CVE-2019-9947 path string issue. (This is not exploitable when glibc has CVE-2016-10739 fixed.). This is fixed in: v2.7.18, v2.7.18rc1; v3.5.10, v3.5.10rc1; v3.6.11, v3.6.11rc1, v3.6.12; v3.7.8, v3.7.8rc1, v3.7.9; v3.8.3, v3.8.3rc1, v3.8.4, v3.8.4rc1, v3.8.5, v3.8.6, v3.8.6rc1.

Affected Software

18 affected componentsFixes available
redhat/rh-python36-python<0:3.6.12-1.el6
0:3.6.12-1.el6
redhat/rh-python36-python-pip<0:9.0.1-5.el6
0:9.0.1-5.el6
redhat/rh-python36-python-virtualenv<0:15.1.0-3.el6
0:15.1.0-3.el6
redhat/python27-python<0:2.7.18-2.el7
0:2.7.18-2.el7
redhat/python27-python-pip<0:8.1.2-6.el7
0:8.1.2-6.el7
redhat/python27-python-virtualenv<0:13.1.0-4.el7
0:13.1.0-4.el7
redhat/rh-python36-python<0:3.6.12-1.el7
0:3.6.12-1.el7
redhat/rh-python36-python-pip<0:9.0.1-5.el7
0:9.0.1-5.el7
redhat/rh-python36-python-virtualenv<0:15.1.0-3.el7
0:15.1.0-3.el7
debian/python2.7
2.7.18-8+deb11u1
Python Python>=2.0<=2.7.17
Python Python>=3.0<3.5.10
Python Python>=3.6.0<3.6.11
Python Python>=3.7.0<3.7.8
Python Python>=3.8.0<3.8.3
F5 BIG-IP>=17.5.0<=17.5.1, >=17.1.0<=17.1.2
17.5.1.1
F5 BIG-IP>=16.1.0<=16.1.6
F5 BIG-IP>=15.1.0<=15.1.10

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

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

    Fixed in 0:3.6.12-1.el6
  2. Upgrade

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

    Fixed in 0:9.0.1-5.el6
  3. Upgrade

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

    Fixed in 0:15.1.0-3.el6
  4. Upgrade

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

    Fixed in 0:2.7.18-2.el7
  5. Upgrade

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

    Fixed in 0:8.1.2-6.el7
  6. Upgrade

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

    Fixed in 0:13.1.0-4.el7
  7. Upgrade

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

    Fixed in 0:3.6.12-1.el7
  8. Upgrade

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

    Fixed in 0:9.0.1-5.el7
  9. Upgrade

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

    Fixed in 0:15.1.0-3.el7
  10. Upgrade

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

    Fixed in 2.7.18-8+deb11u1
  11. Upgrade

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

    Fixed in 17.5.1.1
  12. Upgrade

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

    Fixed in 2.7.18
  13. Upgrade

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

    Fixed in 2.7.18rc1
  14. Upgrade

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

    Fixed in 3.5.10
  15. Upgrade

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

    Fixed in 3.5.10rc1
  16. Upgrade

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

    Fixed in 3.6.11
  17. Upgrade

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

    Fixed in 3.6.11rc1
  18. Upgrade

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

    Fixed in 3.6.12
  19. Upgrade

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

    Fixed in 3.7.8
  20. Upgrade

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

    Fixed in 3.7.8rc1
  21. Upgrade

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

    Fixed in 3.7.9
  22. Upgrade

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

    Fixed in 3.8.3
  23. Upgrade

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

    Fixed in 3.8.3rc1
  24. Upgrade

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

    Fixed in 3.8.4
  25. Upgrade

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

    Fixed in 3.8.4rc1
  26. Upgrade

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

    Fixed in 3.8.5
  27. Upgrade

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

    Fixed in 3.8.6
  28. Upgrade

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

    Fixed in 3.8.6rc1
  29. Compensating control

    Ensure the glibc version used by Python is not affected by CVE-2016-10739; otherwise, the fix for CVE-2019-9947 is ineffective (CRLF injection can still be possible because getaddrinfo() resolves an invalid hostname as a valid one).

Event History

Jul 4, 2019
CVE Published
12:00 AM
Jul 5, 2019
Data Sourced
via Red Hat·10:22 AM
DescriptionSeverityAffected Software
Oct 23, 2019
CVE Published
via MITRE·04:31 PM
Data Sourced
via MITRE·04:31 PM
Description
Data Sourced
via NVD·05:15 PM
DescriptionSeverityWeaknessAffected Software
Aug 21, 2025
Advisory Published
via F5·04:05 PM
Data Sourced
via F5·04:05 PM
DescriptionSeverityWeaknessAffected Software
Feb 21, 2026
Data Sourced
via Ubuntu·12:19 AM
RemedyDescriptionSeverityAffected Software
Data Sourced
via Launchpad·12:19 AM
Description

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is CVE-2019-18348?

CVE-2019-18348 is a CRLF injection vulnerability in urllib2 in Python 2.x through 2.7.17 and urllib in Python 3.x through 3.8.0.

2

What is the severity of CVE-2019-18348?

The severity of CVE-2019-18348 is medium with a CVSS score of 6.5.

3

How can an attacker exploit CVE-2019-18348?

An attacker can exploit CVE-2019-18348 by controlling a URL parameter to perform CRLF injection.

4

Which versions of Python are affected by CVE-2019-18348?

Python 2.x through 2.7.17 and Python 3.x through 3.8.0 are affected by CVE-2019-18348.

5

Is there a fix for CVE-2019-18348?

Yes, the fix for CVE-2019-18348 is available in the respective Python versions: 2.7.18 and 3.8.1.

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