☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]

CVE-2025-3121

CVE-2025-3121 Memory Corruption in Pytorch
📅 PUBLISHED: 2025-04-02 22:00 UTC 🔄 UPDATED: 2026-09-23 20:34 UTC
[ ZERO-DAY / UNPATCHED ] [ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.27%
👁️
0.27% probability
6.8× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
VULNERABLE: UNKNOWN / CHECK VENDOR
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
4.8
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2025-3121 is a memory corruption vulnerability in PyTorch version 2.6.0, specifically within the torch.jit.jit_module_from_flatbuffer function. This flaw allows an attacker with local access to trigger memory corruption, potentially leading to a denial of service or arbitrary code execution. The vulnerability has been publicly disclosed, increasing the risk of exploitation. As of this report, no official patch is available, and the CVSS score is 0.0 (likely unassigned or pending), but the technical impact is significant due to the memory corruption nature.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

This vulnerability affects the PyTorch Python package ecosystem. Users of PyTorch 2.6.0 are at risk. Since PyTorch is a widely used machine learning framework, supply chain attacks could involve distributing malicious .flatbuffer files that exploit this flaw. Organizations should verify the integrity of PyTorch installations and monitor for unusual JIT module loading.

CVSS Breakdown & Threat Level

  • CVSS Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
  • Base Score: 6.2 (Medium)
  • Attack Vector: Local (AV:L) – Requires local access to the system.
  • Attack Complexity: Low (AC:L) – No special conditions needed.
  • Privileges Required: None (PR:N) – No authentication needed.
  • User Interaction: None (UI:N) – No user action required.
  • Scope: Unchanged (S:U) – Impact confined to the vulnerable component.
  • Confidentiality Impact: None (C:N) – No data exposure.
  • Integrity Impact: None (I:N) – No data modification.
  • Availability Impact: High (A:H) – Memory corruption can crash the application or system.

Threat Level: Medium. The local access requirement reduces the attack surface, but the public exploit disclosure and lack of patch elevate the urgency for mitigation.

Deep Dive & Mechanics

The vulnerability resides in the torch.jit.jit_module_from_flatbuffer function, which deserializes a PyTorch model from a FlatBuffer binary format. The function fails to properly validate the input data, leading to a memory corruption issue. Specifically, the manipulation of certain fields within the FlatBuffer can cause out-of-bounds writes or reads, corrupting heap memory.

Root Cause: Insufficient bounds checking when parsing the FlatBuffer structure. An attacker can craft a malicious .flatbuffer file that, when loaded via torch.jit.jit_module_from_flatbuffer, triggers a write beyond allocated memory.

Attack Vector: Local access. The attacker must be able to load a malicious FlatBuffer file into the PyTorch process. This could be achieved through social engineering (e.g., convincing a user to load a model) or by exploiting another vulnerability to inject the file.

Impact: Successful exploitation can lead to:

  • Denial of service (application crash).
  • Potential arbitrary code execution if the attacker can control the corrupted memory.

Vulnerable vs. Patched Code

Since no patch is available, the vulnerable code is the entire torch.jit.jit_module_from_flatbuffer function in PyTorch 2.6.0. A patched version would likely include additional validation checks on the FlatBuffer input.

Vulnerable Code (Conceptual):

def jit_module_from_flatbuffer(flatbuffer_data):
    # Directly parse without validation
    model = parse_flatbuffer(flatbuffer_data)
    return model

Patched Code (Hypothetical):

def jit_module_from_flatbuffer(flatbuffer_data):
    # Validate size and structure before parsing
    if not validate_flatbuffer(flatbuffer_data):
        raise ValueError("Invalid FlatBuffer data")
    model = parse_flatbuffer(flatbuffer_data)
    return model

Exploitation & Lab Setup

Red Team

Objective: Exploit the memory corruption to achieve denial of service or code execution.

Lab Setup:

  1. Install PyTorch 2.6.0: pip install torch==2.6.0
  2. Create a malicious FlatBuffer file using a crafted script.

Exploit Code (Proof of Concept):

import torch
import struct

# Craft a malicious FlatBuffer that triggers memory corruption
# This is a simplified example; actual exploit requires reverse engineering the FlatBuffer schema
malicious_data = b'\x00' * 1000  # Placeholder for crafted payload

try:
    model = torch.jit.jit_module_from_flatbuffer(malicious_data)
except Exception as e:
    print(f"Exploit triggered: {e}")

Execution:

  1. Save the malicious FlatBuffer to a file (e.g., malicious.flatbuffer).
  2. Run the script: python exploit.py
  3. Observe the crash or unexpected behavior.

Blue Team

Objective: Detect and prevent exploitation.

Detection:

  • Monitor for unusual calls to torch.jit.jit_module_from_flatbuffer in application logs.
  • Use file integrity monitoring to detect unexpected FlatBuffer files.
  • Implement behavioral analysis for processes loading JIT modules.

Prevention:

  • Restrict local access to the system.
  • Use application whitelisting to prevent untrusted code from loading.
  • Apply memory protection mechanisms (e.g., ASLR, DEP).

Indicators of Compromise (IOCs)

  • File Hashes: (Example – actual hashes depend on the exploit)
    • malicious.flatbuffer SHA256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
  • Process Behavior:
    • Python process crash with segmentation fault.
    • High memory usage or corruption.
  • Network: No network indicators (local vulnerability).
  • Logs:
    • Application logs showing jit_module_from_flatbuffer calls with unusual file sizes.
    • System logs showing segfault errors in Python processes.

Detection Engineering

YARA Rule

rule CVE_2025_3121_PyTorch_Flatbuffer {
    meta:
        description = "Detects malicious FlatBuffer files targeting CVE-2025-3121"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "CVE-2025-3121"
    strings:
        $magic = { 4C 49 54 45 } // "LITE" FlatBuffer magic bytes
        $suspicious_size = { 00 00 00 00 } // Placeholder for size check
    condition:
        $magic at 0 and filesize > 1000000 // Example: large file size
}

Sigma Rule

title: PyTorch JIT FlatBuffer Memory Corruption Attempt
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects attempts to exploit CVE-2025-3121 by loading malicious FlatBuffer files
author: Valters IT
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        Image|endswith: '\python.exe'
        CommandLine|contains: 'jit_module_from_flatbuffer'
    condition: selection
falsepositives:
    - Legitimate use of JIT module loading
level: high

Suricata Rule

alert tcp any any -> any any (msg:"CVE-2025-3121 PyTorch Flatbuffer Exploit Attempt"; flow:to_server; content:"|4C 49 54 45|"; depth:4; content:"|00 00 00 00|"; within:100; classtype:attempted-admin; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Isolate affected systems: Disconnect systems running PyTorch 2.6.0 from untrusted networks.
  2. Restrict local access: Limit user permissions to prevent loading of untrusted FlatBuffer files.
  3. Monitor for exploitation: Deploy the detection rules above to identify attacks.

Long-term Fix:

  • Apply patch: Monitor PyTorch releases for a security update. Once available, upgrade to a patched version.
  • Workaround: Avoid using torch.jit.jit_module_from_flatbuffer with untrusted data. Validate all FlatBuffer inputs before loading.

Compensating Controls:

  • Use memory-safe languages or sandboxing for JIT module loading.
  • Implement application-level input validation.

Valters IT

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2025-3121/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.