String-Compare-ConstantTime Timing Attack Vulnerability in Perl

Vulnerability

A timing attack vulnerability has been identified in the String::Compare::ConstantTime module for Perl, affecting versions through 0.321. This vulnerability allows an attacker to infer the length of a secret string by measuring the time it takes to compare strings of differing lengths. The issue arises because the comparison function, 'equals', returns false immediately when string lengths differ, potentially leaking information about the length of the secret string without revealing its actual content.

Impact

Exploitation of this vulnerability could lead to the unintentional disclosure of the length of secret strings, creating a timing side-channel that could be exploited in conjunction with other information or vulnerabilities.

Reproduction

To reproduce this vulnerability, use the String::Compare::ConstantTime module in a Perl script. Compare a secret string with a user-supplied string of varying lengths using the 'equals' function. The comparison will reveal the length of the secret string through the time taken to evaluate the comparison, creating a timing side-channel attack vector.

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

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
0.6
exploitability
5.7
remediation
0.0
relevance
0.0
threat
4.8
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.