torch@2.4.0 vulnerabilities

Tensors and Dynamic neural networks in Python with strong GPU acceleration

Direct Vulnerabilities

Known vulnerabilities in the torch package. This does not include vulnerabilities belonging to this package’s dependencies.

Fix vulnerabilities automatically

Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

Fix for free
VulnerabilityVulnerable Version
  • M
Improper Validation of Syntactic Correctness of Input

torch is a Tensors and Dynamic neural networks in Python with strong GPU acceleration

Affected versions of this package are vulnerable to Improper Validation of Syntactic Correctness of Input in the torch.Tensor.random_() function when a model is compiled with Inductor. An attacker can cause the application to crash or become unresponsive by triggering a syntax error.

How to fix Improper Validation of Syntactic Correctness of Input?

Upgrade torch to version 2.8.0 or higher.

[,2.8.0)
  • M
Improper Handling of Undefined Values

torch is a Tensors and Dynamic neural networks in Python with strong GPU acceleration

Affected versions of this package are vulnerable to Improper Handling of Undefined Values in the torch.cummin component when compiling a model with Inductor. An attacker can cause the application to crash or become unresponsive by submitting a specially crafted model that triggers a name resolution error during compilation.

How to fix Improper Handling of Undefined Values?

Upgrade torch to version 2.8.0 or higher.

[,2.8.0)
  • L
Always-Incorrect Control Flow Implementation

torch is a Tensors and Dynamic neural networks in Python with strong GPU acceleration

Affected versions of this package are vulnerable to Always-Incorrect Control Flow Implementation when compiling model with torch.rot90() and torch.randn_like() functions while backend="aot_eager_decomp_partition". An attacker can cause unexpected behavior or potentially manipulate outputs by crafting inputs that trigger the interaction between these functions.

How to fix Always-Incorrect Control Flow Implementation?

There is no fixed version for torch.

[0,)
  • M
Integer Overflow or Wraparound

torch is a Tensors and Dynamic neural networks in Python with strong GPU acceleration

Affected versions of this package are vulnerable to Integer Overflow or Wraparound via the torch.nan_to_num() function when used with .long() to convert float("inf") in eager mode. An attacker can cause unexpected behavior by providing specially crafted input that triggers an integer overflow.

How to fix Integer Overflow or Wraparound?

There is no fixed version for torch.

[0,)
  • L
Reachable Assertion

torch is a Tensors and Dynamic neural networks in Python with strong GPU acceleration

Affected versions of this package are vulnerable to Reachable Assertion in the torch.linalg.lu() function. In AOTAutograd mode LU decomposition can't accept slice operation and An attacker can cause the application to become unresponsive or crash if backend="aot_eager" by providing specially crafted input.

Note:

The issue is not affecting compilers that are set with backend="eager".

How to fix Reachable Assertion?

There is no fixed version for torch.

[0,)
  • L
Improper Validation of Specified Quantity in Input

torch is a Tensors and Dynamic neural networks in Python with strong GPU acceleration

Affected versions of this package are vulnerable to Improper Validation of Specified Quantity in Input in the ModularIndexing() function when Inductor config is set to constant_and_index_propagation=False. An attacker can cause incorrect computation results by supplying crafted input data.

How to fix Improper Validation of Specified Quantity in Input?

Upgrade torch to version 2.8.0 or higher.

[,2.8.0)
  • L
Stack-based Buffer Overflow

torch is a Tensors and Dynamic neural networks in Python with strong GPU acceleration

Affected versions of this package are vulnerable to Stack-based Buffer Overflow due to a regression in functorch_maml_omniglot() function in TorchBench. An attacker can cause a denial of service by triggering a buffer overflow when a PyTorch model consists of torch.nn.Conv2d, torch.nn.functional.hardshrink, and torch.Tensor.view-torch.mv and is compiled by Inductor.

How to fix Stack-based Buffer Overflow?

Upgrade torch to version 2.8.0 or higher.

[,2.8.0)
  • L
Reachable Assertion

torch is a Tensors and Dynamic neural networks in Python with strong GPU acceleration

Affected versions of this package are vulnerable to Reachable Assertion when the model consists of torch.nn.Conv2d, torch.nn.functional.hardshrink, and torch.Tensor.view-torch.mv() and compiled with Inductor. An attacker can cause the application to become unresponsive or crash by providing specially crafted data.

How to fix Reachable Assertion?

Upgrade torch to version 2.8.0 or higher.

