CVE-2025-55551

7.5 HIGH

📋 TL;DR

A vulnerability in PyTorch's torch.linalg.lu component allows attackers to trigger a Denial of Service (DoS) through specific slice operations. This affects systems running PyTorch v2.8.0 where LU decomposition functions are used. The vulnerability can crash applications or services relying on these mathematical operations.

💻 Affected Systems

Products:
  • PyTorch
Versions: v2.8.0
Operating Systems: All platforms running PyTorch
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects systems using torch.linalg.lu functions with specific slice operations. The vulnerability is in the core library and not dependent on specific OS configurations.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete service disruption causing application crashes and unavailability of machine learning inference/prediction services.

🟠

Likely Case

Application instability and crashes when processing specific tensor operations, disrupting machine learning workflows.

🟢

If Mitigated

Minimal impact with proper input validation and error handling in place, though performance degradation may still occur.

🌐 Internet-Facing: MEDIUM - Exploitable if the vulnerable function is exposed through APIs or web services, but requires specific input conditions.
🏢 Internal Only: MEDIUM - Internal data processing pipelines and ML training systems could be disrupted, affecting business operations.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Proof of concept code is available in GitHub issues. Exploitation requires the ability to trigger specific tensor operations but doesn't require authentication to the vulnerable system.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: v2.8.1 or later

Vendor Advisory: https://github.com/pytorch/pytorch/issues/151401

Restart Required: Yes

Instructions:

1. Update PyTorch using pip: pip install --upgrade torch==2.8.1
2. Restart all applications and services using PyTorch
3. Verify the update with: python -c "import torch; print(torch.__version__)"

🔧 Temporary Workarounds

Input validation wrapper

all

Wrap torch.linalg.lu calls with input validation to prevent triggering the vulnerable slice operations

# Python code to wrap vulnerable function
import torch

def safe_lu(input):
    # Add input validation logic here
    if input.dim() > 2:
        raise ValueError("Input validation failed")
    return torch.linalg.lu(input)

Function replacement

all

Replace torch.linalg.lu with alternative decomposition methods where possible

# Consider using torch.linalg.qr or other decomposition methods
# instead of torch.linalg.lu for affected operations

🧯 If You Can't Patch

  • Implement strict input validation and sanitization for all tensor operations
  • Deploy monitoring and alerting for application crashes related to torch.linalg operations

🔍 How to Verify

Check if Vulnerable:

Check PyTorch version: python -c "import torch; print(torch.__version__)" - if output is 2.8.0, system is vulnerable.

Check Version:

python -c "import torch; print(torch.__version__)"

Verify Fix Applied:

After patching, verify version is 2.8.1 or later and test LU decomposition operations with previously problematic inputs.

📡 Detection & Monitoring

Log Indicators:

  • Application crashes with segmentation faults
  • Python tracebacks mentioning torch.linalg.lu
  • Memory allocation errors in system logs

Network Indicators:

  • Sudden drops in API response rates for ML services
  • Increased error rates in ML inference endpoints

SIEM Query:

source="application.logs" AND ("segmentation fault" OR "torch.linalg.lu" OR "memory allocation failed")

🔗 References

📤 Share & Export