Skip to main content

PyTorch torchvision CVE-2026-65918

| EUVDEUVD-2026-48341 HIGH
Out-of-bounds Read (CWE-125)
2026-07-23 VulnCheck GHSA-xhgh-4jhq-chj3
7.1
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft malicious or truncated GIF
  2. Delivery
    Submit to torchvision-backed image endpoint
  3. Exploit
    App calls decode_gif
  4. Execution
    Unclamped len passed to memcpy
  5. Persist
    Out-of-bounds heap read
  6. Impact
    Segfault DoS or adjacent heap-memory disclosure

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Bounds checking, read limits
MITRE ATT&CK

1 technique across 1 tactic: Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires the target application to decode an attacker-supplied GIF through torchvision's native GIF decoder (decode_gif/decode_image) on a vulnerable build (through 0.28.0) - this is the UI:P condition: an operator or automated pipeline must ingest and decode the malicious/truncated GIF. The concrete trigger is a GIF whose byte stream ends early or is crafted so giflib requests more bytes than remain in the input tensor, causing read_from_tensor's memcpy to over-read. Limiting factors: it only fires on the GIF code path (not other formats), the app must actually accept untrusted GIF input, no authentication or privileges are needed on the attacker side, and the primary outcome is a crash or bounded heap-memory disclosure rather than code execution.

Impact

The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:N/VA:H, base 7.1) reflects a network-reachable, low-complexity, no-privilege bug whose dominant impact is availability (VA:H, crash) with limited confidentiality (VC:L, heap disclosure) and no integrity impact - consistent with an OOB read. The one real gate is UI:P (passive user interaction): the target application must actually decode an attacker-controlled GIF, so this is not a fully autonomous remote exploit against a listening service unless such a service ingests untrusted GIFs. Publicly available exploit/reproducer code raises practical risk, but this is distinct from active exploitation - there is no KEV listing and no EPSS score was provided, so widespread mass exploitation cannot be inferred. Net: a genuine, easily-triggered DoS with a secondary info-leak in a very widely used ML library; prioritize where torchvision decodes untrusted images, but treat it as crash/leak severity rather than remote code execution.

Exploit ScenarioDerived

An attacker uploads a crafted or deliberately truncated GIF to an image-processing service (for example an ML pipeline that thumbnails or preprocesses user-submitted images with torchvision). When the service calls decode_gif, giflib requests more bytes than the tensor holds and the unclamped memcpy reads past the buffer, crashing the worker (DoS) or returning bytes of adjacent heap memory. A public reproducer/exploit already exists, and the low attack complexity means reliable triggering requires only that the victim application decode the attacker's file.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 23, 2026

Out-of-bounds heap read in PyTorch torchvision's native GIF decoder (versions through 0.28.0) lets attackers who supply a malicious or truncated GIF trigger a segmentation-fault denial of service or leak adjacent heap memory. The flaw sits in the libgif read_from_tensor callback, which passes an unclamped length to memcpy. A public exploit and reproducer exist and an upstream fix is available (commit 4e05dc2), but there is no public exploit identified in the sense of confirmed active exploitation - it is not on CISA KEV. Applications that decode untrusted GIFs via torchvision are affected.

RemediationAI

Upstream fix available (PR/commit); a released patched version was not independently confirmed from the input - the fix is commit 4e05dc22f5f050a9528cc0ea09ceca6cdaf8f4ed (PR #9520), which clamps the memcpy length to the bytes remaining in the tensor and clips out-of-canvas frame pixels. Upgrade to the first torchvision release that includes this commit (verify the exact tag against the PyTorch release notes rather than assuming a version number), or apply the commit as a backport if you build torchvision from source. Until patched, the practical compensating control is to stop feeding untrusted GIF data to torchvision's decoder: validate/reject GIF inputs before decode, or route untrusted images through a hardened external decoder (e.g. Pillow) instead of torchvision.decode_gif/decode_image, and run any decoding of untrusted media in a sandboxed/isolated worker so a segmentation fault or heap read cannot affect the main process. Trade-off: switching decoders or adding input validation changes your image-loading path and must be re-tested for format coverage and performance. Reference advisories: https://www.vulncheck.com/advisories/pytorch-torchvision-gif-decoder-out-of-bounds-heap-read and https://github.com/pytorch/vision/pull/9520.

Affected VersionsENISA

vision 0 ≤0.28.0

Affected Packages

euvd vision no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

torchvision ships C++ image decoders (torchvision/csrc/io/image/cpu/decode_gif.cpp) that wrap the giflib GIF-parsing engine. giflib pulls encoded bytes through a caller-supplied read callback; here read_from_tensor copies from the user tensor buffer into giflib's working buffer. The vulnerability is CWE-125 (Out-of-bounds Read): read_from_tensor called memcpy(buf, encoded_data + num_bytes_read, len) using giflib's requested len rather than the number of bytes actually remaining in the tensor, so a truncated/crafted GIF makes giflib request more bytes than exist and memcpy reads past the end of the tensor's heap allocation. The CPE cpe:2.3:a:pytorch:vision:*:*:*:*:*:*:*:* confirms the affected product is the pytorch 'vision' (torchvision) package. Notably, the PR diff also fixes a second, related canvas-clipping issue (an out-of-bounds heap WRITE when a frame's Image Descriptor Top/Left offset places pixels outside the allocated output tensor); the CVE text describes only the read, so the write-side issue may be under-documented in the advisory.