[,2.8.0)
  • M
Mismatched Memory Management Routines

torch is a Tensors and Dynamic neural networks in Python with strong GPU acceleration

Affected versions of this package are vulnerable to Mismatched Memory Management Routines through the torch.cuda.memory.caching_allocator_delete function. An attacker can corrupt memory by manipulating the function locally.

How to fix Mismatched Memory Management Routines?

There is no fixed version for torch.

[0,)
  • M
Out-of-bounds Write

torch is a Tensors and Dynamic neural networks in Python with strong GPU acceleration

Affected versions of this package are vulnerable to Out-of-bounds Write through the torch.jit.jit_module_from_flatbuffer function. An attacker can corrupt memory by manipulating the input data to this function.

How to fix Out-of-bounds Write?

There is no fixed version for torch.

[0,)
  • M
Out-of-bounds Write

torch is a Tensors and Dynamic neural networks in Python with strong GPU acceleration

Affected versions of this package are vulnerable to Out-of-bounds Write when using @torch.jit.script. An attacker can corrupt memory by manipulating the function's input.

Note: This is only exploitable if the attacker has local access to the system.

How to fix Out-of-bounds Write?

There is no fixed version for torch.

[0,)
  • M
Out-of-bounds Write

torch is a Tensors and Dynamic neural networks in Python with strong GPU acceleration

Affected versions of this package are vulnerable to Out-of-bounds Write due to the torch.lstm_cell function. An attacker can corrupt memory by manipulating the function's input.

Note: This is only exploitable if the attacker has local access to the system.

How to fix Out-of-bounds Write?

There is no fixed version for torch.

[0,)
  • M
Buffer Overflow

torch is a Tensors and Dynamic neural networks in Python with strong GPU acceleration

Affected versions of this package are vulnerable to Buffer Overflow due to the unpack_sequence function. An attacker can corrupt memory by manipulating the function's input. This is only exploitable if the attacker has local access to the system.

How to fix Buffer Overflow?

There is no fixed version for torch.

[0,)
  • H
Buffer Overflow

torch is a Tensors and Dynamic neural networks in Python with strong GPU acceleration

Affected versions of this package are vulnerable to Buffer Overflow through the pad_packed_sequence function in nn/utils/rnn.py. An attacker can corrupt memory by manipulating the internal state of the function.

How to fix Buffer Overflow?

There is no fixed version for torch.

[0,)
  • M
Improper Resource Shutdown or Release

torch is a Tensors and Dynamic neural networks in Python with strong GPU acceleration

Affected versions of this package are vulnerable to Improper Resource Shutdown or Release through the torch.cuda.nccl.reduce function in the file torch/cuda/nccl.py. An attacker can cause the application to crash by manipulating the function inputs on a local host.

How to fix Improper Resource Shutdown or Release?

A fix was pushed into the master branch but not yet published.

[0,)
  • C
Deserialization of Untrusted Data

torch is a Tensors and Dynamic neural networks in Python with strong GPU acceleration

Affected versions of this package are vulnerable to Deserialization of Untrusted Data when using the torch.load() function on an untrusted model with weights_only=True, which is documented to be secure. (The documentation does note that "Loading un-trusted checkpoint with weights_only=False MUST never be done.") An attacker can cause the contents of a malicious .tar file to be loaded and executed by forcing the use of the legacy_load() function.

How to fix Deserialization of Untrusted Data?

Upgrade torch to version 2.6.0 or higher.

[,2.6.0)
  • M
Improper Check for Unusual or Exceptional Conditions

torch is a Tensors and Dynamic neural networks in Python with strong GPU acceleration

Affected versions of this package are vulnerable to Improper Check for Unusual or Exceptional Conditions in the ctc_loss() function in LossCTC.cpp, when running on a CUDA system. An attacker can cause the application to crash by passing in input with empty tensors.

How to fix Improper Check for Unusual or Exceptional Conditions?

Upgrade torch to version 2.8.0 or higher.

[,2.8.0)
  • M
Improper Resource Shutdown or Release

torch is a Tensors and Dynamic neural networks in Python with strong GPU acceleration

Affected versions of this package are vulnerable to Improper Resource Shutdown or Release via the torch.mkldnn_max_pool2d function. An attacker can disrupt service by exploiting this vulnerability locally and causing a Floating point exception crash.

How to fix Improper Resource Shutdown or Release?

Upgrade torch to version 2.7.1 or higher.

[,2.7.1)