CVE-2025-3730: PyTorch Denial of Service Vulnerability in ctc_loss Function

pytorch Updated 02 Oct 2025

Summary

29/05/2025
Yes i
Medium
Not published

CVE-2025-3730: PyTorch LossCTC.cpp torch.nn.functional.ctc_loss denial of service. Affects pytorch versions >= 2.6.0, < 2.7.0. Fixed in 2.7.0. How to fix ↓

Also tracked for

The same CVE-2025-3730 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

PyTorch is an open-source machine learning library widely used for applications such as computer vision and natural language processing. It provides a flexible platform for building and training neural networks. The library's functionality includes tensor computation, automatic differentiation, and a rich ecosystem of tools and libraries. However, like many software packages, it is susceptible to vulnerabilities that can affect its performance and security.

Vulnerability Detail

A vulnerability classified as problematic was discovered in PyTorch version 2.6.0, specifically in the function torch.nn.functional.ctc_loss located in the file aten/src/ATen/native/LossCTC.cpp. This vulnerability can lead to a denial of service, where an attacker can exploit the function to disrupt the normal operation of the application. The attack must be executed locally, and while the exploit has been publicly disclosed, its actual impact is still under scrutiny. The patch addressing this issue is identified by the commit hash 46fc5d8e360127361211cb237d5f9eef0223e567.

How To Fix

Minimum fixed version

2.7.0

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary measure, avoid using the ctc_loss function with untrusted or unknown models, as they may exploit this vulnerability. Always validate and sanitize inputs to the function to mitigate potential risks.

Conclusion

The CVE-2025-3730 vulnerability in PyTorch's ctc_loss function poses a risk of denial of service, particularly in version 2.6.0. Users are encouraged to upgrade to version 2.7.0 or later to mitigate this risk. Additionally, employing best practices around input validation can help reduce exposure to potential exploits.

See every vulnerability recorded for pytorch →

Share this vulnerability

FAQ

CVE-2025-3730 is a vulnerability in PyTorch that can lead to denial of service through the ctc_loss function.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

If you cannot update, ensure that you do not use the ctc_loss function with untrusted models and validate all inputs.

The vulnerability is classified as medium severity, which means it poses a significant risk but is not the highest priority for immediate action.

You can visit the official PyTorch GitHub repository or security advisories for the latest updates on vulnerabilities.

Related vulnerabilities

Recent vulnerabilities recorded for pytorch.

How To Fix

Minimum fixed version

2.7.0

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback