CVE-2026-25645: Requests Requests Has Insecure Temp File Vulnerability

MODERATE
Advisory Identifier: GHSA-gc5v-m9x4-r6x2
CVSS 4.4
CWE-377
Published
Advisory Summary

CVE-2026-25645 is a MODERATE (CVSS 4.4) requests has insecure temp file vulnerability (CWE-377: Insecure Temporary File) affecting Requests libraries in the PyPI ecosystem. The issue involves requests has insecure temp file reuse in its extract_zipped_paths() utility function. Remediation is available by upgrading affected packages to version 2.33.0.

CVE-2026-25645 at a Glance

CVE Identifier CVE-2026-25645
GHSA Identifier GHSA-gc5v-m9x4-r6x2
Severity MODERATE
CVSS v3.1 Base Score 4.4
CWE Classification CWE-377: Insecure Temporary File
Affected Product Requests
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 4.4

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

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

How to Fix CVE-2026-25645

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

requests fixed: 2.33.0
pip install requests>=2.33.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 requests

How to Check if You Are Affected

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

pip show requests

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-377: Insecure Temporary File, where creating and using insecure temporary files can leave application and system data vulnerable to attack. In Requests, 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

### Impact The `requests.utils.extract_zipped_paths()` utility function uses a predictable filename when extracting files from zip archives into the system temporary directory. If the target file already exists, it is reused without validation. A local attacker with write access to the temp directory could pre-create a malicious file that would be loaded in place of the legitimate one. ### Affected usages **Standard usage of the Requests library is not affected by this vulnerability.** Only applications that call `extract_zipped_paths()` directly are impacted. ### Remediation Upgrade to at least Requests 2.33.0, where the library now extracts files to a non-deterministic location. If developers are unable to upgrade, they can set `TMPDIR` in their environment to a directory with restricted write access.

CVE-2026-25645 Affected Requests Versions

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

References

Frequently Asked Questions

What is CVE-2026-25645?
CVE-2026-25645 is a security vulnerability in Requests involving Requests has Insecure Temp File Reuse in its extract_zipped_paths() utility function under CWE-377: Insecure Temporary File.
Which Requests versions are affected?
Affected versions include releases prior to 2.33.0 across affected packages: requests.
What version fixes CVE-2026-25645?
Upgrading to 2.33.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is requests affected?
Yes, requests is affected in releases prior to 2.33.0. Upgrade your dependency to 2.33.0 or later.
What is the CVSS score of CVE-2026-25645?
CVE-2026-25645 has a CVSS v3.1 base score of 4.4 (MODERATE) with vector string CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2026-25645?
CVE-2026-25645 is classified under CWE-377: Insecure Temporary File (Creating and using insecure temporary files can leave application and system data vulnerable to attack.).
How can I check PyPI dependencies for CVE-2026-25645?
Run the dependency tree command: 'pip show requests'. 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-gc5v-m9x4-r6x2",
  "modified" : "2026-03-27T22:07:42Z",
  "published" : "2026-03-25T16:56:28Z",
  "aliases" : [ "CVE-2026-25645" ],
  "summary" : "Requests has Insecure Temp File Reuse in its extract_zipped_paths() utility function",
  "details" : "### Impact\nThe `requests.utils.extract_zipped_paths()` utility function uses a predictable filename when extracting files from zip archives into the system temporary directory. If the target file already exists, it is reused without validation. A local attacker with write access to the temp directory could pre-create a malicious file that would be loaded in place of the legitimate one.\n\n### Affected usages\n**Standard usage of the Requests library is not affected by this vulnerability.** Only applications that call `extract_zipped_paths()` directly are impacted.\n\n### Remediation\nUpgrade to at least Requests 2.33.0, where the library now extracts files to a non-deterministic location.\n\nIf developers are unable to upgrade, they can set `TMPDIR` in their environment to a directory with restricted write access.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "requests"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.33.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/psf/requests/security/advisories/GHSA-gc5v-m9x4-r6x2"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-25645"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/psf/requests/commit/66d21cb07bd6255b1280291c4fafb71803cdb3b7"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/psf/requests"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/psf/requests/releases/tag/v2.33.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-377" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-25T16:56:28Z",
    "nvd_published_at" : "2026-03-25T17:16:52Z"
  }
}