CVE-2023-2800: Transformers Transformers Has Insecure Temporary File Vulnerability

MODERATE
Advisory Identifier: GHSA-282v-666c-3fvg
CVSS 4.7
CWE-377
Published
Advisory Summary

CVE-2023-2800 is a MODERATE (CVSS 4.7) transformers has insecure temporary file vulnerability (CWE-377: Insecure Temporary File) affecting Transformers libraries in the PyPI ecosystem. The issue involves transformers has insecure temporary file. Remediation is available by upgrading affected packages to version 4.30.0.

CVE-2023-2800 at a Glance

CVE Identifier CVE-2023-2800
GHSA Identifier GHSA-282v-666c-3fvg
Severity MODERATE
CVSS v3.1 Base Score 4.7
CWE Classification CWE-377: Insecure Temporary File
Affected Product Transformers
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 4.7

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

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

How to Fix CVE-2023-2800

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

transformers fixed: 4.30.0
pip install transformers>=4.30.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 transformers

How to Check if You Are Affected

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

pip show transformers

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-377: Insecure Temporary File, where creating and using insecure temporary files can leave application and system data vulnerable to attack. In Transformers, 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

Insecure Temporary File in GitHub repository huggingface/transformers 4.29.2 and prior. A fix is available at commit 80ca92470938bbcc348e2d9cf4734c7c25cb1c43 and has been released as part of version 4.30.0.

CVE-2023-2800 Affected Transformers Versions

1 component(s)
Fixed Versions:
4.30.0
Product / Package Ecosystem Affected Versions Fixed Version
transformers
PyPI
< 4.30.0
4.30.0

References

Frequently Asked Questions

What is CVE-2023-2800?
CVE-2023-2800 is a security vulnerability in Transformers involving transformers has Insecure Temporary File under CWE-377: Insecure Temporary File.
Which Transformers versions are affected?
Affected versions include releases prior to 4.30.0 across affected packages: transformers.
What version fixes CVE-2023-2800?
Upgrading to 4.30.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is transformers affected?
Yes, transformers is affected in releases prior to 4.30.0. Upgrade your dependency to 4.30.0 or later.
What is the CVSS score of CVE-2023-2800?
CVE-2023-2800 has a CVSS v3.1 base score of 4.7 (MODERATE) with vector string CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2023-2800?
CVE-2023-2800 is classified under CWE-377: Insecure Temporary File (Creating and using insecure temporary files can leave application and system data vulnerable to attack.).
How can I check PyPI dependencies for CVE-2023-2800?
Run the dependency tree command: 'pip show transformers'. 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-282v-666c-3fvg",
  "modified" : "2024-11-22T20:34:48Z",
  "published" : "2023-05-18T18:30:35Z",
  "aliases" : [ "CVE-2023-2800" ],
  "summary" : "transformers has Insecure Temporary File",
  "details" : "Insecure Temporary File in GitHub repository huggingface/transformers 4.29.2 and prior. A fix is available at commit 80ca92470938bbcc348e2d9cf4734c7c25cb1c43 and has been released as part of version 4.30.0.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "transformers"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.30.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-2800"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/huggingface/transformers/pull/23372"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/huggingface/transformers/commit/80ca92470938bbcc348e2d9cf4734c7c25cb1c43"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/huggingface/transformers"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/transformers/PYSEC-2023-299.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.dev/bounties/a3867b4e-6701-4418-8c20-3c6e7084a44a"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-377" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-05-19T13:27:42Z",
    "nvd_published_at" : "2023-05-18T17:15:08Z"
  }
}