PythonApplication

CVE-2019-18348

MEDIUM · 6.1 CVSS v3.1 Published 2019-10-23
Fix available
A fix is available. Upgrade to 3.5.10 / 3.6.11 or later.
See remediation →
68/100
Remediation priority · Elevated
Remotely reachable No privileges

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
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.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

CRLF injection vulnerability in Python's urllib/urllib2 allows attackers controlling URL parameters to inject arbitrary HTTP headers via \r\n sequences in the host component of a URL. This is similar to prior query string and path string CRLF injection CVEs (CVE-2019-9740, CVE-2019-9947). Not exploitable on systems where glibc has CVE-2016-10739 fixed.

MitigationUpgrade Python to a patched version (2.7.18+, 3.5.10+, 3.6.11+, 3.7.8+, or 3.8.3+). Validate and sanitize any user-controlled URL parameters before passing to urllib functions as an additional defense-in-depth measure.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
PythonApplication
Affected:>= 2.0, <= 2.7.17>= 3.0, < 3.5.10>= 3.6.0, < 3.6.11>= 3.7.0, < 3.7.8>= 3.8.0, < 3.8.3

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify Python version in use
    Run 'python --version' or 'python3 --version' to determine the installed Python interpreter version
    Affected if The version falls within these vulnerable ranges: 2.0 to 2.7.17, 3.0 to 3.5.9, 3.6.0 to 3.6.10, 3.7.0 to 3.7.7, or 3.8.0 to 3.8.2
  2. Locate the Python interpreter being used by your application
    Check which Python binary executes your application by running 'which python' or 'which python3', then check that specific binary's version
    Affected if The identified interpreter version is in the vulnerable ranges listed above
  3. Determine if urllib or urllib2 processes untrusted URL input
    Review application source code to see if urllib.request.urlopen, urllib2.urlopen, or related functions receive URLs that include user-supplied hostname or port components
    Affected if The application passes URLs with user-controlled host/port components to urllib functions without validation
  4. Check if glibc is patched against CVE-2016-10739
    Run 'ldd --version' to check glibc version; CVE-2016-10739 was fixed in glibc 2.25 or later
    Affected if glibc version is below 2.25, meaning the CVE-2016-10739 mitigation is absent and the CRLF injection remains exploitable

You are affected if your Python version is in the vulnerable ranges AND your application uses urllib/urllib2 with user-controlled URL host components AND your system's glibc lacks the CVE-2016-10739 fix.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

From vendor data
Upgrade available Upgrade to 3.5.10 / 3.6.11 / 3.7.8 or later
Fixed in 3.5.103.6.113.7.8
Interim mitigation

Upgrade Python to a patched version (2.7.18+, 3.5.10+, 3.6.11+, 3.7.8+, or 3.8.3+). Validate and sanitize any user-controlled URL parameters before passing to urllib functions as an additional defense-in-depth measure.

Fix this in Python Scoped from the published advisory
  • Consultation1.0 h
  • Implementation2.0 h
  • Testing2.0 h
  • Review / QA1.0 h
6.0 hours of engineering $1,040
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $1,664.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2019-18348 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2019-18348 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data