
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2025-71176 is a vulnerability in pytest (through version 9.0.2) on UNIX systems involving insecure temporary directory handling that allows local users to cause a denial of service or possibly gain privileges. The flaw was reported by Michael Orlitzky on August 24, 2025, disclosed publicly via the oss-security mailing list on January 21, 2026, and assigned a CVE on January 22, 2026. It affects all pytest versions up to and including 9.0.2 on UNIX platforms; Windows is not affected. The CVSS v3.1 base score is 6.8 (Medium), assigned by MITRE (Red Hat Advisory, oss-security, GitHub Issue).
The root cause is classified as CWE-379 (Creation of Temporary File in Directory with Insecure Permissions). pytest creates a predictable temporary directory at /tmp/pytest-of-{user} and performs a UID ownership check to prevent tampering; however, this check follows symlinks and is subject to a time-of-check/time-of-use (TOCTOU) race condition. An attacker on the same system can pre-create a symlink at /tmp/pytest-of-{victim} pointing to an attacker-controlled directory before pytest runs, causing pytest to write test artifacts into that directory and potentially alter its permissions. The Linux kernel's fs.protected_symlinks and fs.protected_hardlinks sysctls mitigate some attack vectors but are not universally enabled and are Linux-specific (GitHub Issue, oss-security).
Successful exploitation can result in denial of service (preventing pytest from running or corrupting test artifacts) or privilege escalation, where an attacker gains write access to directories owned by another user and may manipulate their contents. The vulnerability also allows pytest to change permissions on attacker-chosen directories, potentially exposing sensitive data or enabling further attacks. The impact is limited to local, multi-user UNIX environments such as shared CI/CD systems or cloud build environments where multiple users share a common /tmp (oss-security, Red Hat Advisory).
No public exploit code or weaponized exploit kit has been identified for this vulnerability. The EPSS score is extremely low at 0.000040, indicating minimal probability of exploitation in the wild, and it is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Exploitation requires local access to a multi-user UNIX system and the ability to create symlinks in /tmp before the target user runs pytest. No threat actor attribution has been reported (Feedly, oss-security).
fs.protected_symlinks is disabled (check via sysctl fs.protected_symlinks)./tmp/pytest-of-{victim_username} pointing to an attacker-controlled directory (e.g., ln -s /home/attacker/target /tmp/pytest-of-victim).rootdir.mkdir(mode=0o700, exist_ok=True) and then checks ownership via rootdir.stat(). Because stat() follows symlinks, it checks the ownership of the attacker-controlled target directory rather than the symlink itself.chmod on the directory, altering permissions on the attacker-chosen path, potentially enabling further privilege escalation or data manipulation (GitHub Issue, oss-security)./tmp/pytest-of-{username} pointing to an unexpected directory (rather than a real directory owned by the user); unexpected files or directories appearing in locations outside /tmp after pytest runs.symlink or lstat/stat calls on /tmp/pytest-of-* paths by a user other than the expected pytest runner; unexpected chmod or chown operations on directories not owned by the pytest-running user./tmp/pytest-of-{user} subtree; unexpected permission changes on directories in /tmp or elsewhere attributable to the pytest process (GitHub Issue, oss-security).The fix is available in pytest version 9.0.3 and later (pytest 9.0.3 release). Users unable to upgrade immediately should create a secure temporary directory using mktemp -d and override pytest's default via the PYTEST_DEBUG_TEMPROOT environment variable or Python's tempfile.gettempdir() environment variables. On Linux, enabling the following kernel sysctls provides additional protection: fs.protected_symlinks=1, fs.protected_hardlinks=1, fs.protected_fifos=2, and fs.protected_regular=2. IBM has issued patches for affected products including IBM Engineering AI Hub, IBM InfoSphere Optim Archive Viewer, and IBM Maximo Application Suite (oss-security, IBM Engineering AI Hub, IBM Optim Archive Viewer, IBM Maximo).
The vulnerability was disclosed by Michael Orlitzky via the oss-security mailing list, who noted that denial of service is trivial and code execution is possible on multi-user systems, while acknowledging the issue is less impactful for single-user environments. The pytest GitHub issue remains open with a "help wanted" label, indicating the maintainers are seeking expert input on a robust fix. A Reddit thread in r/learnpython discussed the vulnerability, reflecting moderate community interest. SUSE issued a security update (SUSE-SU-2026:1744-1) addressing the issue in their distributions (oss-security, GitHub Issue, SUSE Advisory).
Fix availability across major Linux distributions and their releases.
bionic (esm-apps)
pytest
devel
pytest
focal (esm-apps)
pytest
jammy
pytest
jammy (esm-apps)
pytest
noble
pytest
noble (esm-apps)
pytest
resolute
pytest
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."