CVE-2025-46149: PyTorch: reachable assertion in nn.Fold with inductor
MEDIUMPyTorch deployments using torch.compile() with the inductor backend and nn.Fold operations are vulnerable to a reachable assertion that may expose internal state information. Upgrade to PyTorch 2.7.0 immediately; if upgrading is not feasible short-term, avoid using inductor (torch.compile backend='inductor') in pipelines that include nn.Fold layers. Risk is elevated in externally-facing inference APIs where untrusted inputs can reach compiled model paths.
Risk Assessment
Medium risk with targeted exposure. CVSS 5.3 reflects network-reachable, zero-interaction exploitation with limited confidentiality impact (assertion failure may leak stack traces or internal tensor state). The low attack complexity and no-privilege requirement make this accessible to unsophisticated adversaries targeting public inference endpoints. Impact is bounded to information disclosure rather than full compromise, but in AI production environments, leaked tensor shapes and model internals can aid model extraction or adversarial crafting efforts.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| pytorch | pip | — | No patch |
Do you use pytorch? You're affected.
Severity & Risk
Attack Surface
Recommended Action
5 steps-
Patch: Upgrade PyTorch to >= 2.7.0 (fixes the assertion in inductor codegen).
-
Workaround: Disable inductor for affected model components: torch.compile(model, backend='eager') or torch.compile(model, backend='aot_eager').
-
Detection: Grep model code and dependencies for nn.Fold usage; check torch.__version__ < '2.7.0' in all serving containers.
-
Runtime: Enable structured logging on inference endpoints to capture AssertionError tracebacks before they surface to callers — prevents info leakage while preserving diagnostics.
-
Container hygiene: Rebuild base images with patched PyTorch; pin versions in requirements.txt/pyproject.toml.
CISA SSVC Assessment
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2025-46149?
PyTorch deployments using torch.compile() with the inductor backend and nn.Fold operations are vulnerable to a reachable assertion that may expose internal state information. Upgrade to PyTorch 2.7.0 immediately; if upgrading is not feasible short-term, avoid using inductor (torch.compile backend='inductor') in pipelines that include nn.Fold layers. Risk is elevated in externally-facing inference APIs where untrusted inputs can reach compiled model paths.
Is CVE-2025-46149 actively exploited?
No confirmed active exploitation of CVE-2025-46149 has been reported, but organizations should still patch proactively.
How to fix CVE-2025-46149?
1. Patch: Upgrade PyTorch to >= 2.7.0 (fixes the assertion in inductor codegen). 2. Workaround: Disable inductor for affected model components: torch.compile(model, backend='eager') or torch.compile(model, backend='aot_eager'). 3. Detection: Grep model code and dependencies for nn.Fold usage; check torch.__version__ < '2.7.0' in all serving containers. 4. Runtime: Enable structured logging on inference endpoints to capture AssertionError tracebacks before they surface to callers — prevents info leakage while preserving diagnostics. 5. Container hygiene: Rebuild base images with patched PyTorch; pin versions in requirements.txt/pyproject.toml.
What systems are affected by CVE-2025-46149?
This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, image processing pipelines.
What is the CVSS score for CVE-2025-46149?
CVE-2025-46149 has a CVSS v3.1 base score of 5.3 (MEDIUM). The EPSS exploitation probability is 0.02%.
Technical Details
NVD Description
In PyTorch before 2.7.0, when inductor is used, nn.Fold has an assertion error.
Exploitation Scenario
An adversary probing an externally-facing image segmentation inference API (e.g., a SAM or vision transformer endpoint) sends inputs crafted to trigger the nn.Fold code path under inductor compilation. The reachable assertion fires, and the unhandled exception propagates a stack trace to the API response containing PyTorch version, internal tensor dimensions, and model architecture hints. The adversary uses this information to fingerprint the exact model architecture and PyTorch version, informing subsequent model extraction or adversarial example crafting attempts. No authentication is required; a single malformed request suffices.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N References
Timeline
Related Vulnerabilities
CVE-2024-5452 9.8 pytorch-lightning: RCE via deepdiff Delta deserialization
Same package: torch CVE-2023-43654 9.8 TorchServe: SSRF + RCE via unrestricted model URL loading
Same package: torch CVE-2022-45907 9.8 PyTorch: RCE via unsafe eval in JIT annotations
Same package: torch CVE-2022-0845 9.8 pytorch-lightning: code injection enables full RCE
Same package: torch CVE-2024-35198 9.8 TorchServe: URL bypass enables arbitrary model loading
Same package: torch
AI Threat Alert