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-2025-71176

CVE-2025-71176: pytest Privilege Escalation Vulnerability

CVE-2025-71176 is a privilege escalation flaw in pytest through version 9.0.2 on UNIX systems. It exploits insecure /tmp directory handling, allowing local attackers to escalate privileges or cause denial of service.

Published: January 23, 2026

CVE-2025-71176 Overview

CVE-2025-71176 is a race condition vulnerability affecting pytest through version 9.0.2 on UNIX systems. The vulnerability exists due to the testing framework's reliance on predictable temporary directory paths following the /tmp/pytest-of-{user} naming pattern. This insecure temporary file handling allows local users to cause a denial of service or potentially escalate privileges through symlink attacks or directory manipulation.

Critical Impact

Local attackers can exploit predictable temporary directory paths to disrupt pytest test execution or potentially gain elevated privileges through symlink attacks targeting the /tmp/pytest-of-{user} directories.

Affected Products

  • pytest through version 9.0.2 on UNIX systems
  • Applications and CI/CD pipelines using affected pytest versions
  • Development environments running pytest with default temporary directory configurations

Discovery Timeline

  • 2026-01-22 - CVE CVE-2025-71176 published to NVD
  • 2026-01-22 - Last updated in NVD database

Technical Details for CVE-2025-71176

Vulnerability Analysis

This vulnerability falls under CWE-379 (Creation of Temporary File in Directory with Insecure Permissions). The core issue stems from pytest's use of predictable temporary directory paths on UNIX systems. When pytest executes tests, it creates temporary directories following a static naming convention that incorporates the username running the tests. This predictability creates a window of opportunity for local attackers to preemptively create these directories or establish symbolic links before pytest initializes them.

The exploitation impact is twofold: denial of service can occur when an attacker prevents pytest from creating or accessing its required temporary directories, disrupting test execution. More concerning is the potential for privilege escalation through symlink attacks, where an attacker could redirect pytest's file operations to sensitive system locations.

Root Cause

The root cause is pytest's reliance on a predictable naming pattern for temporary directories without adequate validation. The framework uses /tmp/pytest-of-{user} as the base path for temporary test artifacts, where {user} is derived from the current system username. This deterministic approach violates secure coding practices for temporary file handling, which recommend using randomized, unpredictable paths or secure directory creation functions that prevent race conditions.

Attack Vector

The attack requires local access to the target system. An attacker with knowledge of which user accounts run pytest can preemptively create malicious symbolic links or directories at the expected temporary path locations. When pytest subsequently attempts to use these paths, the attacker can either cause the operation to fail (denial of service) or redirect file operations to unintended locations (potential privilege escalation). This Time-of-Check Time-of-Use (TOCTOU) race condition is particularly relevant in multi-user environments and shared CI/CD infrastructure.

The attack can be executed by creating a symbolic link at /tmp/pytest-of-{targetuser} pointing to a sensitive directory before the legitimate user runs pytest. When pytest creates files in what it believes is its temporary directory, those files may instead be written to the symlink target location.

Detection Methods for CVE-2025-71176

Indicators of Compromise

  • Unexpected symbolic links present at /tmp/pytest-of-* paths pointing to non-standard locations
  • Directory ownership anomalies where pytest temporary directories are owned by unexpected users
  • Presence of pre-created /tmp/pytest-of-{user} directories with suspicious permissions or timestamps
  • File system events showing rapid creation/deletion of pytest temporary directories by non-pytest processes

Detection Strategies

  • Monitor file system activity in /tmp/ for creation of pytest-of-* directories by users other than the expected pytest runners
  • Implement integrity checking for temporary directory paths before pytest execution in CI/CD pipelines
  • Audit symbolic link creation events targeting pytest temporary directory patterns
  • Use process monitoring to detect attempts to access or modify pytest temporary directories by unauthorized processes

Monitoring Recommendations

  • Configure file integrity monitoring (FIM) rules for the /tmp/ directory to alert on suspicious pytest-related directory activity
  • Implement audit rules using auditd or similar tools to track symlink and mkdir system calls targeting /tmp/pytest-of-* paths
  • Review system logs for failed pytest executions that may indicate exploitation attempts
  • In shared environments, monitor for users creating directories matching other users' pytest temporary path patterns

How to Mitigate CVE-2025-71176

Immediate Actions Required

  • Upgrade pytest to a patched version when available from the pytest development team
  • Configure pytest to use a non-default, secure temporary directory location with restricted permissions
  • In shared or multi-user environments, implement filesystem protections such as sticky bits and user-private /tmp directories
  • Review CI/CD pipeline configurations to ensure pytest runs in isolated environments with proper filesystem sandboxing

Patch Information

As of the last update, users should monitor the pytest GitHub Issues for official patches and version updates addressing this vulnerability. The security discussion is also tracked on the OpenWall Security Mailing List. Organizations should upgrade to the latest pytest version once a fix is released.

Workarounds

  • Configure the PYTEST_DEBUG_TEMPROOT environment variable to use a secure, user-specific directory with restricted permissions instead of the default /tmp location
  • Use containerization or virtualization to isolate pytest execution environments, preventing cross-user temporary directory attacks
  • Implement filesystem namespacing in CI/CD environments to give each pytest instance its own private /tmp directory
  • On Linux systems, enable per-user temporary directories using pam_namespace or similar mechanisms
bash
# Configuration example
# Set a secure custom temporary directory for pytest
export PYTEST_DEBUG_TEMPROOT="/home/$USER/.pytest_tmp"
mkdir -p "$PYTEST_DEBUG_TEMPROOT"
chmod 700 "$PYTEST_DEBUG_TEMPROOT"

# Alternatively, use tmpfs with restricted permissions
# Add to /etc/fstab for persistent private tmp:
# tmpfs /home/user/.pytest_tmp tmpfs mode=0700,uid=1000,gid=1000 0 0

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

  • Vulnerability Details
  • TypePrivilege Escalation

  • Vendor/TechPytest

  • SeverityMEDIUM

  • CVSS Score6.8

  • EPSS Probability0.00%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityLow
  • CWE References
  • CWE-379
  • Technical References
  • GitHub Issue Discussion

  • OpenWall Security List Post
  • Related CVEs
  • CVE-2020-29651: Pytest Py DOS Vulnerability

  • CVE-2022-42969: Pytest Py Library DOS Vulnerability
Default Legacy - Prefooter | 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