CVE-2020-5252 Malicious package may avoid detection in python auditing

Medium 5.0 Published Updated

Attackers can bypass Safety package detection by exploiting Python environment characteristics, requiring users to run the tool in isolated environments.

Exploited in the wild
Not known
Login needed
An administrator
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2020-5252?

CVE-2020-5252 is a medium-severity vulnerability in pyupio safety, published on 23 Mar 2020. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

Official description

The command-line "safety" package for Python has a potential security issue. There are two Python characteristics that allow malicious code to “poison-pill” command-line Safety package detection routines by disguising, or obfuscating, other malicious or non-secure packages. This vulnerability is considered to be of low severity because the attack makes use of an existing Python condition, not the Safety tool itself. This can happen if: You are running Safety in a Python environment that you don’t trust. You are running Safety from the same Python environment where you have your dependencies installed. Dependency packages are being installed arbitrarily or without proper verification. Users can mitigate this issue by doing any of the following: Perform a static analysis by installing Docker and running the Safety Docker image: $ docker run --rm -it pyupio/safety check -r requirements.txt Run Safety against a static dependencies list, such as the requirements.txt file, in a separate, clean Python environment. Run Safety from a Continuous Integration pipeline. Use PyUp.io, which runs Safety in a controlled environment and checks Python for dependencies without any need to install them. Use PyUp's Online Requirements Checker.

Weakness: CWE-807

Which versions are affected by CVE-2020-5252?

3 open source packages ship an affected version, including safety. It affects 1 product.

PackageAffectedFixed in
safety PyPIAll versions1.8.7
safety PyPIAll versions1.9.0
safety PyPIAll versions1.9.0

Products include Pyup Safety.

How do I fix CVE-2020-5252?

Upgrade safety to a fixed version for your release line: 1.8.7 or 1.9.0.

Is CVE-2020-5252 being exploited?

There is no known exploitation of CVE-2020-5252 in the wild and no public exploit code.

Sources

Also known as GHSA-7q25-qrjw-6fg2, PYSEC-2020-101.

Is CVE-2020-5252 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free