CVE-2024-36736
📋 TL;DR
CVE-2024-36736 is a critical vulnerability in OneFlow's permute component that causes incorrect calculations when performing same-dimension operations. This could lead to memory corruption, data integrity issues, or potential remote code execution. Users of OneFlow v0.9.1 for machine learning and tensor operations are affected.
💻 Affected Systems
- OneFlow-Inc. Oneflow
📦 What is this software?
Oneflow by Oneflow
⚠️ Risk & Real-World Impact
Worst Case
Remote code execution leading to complete system compromise, data exfiltration, or service disruption
Likely Case
Application crashes, incorrect tensor calculations leading to model corruption or incorrect outputs
If Mitigated
Limited to denial of service or data corruption within the affected application
🎯 Exploit Status
Proof of concept available in GitHub gist references; exploitation appears straightforward for attackers with access to vulnerable code
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: v0.9.2 or later
Vendor Advisory: https://github.com/Oneflow-Inc/oneflow
Restart Required: Yes
Instructions:
1. Check current OneFlow version: pip show oneflow
2. Upgrade to latest version: pip install --upgrade oneflow
3. Restart all services using OneFlow
4. Verify upgrade: python -c "import oneflow; print(oneflow.__version__)"
🔧 Temporary Workarounds
Disable permute operations
allAvoid using oneflow.permute with same-dimension operations in production code
# Modify code to avoid: tensor.permute([0,1,1,2]) or similar same-dimension operations
Input validation wrapper
allAdd validation to check for same-dimension permute operations before execution
def safe_permute(tensor, dims):
if len(set(dims)) != len(dims):
raise ValueError('Same-dimension permute operations are disabled due to CVE-2024-36736')
return tensor.permute(dims)
🧯 If You Can't Patch
- Isolate OneFlow applications in containers or VMs with strict network controls
- Implement application-level monitoring for abnormal tensor operations or crashes
🔍 How to Verify
Check if Vulnerable:
Check if using OneFlow v0.9.1: python -c "import oneflow; print('VULNERABLE' if oneflow.__version__ == '0.9.1' else 'SAFE')"
Check Version:
pip show oneflow | grep Version
Verify Fix Applied:
Verify version is v0.9.2 or later: python -c "import oneflow; print(oneflow.__version__)"
📡 Detection & Monitoring
Log Indicators:
- Application crashes with OneFlow permute operations
- Memory access violation errors in logs
- Unexpected tensor calculation failures
Network Indicators:
- Unusual outbound connections from OneFlow processes
- Traffic patterns suggesting data exfiltration
SIEM Query:
source="*oneflow*" AND (error OR crash OR exception) AND permute