CVE-2024-5206 Sensitive Data Leakage in sklearn.feature_extraction.text.TfidfVectorizer in scikit-learn/scikit-learn

Medium 4.7 Published Updated

Attackers can access sensitive training data tokens stored in the TfidfVectorizer stop_words_ attribute, potentially exposing passwords or keys.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2024-5206?

CVE-2024-5206 is a medium-severity vulnerability in scikit-learn/scikit-learn, published on 6 Jun 2024. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

A sensitive data leakage vulnerability was identified in scikit-learn's TfidfVectorizer, specifically in versions up to and including 1.4.1.post1, which was fixed in version 1.5.0. The vulnerability arises from the unexpected storage of all tokens present in the training data within the `stop_words_` attribute, rather than only storing the subset of tokens required for the TF-IDF technique to function. This behavior leads to the potential leakage of sensitive information, as the `stop_words_` attribute could contain tokens that were meant to be discarded and not stored, such as passwords or keys. The impact of this vulnerability varies based on the nature of the data being processed by the vectorizer.

Weakness: CWE-922, CWE-921

Which versions are affected by CVE-2024-5206?

3 open source packages ship an affected version, including scikit-learn. It affects 1 product.

PackageAffectedFixed in
scikit-learn PyPIAll versions1.5.0
scikit-learn PyPIAll versions1.5.0
scikit-learn PyPIAll versions1.5.0
Linux distribution packages (6)
python-scikit-learn SUSE:Linux Enterprise Module for Package Hub 15 SP5All versions0.23.2-150300.3.3.1
python-scikit-learn SUSE:Linux Enterprise Module for Package Hub 15 SP6All versions0.23.2-150300.3.3.1
python-scikit-learn openSUSE:Leap 15.5All versions0.23.2-150300.3.3.1
python-scikit-learn openSUSE:Leap 15.6All versions0.23.2-150300.3.3.1
python-scikit-learn openSUSE:TumbleweedAll versions1.5.0-1.1
python-scikit-learn openSUSE:TumbleweedAll versions1.9.0-1.1

Products include Scikit-Learn Scikit-Learn.

How do I fix CVE-2024-5206?

Upgrade scikit-learn to 1.5.0 or later.

Is CVE-2024-5206 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-5206 exists.

Sources

Also known as CLSA-2026-1787201491, DEBIAN-CVE-2024-5206, ECHO-bf4b-fb83-a5a9, GHSA-jw8x-6495-233v, MGASA-2024-0228, MINI-g5g6-3h3f-vw35 and 6 more.

Is CVE-2024-5206 in your software?

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

Check your SBOMs for free