Know when Pytorch gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (VulnCheck) PRIMARY 7.1 HIGH
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:N/VA:H/SC:N/SI:N/SA:N
vuln.today AI 7.1 HIGH

Network-delivered file that a user/app must decode (UI:R), no auth (PR:N), low complexity; impact is high availability (crash) plus limited confidentiality (heap read), no integrity.

3.1 AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:N/VA:H/SC:N/SI:N/SA:N
Red Hat 7.1 HIGH

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
None
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

PyTorch torchvision through 0.28.0, fixed in commit 4e05dc2, contains an out-of-bounds heap read vulnerability in the GIF decoder's read_from_tensor callback that passes unclamped length to memcpy. Attackers can supply malicious or truncated GIF files to cause denial of service via segmentation fault or disclose adjacent heap memory contents.

Executive ViewAI

Why It Matters

PyTorch torchvision, widely used for image processing in AI/ML applications, contains a vulnerability (CVE-2026-65918) that can crash applications or expose sensitive data when processing untrusted GIF files. Any organization using torchvision to handle user-supplied images faces immediate risk of service disruption or potential data leakage. A vendor patch is available and must be deployed immediately across all affected systems.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.3%
Top 77% exploitable
Prevalence
High
torchvision is a very widely used computer-vision library across PyTorch ML pipelines
Exploit
POC
Public exploit code exists
Data Quality
9 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment Vendor CIRCL GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC Yes
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Partial

Priority Score

56
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +36
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

CVE-2023-43654 CRITICAL POC
9.8 Sep 28

TorchServe is a tool for serving and scaling PyTorch models in production. Rated critical severity (CVSS 9.8), this vuln

CVE-2024-48063 CRITICAL POC
9.8 Oct 29

In PyTorch <=2.4.1, the RemoteModule has Deserialization RCE. Rated critical severity (CVSS 9.8), this vulnerability is

CVE-2025-1945 CRITICAL POC
9.8 Mar 10

PickleScan before 0.0.23 can be bypassed by flipping specific ZIP file header flag bits, allowing malicious pickle files

CVE-2022-45907 CRITICAL POC
9.8 Nov 26

In PyTorch before trunk/89695, torch.jit.annotations.parse_type_line can cause arbitrary code execution because eval is

CVE-2026-24747 HIGH POC
8.8 Jan 27

PyTorch is a Python package that provides tensor computation. [CVSS 8.8 HIGH]

CVE-2024-8020 HIGH POC
7.5 Mar 20

A vulnerability in lightning-ai/pytorch-lightning version 2.3.2 allows an attacker to cause a denial of service by sendi

CVE-2025-1944 MEDIUM POC
6.5 Mar 10

picklescan before 0.0.23 is vulnerable to a ZIP archive manipulation attack that causes it to crash when attempting to e

CVE-2024-35198 CRITICAL
9.8 Jul 19

TorchServe is a flexible and easy-to-use tool for serving and scaling PyTorch models in production. Rated critical sever

CVE-2025-32434 CRITICAL POC
9.3 Apr 18

PyTorch is a Python package that provides tensor computation with strong GPU acceleration and deep neural networks built

CVE-2025-33244 CRITICAL
9.0 Mar 24

NVIDIA APEX for Linux contains a deserialization of untrusted data vulnerability that affects environments using PyTorch

CVE-2025-2953 MEDIUM POC
4.8 Mar 30

A vulnerability, which was classified as problematic, has been found in PyTorch 2.6.0+cu124. Rated medium severity (CVSS

CVE-2025-3136 MEDIUM POC
4.8 Apr 03

A vulnerability, which was classified as problematic, has been found in PyTorch 2.6.0.cuda.memory.caching_allocator_dele

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy