Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft malicious or truncated GIF
-
DeliverySubmit to torchvision-backed image endpoint
-
ExploitApp calls decode_gif
-
ExecutionUnclamped len passed to memcpy
-
PersistOut-of-bounds heap read
-
ImpactSegfault 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
Affected Packages
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
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
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.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
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
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.
Apply vendor patch.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
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.
TorchServe is a tool for serving and scaling PyTorch models in production. Rated critical severity (CVSS 9.8), this vuln
In PyTorch <=2.4.1, the RemoteModule has Deserialization RCE. Rated critical severity (CVSS 9.8), this vulnerability is
PickleScan before 0.0.23 can be bypassed by flipping specific ZIP file header flag bits, allowing malicious pickle files
In PyTorch before trunk/89695, torch.jit.annotations.parse_type_line can cause arbitrary code execution because eval is
PyTorch is a Python package that provides tensor computation. [CVSS 8.8 HIGH]
A vulnerability in lightning-ai/pytorch-lightning version 2.3.2 allows an attacker to cause a denial of service by sendi
picklescan before 0.0.23 is vulnerable to a ZIP archive manipulation attack that causes it to crash when attempting to e
TorchServe is a flexible and easy-to-use tool for serving and scaling PyTorch models in production. Rated critical sever
PyTorch is a Python package that provides tensor computation with strong GPU acceleration and deep neural networks built
NVIDIA APEX for Linux contains a deserialization of untrusted data vulnerability that affects environments using PyTorch
A vulnerability, which was classified as problematic, has been found in PyTorch 2.6.0+cu124. Rated medium severity (CVSS
A vulnerability, which was classified as problematic, has been found in PyTorch 2.6.0.cuda.memory.caching_allocator_dele
EUVD-2026-48341
GHSA-xhgh-4jhq-chj3
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB