Vulnerabilities in pkg:pypi/pytest

PACKAGE
Advisory Identifier: GHSA-6w46-j5rx-g56g
Advisory Summary

CVE-2025-71176 is a MODERATE (CVSS 6.8) pytest has vulnerable tmpdir handling vulnerability (CWE-379: Creation of Temporary File in Directory with Insecure Permissions) affecting Pytest libraries in the PyPI ecosystem. The issue involves pytest has vulnerable tmpdir handling. Remediation is available by upgrading affected packages to version 9.0.3.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/pytest

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/pytest. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-6w46-j5rx-g56g CVE-2025-71176 MODERATE pytest has vulnerable tmpdir handling

CVE-2025-71176 at a Glance

CVE Identifier CVE-2025-71176
GHSA Identifier GHSA-6w46-j5rx-g56g
Severity MODERATE
CVSS v3.1 Base Score 6.8
CWE Classification CWE-379: Creation of Temporary File in Directory with Insecure Permissions
Affected Product Pytest
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.8

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

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

How to Fix CVE-2025-71176

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

pytest fixed: 9.0.3
pip install pytest>=9.0.3
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 pytest

How to Check if You Are Affected

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

pip show pytest

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-379: Creation of Temporary File in Directory with Insecure Permissions, where the product creates a temporary file in a directory whose permissions allow unintended actors to determine the file's existence or otherwise access that file. In Pytest, 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

pytest through 9.0.2 on UNIX relies on directories with the `/tmp/pytest-of-{user}` name pattern, which allows local users to cause a denial of service or possibly gain privileges.

CVE-2025-71176 Affected Pytest Versions

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

References

Frequently Asked Questions

What is CVE-2025-71176?
CVE-2025-71176 is a security vulnerability in Pytest involving pytest has vulnerable tmpdir handling under CWE-379: Creation of Temporary File in Directory with Insecure Permissions.
Which Pytest versions are affected?
Affected versions include releases prior to 9.0.3 across affected packages: pytest.
What version fixes CVE-2025-71176?
Upgrading to 9.0.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pytest affected?
Yes, pytest is affected in releases prior to 9.0.3. Upgrade your dependency to 9.0.3 or later.
What is the CVSS score of CVE-2025-71176?
CVE-2025-71176 has a CVSS v3.1 base score of 6.8 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L.
What CWE is associated with CVE-2025-71176?
CVE-2025-71176 is classified under CWE-379: Creation of Temporary File in Directory with Insecure Permissions (The product creates a temporary file in a directory whose permissions allow unintended actors to determine the file's existence or otherwise access that file.).
How can I check PyPI dependencies for CVE-2025-71176?
Run the dependency tree command: 'pip show pytest'. 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-6w46-j5rx-g56g",
  "modified" : "2026-04-13T16:38:46Z",
  "published" : "2026-01-22T06:30:29Z",
  "aliases" : [ "CVE-2025-71176" ],
  "summary" : "pytest has vulnerable tmpdir handling",
  "details" : "pytest through 9.0.2 on UNIX relies on directories with the `/tmp/pytest-of-{user}` name pattern, which allows local users to cause a denial of service or possibly gain privileges.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pytest"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "9.0.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-71176"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pytest-dev/pytest/issues/13669"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pytest-dev/pytest/pull/14343"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pytest-dev/pytest/commit/95d8423bd24992deea5b9df32555fa1741679e2c"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pytest-dev/pytes"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pytest-dev/pytest/releases/tag/9.0.3"
  }, {
    "type" : "WEB",
    "url" : "https://www.openwall.com/lists/oss-security/2026/01/21/5"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-379" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-13T16:38:46Z",
    "nvd_published_at" : "2026-01-22T05:16:17Z"
  }
}