The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2023-2800

CVE-2023-2800: Huggingface Transformers File Vulnerability

CVE-2023-2800 is an insecure temporary file vulnerability in Huggingface Transformers prior to version 4.30.0 that could allow unauthorized file access. This article covers technical details, affected versions, and mitigation.

Published: February 4, 2026

CVE-2023-2800 Overview

CVE-2023-2800 is an insecure temporary file vulnerability affecting the Huggingface Transformers library prior to version 4.30.0. The vulnerability stems from the use of the deprecated tempfile.mktemp() function, which creates predictable temporary file names that can be exploited in race condition attacks.

Critical Impact

Local attackers with low privileges can exploit predictable temporary file paths to perform symlink attacks or cause denial of service conditions, potentially disrupting machine learning workflows and model operations.

Affected Products

  • Huggingface Transformers versions prior to 4.30.0
  • Applications and pipelines utilizing vulnerable Transformers library functions
  • Machine learning environments downloading models via the Transformers hub utilities

Discovery Timeline

  • 2023-05-18 - CVE-2023-2800 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2023-2800

Vulnerability Analysis

This vulnerability is classified as CWE-377 (Insecure Temporary File). The root issue lies in the src/transformers/utils/hub.py module, which used Python's deprecated tempfile.mktemp() function for creating temporary files during model and resource downloads.

The mktemp() function generates a filename but does not actually create the file, creating a time-of-check to time-of-use (TOCTOU) race condition window. During this gap, an attacker with local access could create a file or symlink at the predicted path before the legitimate application opens it.

This vulnerability requires local access and has high attack complexity, making exploitation non-trivial but still a valid security concern in shared computing environments commonly used for machine learning workloads.

Root Cause

The vulnerability originates from using the deprecated tempfile.mktemp() function instead of secure alternatives. The mktemp() function only returns a filename string without atomically creating the file, leaving the application vulnerable to symlink attacks and race conditions.

Python's official documentation explicitly warns against using mktemp() due to these security implications. The secure alternative is tempfile.mkstemp(), which atomically creates the file with exclusive access, returning both a file descriptor and the path.

Attack Vector

The attack vector is local, requiring the attacker to have low-privilege access to the target system. An attacker could:

  1. Predict the temporary file path that will be generated by mktemp()
  2. Create a symlink at that path pointing to a sensitive file or critical resource
  3. When the Transformers library writes to the "temporary file," data could be redirected or a denial of service condition could occur
python
         " that this is not compatible with the caching system (your file will be downloaded at each execution) or"
         " multiple processes (each process will download the file in a different temporary file)."
     )
-    tmp_file = tempfile.mktemp()
+    tmp_file = tempfile.mkstemp()[1]
     with open(tmp_file, "wb") as f:
         http_get(url, f, proxies=proxies)
     return tmp_file

Source: GitHub Commit Change

Detection Methods for CVE-2023-2800

Indicators of Compromise

  • Unexpected symlinks appearing in temporary directories (/tmp, /var/tmp, or system-specific temp locations)
  • Abnormal file operations or permission errors when Transformers library attempts to download models
  • Unexplained application crashes or high availability issues during model loading operations

Detection Strategies

  • Implement software composition analysis (SCA) tools to identify Transformers library versions below 4.30.0 in your environment
  • Monitor for unusual symlink creation patterns in temporary directories used by Python applications
  • Audit Python dependencies across machine learning pipelines for deprecated function usage

Monitoring Recommendations

  • Enable file integrity monitoring on systems running Transformers-based applications
  • Log and alert on repeated failed file creation attempts in temporary directories
  • Track library version updates through dependency management tools to ensure timely patching

How to Mitigate CVE-2023-2800

Immediate Actions Required

  • Upgrade Huggingface Transformers library to version 4.30.0 or later immediately
  • Audit all machine learning pipelines and applications for vulnerable Transformers versions
  • Review any custom code that may have copied the insecure temporary file pattern
  • Restrict access to shared computing environments where possible

Patch Information

The fix was implemented in commit 80ca92470938bbcc348e2d9cf4734c7c25cb1c43, which replaces the deprecated tempfile.mktemp() call with the secure tempfile.mkstemp() function. The mkstemp() function atomically creates the file and returns a tuple containing the file descriptor and path, eliminating the race condition window.

For detailed patch information, refer to the GitHub Commit Change and the Huntr Bug Bounty Report.

Workarounds

  • If immediate upgrading is not possible, apply stricter permissions on temporary directories
  • Use isolated container environments for machine learning workloads to limit local attack surface
  • Implement mount options such as noexec on temporary directories where feasible
bash
# Upgrade Huggingface Transformers to patched version
pip install --upgrade transformers>=4.30.0

# Verify installed version
pip show transformers | grep Version

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeOther

  • Vendor/TechHuggingface Transformers

  • SeverityMEDIUM

  • CVSS Score4.7

  • EPSS Probability0.02%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-377
  • Vendor Resources
  • GitHub Commit Change

  • Huntr Bug Bounty Report
  • Related CVEs
  • CVE-2023-7018: Huggingface Transformers Deserialization Flaw

  • CVE-2023-6730: Huggingface Transformers Deserialization Flaw

  • CVE-2025-2099: Huggingface Transformers ReDoS Vulnerability

  • CVE-2024-11392: Huggingface Transformers RCE Vulnerability
Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English