Critical Vulnerability in Python Package: CVE-2019-17514 - Documentation Misleading Sorting Behavior

python2.7 Updated 03 Oct 2025

Summary

12/10/2019
N/A
Yes i
High
7.5

UBUNTU-CVE-2019-17514: library/glob.html in the Python 2 and 3 documentation before 2016 has potentially misleading information about whether sorting occurs, as demonstrated by irreproducible cancer-research results. Affects python2.7 versions < 2.7.6-8ubuntu0.6+esm6. Fixed in 2.7.6-8ubuntu0.6+esm6. 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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Python is a widely-used high-level programming language known for its readability and versatility. The impacted packages, including python2.7, python3.4, python3.5, python3.6, python3.7, and python3.8, are essential for running Python applications across various environments. These packages provide core functionalities for developers, enabling them to build and run applications efficiently. However, a vulnerability in the documentation of the glob module has raised concerns about its implications on sorting behavior, potentially leading to incorrect assumptions in scientific computations.

Vulnerability Detail

The vulnerability arises from misleading information in the Python documentation regarding the sorting behavior of the glob module. Prior to 2016, the documentation suggested that the sorting rules applied by the Unix shell would also apply to the glob.glob function. This misrepresentation could lead to erroneous results in applications, particularly in fields like cancer research, where reproducibility is critical. The issue is not a bug in the Python implementation itself but rather a documentation oversight that can affect security-relevant code in various applications.

How To Fix

Minimum fixed version

2.7.6-8ubuntu0.6+esm6

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python2.7

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

Workaround

As a workaround, users can directly call the sort() function in their code to ensure that the results are sorted as expected. For example:

import glob

Get the list of files matching the pattern

files = glob.glob('*.txt')

Sort the files explicitly

sorted_files = sorted(files)

Now use sorted_files for further processing.

Conclusion

CVE-2019-17514 highlights a critical issue in the Python documentation that can mislead users regarding the sorting behavior of the glob module. It is essential for developers to update their Python packages to the patched versions to mitigate potential risks. Additionally, utilizing workarounds and tools like Vulert can help ensure that applications remain secure.

See every vulnerability recorded for python2.7 →

Share this vulnerability

FAQ

CVE-2019-17514 is a vulnerability in the Python documentation that misleads users regarding the sorting behavior of the glob module.

This vulnerability can lead to incorrect assumptions about file sorting, potentially resulting in erroneous outcomes in applications, especially in scientific research.

The affected versions include python2.7, python3.4, python3.5, python3.6, python3.7, and python3.8 across various Ubuntu distributions.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring signup.

The CVSS score of CVE-2019-17514 is 7.5, indicating a high severity level.

Related vulnerabilities

Recent vulnerabilities recorded for python2.7.

How To Fix

Minimum fixed version

2.7.6-8ubuntu0.6+esm6

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python2.7

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