Catastrophic Backtracking Vulnerability in Python

python2 Updated 02 Oct 2025

Summary

18/06/2018
N/A
Yes i
High
7.5

CVE-2018-1060: python before versions 2.7.15, 3.4.9, 3.5.6rc1, 3.6.5rc1 and 3.7.0 is vulnerable to catastrophic backtracking in pop3lib's apop() method. Affects python2 across 2 version ranges.

< 2.7.15-r0 < ca079a3ea30098aff3197c559a0e32d42dda6d84

Fixed in 2.7.15-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 Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Python is a popular programming language known for its simplicity and versatility. It is widely used for various purposes, including web development, data analysis, and scripting. The vulnerability, identified as CVE-2018-1060, affects versions of Python before 2.7.15, 3.4.9, 3.5.6rc1, 3.6.5rc1, and 3.7.0. This vulnerability specifically targets the 'pop3lib' module's 'apop()' method, which is used for authentication in POP3 email protocols. The vulnerability allows an attacker to exploit the application by causing a denial of service (DoS) attack.

Vulnerability Detail

The vulnerability arises from a flaw in the 'apop()' method of the 'pop3lib' module in Python. It is categorized as a catastrophic backtracking vulnerability. An attacker can exploit this flaw by sending specially crafted requests to the application, causing the 'apop()' method to enter a state of catastrophic backtracking. This can lead to excessive CPU usage and ultimately result in a denial of service. The impact of this vulnerability can be severe, as it can disrupt the availability of the affected application.

How To Fix

Minimum fixed version

2.7.15-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 workaround, users can disable the 'apop()' method in the 'pop3lib' module. This can be achieved by modifying the code to remove any references to the 'apop()' method or by using alternative authentication methods. However, it is important to note that this workaround may impact the functionality of the application and should only be considered if updating Python is not feasible.

Conclusion

The catastrophic backtracking vulnerability in Python's 'pop3lib' module can be mitigated by updating Python to a fixed version. It is crucial to regularly update Python and other software dependencies to ensure the latest security patches are applied. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for python2 →

Share this vulnerability

FAQ

The vulnerability can lead to a denial of service (DoS) attack, causing the affected application to become unresponsive and unavailable.

Versions of Python before 2.7.15, 3.4.9, 3.5.6rc1, 3.6.5rc1, and 3.7.0 are vulnerable to this issue.

To fix the vulnerability, update Python to version 2.7.15, 3.4.9, 3.5.6rc1, 3.6.5rc1, or 3.7.0, or later.

A workaround is to disable the 'apop()' method in the 'pop3lib' module or use alternative authentication methods.

There is no known exploit available for this vulnerability at the moment.

Related vulnerabilities

Recent vulnerabilities recorded for python2.

How To Fix

Minimum fixed version

2.7.15-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