CRLF Injection Vulnerability in Python 2 Package: python2

python2 Updated 02 Oct 2025

Summary

23/10/2019
N/A
Yes i
Medium
6.1

ALPINE-CVE-2019-18348: An issue was discovered in urllib2 in Python 2.x through 2.7.17 and urllib in Python 3.x through 3.8.0. Affects python2 versions < 2.7.18-r0. Fixed in 2.7.18-r0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

The python2 package is a widely used implementation of the Python programming language, specifically version 2.x. It provides a robust environment for developing applications and scripts. However, it is known to have vulnerabilities that can be exploited if not properly managed. This specific vulnerability allows for CRLF (Carriage Return Line Feed) injection, which can lead to severe security issues if an attacker manipulates URL parameters.

Vulnerability Detail

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 vulnerability is similar to other known issues and is not exploitable when glibc has CVE-2016-10739 fixed. The CVSS score for this vulnerability is 6.1, indicating a moderate severity level.

How To Fix

Minimum fixed version

2.7.18-r0

This is the first release that contains the fix.

sudo apk add --upgrade python2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, avoid using user-controlled input in URL parameters where possible. Implement input validation to sanitize any URL parameters before processing them.

Conclusion

The CRLF injection vulnerability in the python2 package poses a significant risk if not addressed. It is crucial for users to update to the patched version to mitigate potential security threats. Regular monitoring and vulnerability management practices, such as those offered by Vulert, can help maintain the security of your applications.

See every vulnerability recorded for python2 →

Share this vulnerability

FAQ

CRLF injection is a type of attack where an attacker can inject Carriage Return and Line Feed characters into a URL, potentially leading to HTTP response splitting and other security issues.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

Exploiting this vulnerability can allow attackers to manipulate HTTP headers, potentially leading to unauthorized actions or data exposure.

Yes, the vulnerability also affects urllib in Python 3.x through 3.8.0, so it is important to update to the patched versions for both Python 2 and Python 3.

The CVSS score for this vulnerability is 6.1, indicating a moderate level of severity.

Related vulnerabilities

Recent vulnerabilities recorded for python2.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

2.7.18-r0

This is the first release that contains the fix.

sudo apk add --upgrade python2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback