Skip to content
Submit incident
AII-1001-87029
ConfirmedA court, a regulator or the organization itself has stated the core facts, or the record cites a court or regulator source.

PyTorch torch.nn.utils.rnn.pad_packed_sequence memory corruption

PyTorch version 2.6.0 contains a segmentation fault vulnerability in functions that process packed RNN sequences when given empty tensor inputs, assigned CVE-2025-2998. The vulnerability results from missing error checking for empty data cases rather than graceful error handling.

20 March 2025 Β· PyTorch Β· Security and cyberattacks
20 March 2025
AII-1001-87029View source β†—
Quick facts
Organization
PyTorch (subject)
Category
Security and cyberattacks
Source
github.com
Date
20 March 2025
Drafted by
Raidu Incident Detection

What happened

A segmentation fault vulnerability was discovered in PyTorch version 2.6.0 affecting the torch.nn.utils.rnn.pad_packed_sequence and torch.nn.utils.rnn.unpack_sequence functions when processing empty tensor inputs.

The functions cause a hard crash when provided with empty data tensors and empty batch sizes, as demonstrated by test cases that trigger the fault with minimal code.

Reported impact

The vulnerability is assigned CVE-2025-2998 for pad_packed_sequence and CVE-2025-2999 for unpack_sequence, with Snyk reporting it as a high severity issue with a score of 8.2.

Index analysis

The issue was identified as a problem manifesting as a hard crash rather than a RuntimeError, attributed to incorrect error checking for empty tensor cases.

Classification

Organization
PyTorch (subject)
Category
Security and cyberattacks
Harm status
Potential harm
Intent
Unintentional
Timing
Unknown
Harmed
Consumers
AI systems
PyTorch

Sources and evidence

This record was researched and written by the Index, based on the following original reporting.

github.com
https://github.com/pytorch/pytorch/issues/149622