CVE-2024-5206: scikit-learn sensitive data leakage vulnerability
Summary
CVE-2024-5206: scikit-learn sensitive data leakage vulnerability. Affects scikit-learn versions < 1.5.0. Fixed in 1.5.0. How to fix ↓
Also tracked for
- scikit-learn · Debian:11
The same CVE-2024-5206 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
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.
No signup required · Results in about 60 seconds
Background
scikit-learn is a popular Python library used for machine learning tasks. It provides various algorithms and tools for data preprocessing, feature extraction, and model training. One of its components, TfidfVectorizer, is responsible for converting text data into numerical representations using the TF-IDF technique. This technique is widely used in natural language processing tasks. However, versions up to and including 1.4.1.post1 of scikit-learn's TfidfVectorizer contain a sensitive data leakage vulnerability.
Vulnerability Detail
The vulnerability arises from the unexpected storage of all tokens present in the training data within the stop_words_ attribute of TfidfVectorizer. Instead of only storing the subset of tokens required for the TF-IDF technique, all tokens are stored, including sensitive information such as passwords or keys. This behavior can lead to the leakage of sensitive data. The impact of this vulnerability depends on the nature of the data being processed by the vectorizer.
How To Fix
Latest published version: 1.9.1 as of 23 Oct 2026
pip install --upgrade "scikit-learn==1.9.1"
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
1.5.0
This is the first release that contains the fix.
pip install --upgrade "scikit-learn==1.5.0"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no known workaround for this vulnerability. Upgrading to the fixed version is the recommended solution.
Conclusion
The scikit-learn sensitive data leakage vulnerability in TfidfVectorizer can result in the unintended storage of sensitive information. Users should upgrade to version 1.5.0 or later to mitigate this vulnerability. For further support on vulnerability remediation, contact DevNack.com.
See every vulnerability recorded for scikit-learn →
FAQ
scikit-learn is a Python library for machine learning tasks.
TfidfVectorizer is a component of scikit-learn used for converting text data into numerical representations using the TF-IDF technique.
The vulnerability can lead to the leakage of sensitive information present in the training data processed by TfidfVectorizer.
Upgrade to version 1.5.0 or later of scikit-learn to fix this vulnerability.
No, there is no known workaround. Upgrading to the fixed version is the recommended solution.
References
Related vulnerabilities
Recent vulnerabilities recorded for scikit-learn.