CVE-2024-5206: Scikit learn Scikit-learn Sensitive Data Leakage Vulnerability Vulnerability

MODERATE
Advisory Identifier: GHSA-jw8x-6495-233v
CVSS 5.3
CWE-922 CWE-921
Published
Advisory Summary

CVE-2024-5206 is a MODERATE (CVSS 5.3) scikit-learn sensitive data leakage vulnerability vulnerability (CWE-922: Insecure Storage of Sensitive Information) affecting Scikit learn libraries in the PyPI ecosystem. The issue involves scikit-learn sensitive data leakage vulnerability. Remediation is available by upgrading affected packages to version 1.5.0.

CVE-2024-5206 at a Glance

CVE Identifier CVE-2024-5206
GHSA Identifier GHSA-jw8x-6495-233v
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-922: Insecure Storage of Sensitive Information
Affected Product Scikit learn
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2024-5206

To remediate this vulnerability, upgrade all affected Scikit learn dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

scikit-learn fixed: 1.5.0
pip install scikit-learn>=1.5.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show scikit-learn

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2024-5206, inspect your installed packages using pip:

pip show scikit-learn

Analyze the terminal output to locate any version of Scikit learn in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.5.0), your application is affected.

Note: The pip show scikit-learn command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-922: Insecure Storage of Sensitive Information, where the product stores sensitive information without properly limiting read or write access by unauthorized actors. In Scikit learn, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

CVE-2024-5206 Affected Scikit learn Versions

1 component(s)
Fixed Versions:
1.5.0
Product / Package Ecosystem Affected Versions Fixed Version
scikit-learn
PyPI
< 1.5.0
1.5.0

References

Frequently Asked Questions

What is CVE-2024-5206?
CVE-2024-5206 is a security vulnerability in Scikit learn involving scikit-learn sensitive data leakage vulnerability under CWE-922: Insecure Storage of Sensitive Information.
Which Scikit learn versions are affected?
Affected versions include releases prior to 1.5.0 across affected packages: scikit-learn.
What version fixes CVE-2024-5206?
Upgrading to 1.5.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is scikit-learn affected?
Yes, scikit-learn is affected in releases prior to 1.5.0. Upgrade your dependency to 1.5.0 or later.
What is the CVSS score of CVE-2024-5206?
CVE-2024-5206 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2024-5206?
CVE-2024-5206 is classified under CWE-922: Insecure Storage of Sensitive Information (The product stores sensitive information without properly limiting read or write access by unauthorized actors.).
How can I check PyPI dependencies for CVE-2024-5206?
Run the dependency tree command: 'pip show scikit-learn'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-jw8x-6495-233v",
  "modified" : "2024-10-25T16:47:32Z",
  "published" : "2024-06-06T21:30:37Z",
  "aliases" : [ "CVE-2024-5206" ],
  "summary" : "scikit-learn sensitive data leakage vulnerability",
  "details" : "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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "scikit-learn"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.5.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-5206"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/scikit-learn/scikit-learn/commit/70ca21f106b603b611da73012c9ade7cd8e438b8"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/scikit-learn/PYSEC-2024-110.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/scikit-learn/scikit-learn"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.com/bounties/14bc0917-a85b-4106-a170-d09d5191517c"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-921", "CWE-922" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-06-17T22:31:08Z",
    "nvd_published_at" : "2024-06-06T19:16:06Z"
  }
}