HTTP Header Injection Affecting urllib3 package, versions [,1.25.9)


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.65% (81st percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PYTHON-URLLIB3-1014645
  • published1 Oct 2020
  • disclosed1 Oct 2020
  • creditmaxpl0it

Introduced: 1 Oct 2020

CVE-2020-26137  (opens in a new tab)
CWE-644  (opens in a new tab)

How to fix?

Upgrade urllib3 to version 1.25.9 or higher.

Overview

urllib3 is a HTTP library with thread-safe connection pooling, file post, and more.

Affected versions of this package are vulnerable to HTTP Header Injection. The 'method' parameter is not filtered to prevent the injection from altering the entire request.

For example:

>>> conn = http.client.HTTPConnection("localhost", 80)
>>> conn.request(method="GET / HTTP/1.1\r\nHost: abc\r\nRemainder:", url="/index.html")

This will result in the following request being generated:

GET / HTTP/1.1
Host: abc
Remainder: /index.html HTTP/1.1
Host: localhost
Accept-Encoding: identity

CVSS Scores

version 3.1