Command Execution Risk in scikit-learn: Untrusted File Handling Vulnerability

scikit-learn Updated 02 Oct 2025

Summary

15/05/2020
N/A
No i
Unrated
Not published

DEBIAN-CVE-2020-13092: scikit-learn (aka sklearn) through 0.23.0 can unserialize and execute commands from an untrusted file that is passed to the joblib.load() function, if reduce makes an os.system call. Affects scikit-learn versions 0.23.2-5 – 1.4.2+dfsg-8. No fix is published. 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

scikit-learn, also known as sklearn, is a widely-used machine learning library in Python that provides simple and efficient tools for data mining and data analysis. It is built on NumPy, SciPy, and matplotlib, and is designed to be accessible to non-experts while also being flexible enough for advanced users. The library offers various algorithms for classification, regression, clustering, and dimensionality reduction. However, a vulnerability has been identified that allows for the unserialization and execution of commands from untrusted files when using the joblib.load() function, particularly if the reduce method is improperly implemented.

Vulnerability Detail

The vulnerability arises from the ability of scikit-learn (up to version 0.23.0) to unserialize data from untrusted sources through the joblib.load() function. If an attacker crafts a malicious file that includes a reduce method calling os.system, it can lead to arbitrary command execution on the host system. This poses significant security risks, especially in environments where untrusted data is processed. The issue is compounded by the fact that the joblib.load() function is documented as unsafe, placing the onus on users to ensure secure usage.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, avoid using the joblib.load() function with untrusted files. If you must load data from an untrusted source, consider using safer alternatives or sanitizing the input to ensure it does not contain malicious code.

Conclusion

The vulnerability in scikit-learn poses a significant risk due to the potential for command execution from untrusted files. Users are encouraged to update to the latest version of the library and to exercise caution when handling untrusted data. Utilizing tools like Vulert can help monitor and manage vulnerabilities effectively.

See every vulnerability recorded for scikit-learn →

Share this vulnerability

FAQ

scikit-learn is a Python library for machine learning that provides tools for data analysis and modeling.

The vulnerability allows for the execution of arbitrary commands through the unserialization of untrusted files using joblib.load().

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. Check your application using the Vulert playground at Vulert Scanner.

As a workaround, avoid loading untrusted files with joblib.load() and consider sanitizing any input data.

Yes, updating scikit-learn to a version greater than 0.23.0 will patch the vulnerability.

Related vulnerabilities

Recent vulnerabilities recorded for scikit-learn.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. 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