CVE-2026-65918: PyTorch torchvision out-of-bounds read in GIF decoder

CVE-2026-65918 · Severity: high · CVSS 7.1 · Published 2026-07-23

torchvision is a popular library used by developers and researchers for computer vision tasks in AI applications. A flaw in how it processes GIF images allows an attacker to provide a specially crafted or truncated image file that causes the application to crash or potentially leak sensitive information from the computer's memory. This could lead to service outages or the exposure of data handled by the AI system.

Vendors: PyTorch.

Quick answers

Is CVE-2026-65918 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-65918 being exploited in the wild.
How severe is CVE-2026-65918?
High severity, with a CVSS score of 7.1, published 23 July 2026.
Which products and versions are affected?
PyTorch Torchvision <= 0.28.0.
Is there a fix for CVE-2026-65918?
A patch was published on 2026-06-22: Fix merged into main branch via commit 4e05dc2 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-65918 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-65918?
Check whether you run PyTorch Torchvision at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

An out-of-bounds (OOB) heap read vulnerability exists in the torchvision GIF decoder's 'read_from_tensor' callback. The root cause is a failure to use a clamped length value during a 'memcpy' operation; while the code calculates a safe 'num_bytes_to_read' based on the remaining buffer size, it incorrectly passes the original, potentially larger 'len' value to 'memcpy'. An attacker can exploit this by providing a malicious or truncated GIF file that declares a sub-block size larger than the remaining data in the input tensor. This results in a read past the end of the input buffer, which can cause a segmentation fault (DoS) or disclose adjacent heap memory. The vulnerability is reachable via 'torchvision.io.decode_gif', 'decode_image', or 'read_image'. A fix is available in commit 4e05dc2.

Affected products

  • PyTorch torchvision <= 0.28.0

Timeline

  • 2026-06-10: disclosed: Initial report to PyTorch security team
  • 2026-06-22: patched: Fix merged into main branch via commit 4e05dc2
  • 2026-07-23: advisory: Public disclosure and CVE assignment

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.