PyTorch Quantized Sigmoid Module Improper Parameter Restoration Vulnerability

Vulnerability

A vulnerability exists in PyTorch versions 2.6.0+cu124 within the Quantized Sigmoid Module's function nnq_Sigmoid. The issue arises because the quantization parameters, scale and zero_point, are not correctly restored when loading the state dictionary into a new module that has different initial parameters. This improper restoration can lead to the module being in an unexpected state, potentially allowing for integrity-related issues.

Impact

The vulnerability causes quantization parameters to be incorrectly initialized, which can lead to discrepancies in module behavior and output.

Reproduction

To reproduce this vulnerability, create an instance of the nnq_Sigmoid module with specific scale and zero_point parameters. Save the state dictionary of this instance. Then, create a new instance of the module with different scale and zero_point values and load the previously saved state dictionary. The quant_mod_new instance will not have the correct parameters restored, demonstrating the vulnerability.

Added: Jun 9, 2025, 7:46 PM
Updated: Jun 9, 2025, 7:46 PM

Vulnerability Rating

Custom Algorithm
spread
6.6
impact
0.6
exploitability
4.6
remediation
0.0
relevance
0.0
threat
6.4
urgency
2.9
incentive
1.7

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.