CVE-2023-6730: Transformers Transformers Has A Deserialization Of Vulnerability

CRITICAL
Advisory Identifier: GHSA-3863-2447-669p
CVSS 9.0
CWE-502
Published
Advisory Summary

CVE-2023-6730 is a CRITICAL (CVSS 9.0) transformers has a deserialization of vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Transformers libraries in the PyPI ecosystem. The issue involves transformers has a deserialization of untrusted data vulnerability. Remediation is available by upgrading affected packages to version 4.36.0.

CVE-2023-6730 at a Glance

CVE Identifier CVE-2023-6730
GHSA Identifier GHSA-3863-2447-669p
Severity CRITICAL
CVSS v3.1 Base Score 9.0
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product Transformers
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 9.0

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

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

How to Fix CVE-2023-6730

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.36.0
pip install transformers>=4.36.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-6730, 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.36.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-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. 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

Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36.0.

CVE-2023-6730 Affected Transformers Versions

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

References

Frequently Asked Questions

What is CVE-2023-6730?
CVE-2023-6730 is a security vulnerability in Transformers involving transformers has a Deserialization of Untrusted Data vulnerability under CWE-502: Deserialization of Untrusted Data.
Which Transformers versions are affected?
Affected versions include releases prior to 4.36.0 across affected packages: transformers.
What version fixes CVE-2023-6730?
Upgrading to 4.36.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.36.0. Upgrade your dependency to 4.36.0 or later.
What is the CVSS score of CVE-2023-6730?
CVE-2023-6730 has a CVSS v3.1 base score of 9.0 (CRITICAL) with vector string CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2023-6730?
CVE-2023-6730 is classified under CWE-502: Deserialization of Untrusted Data (The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.).
How can I check PyPI dependencies for CVE-2023-6730?
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-3863-2447-669p",
  "modified" : "2024-11-22T20:44:47Z",
  "published" : "2023-12-19T15:30:30Z",
  "aliases" : [ "CVE-2023-6730" ],
  "summary" : "transformers has a Deserialization of Untrusted Data vulnerability",
  "details" : "Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36.0.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "transformers"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.36.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-6730"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/huggingface/transformers/commit/1d63b0ec361e7a38f1339385e8a5a855085532ce"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/huggingface/transformers"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/transformers/PYSEC-2023-300.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.com/bounties/423611ee-7a2a-442a-babb-3ed2f8385c16"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-502" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-12-19T23:16:40Z",
    "nvd_published_at" : "2023-12-19T13:15:43Z"
  }
}