REDHAT-BUG-2542559: High severity Perl DBI vulnerability
DBI versions before 1.654 for Perl incorrectly treat numeric values as strings in sqltypecastsvpv.
When casting to SQLNUMERIC, sqltypecastsvpv passes the string pointer and length of the SV to groknumber without stringifying it first. An integer (IV) or floating-point (NV) value has no valid string pointer, so groknumber reads from an invalid address, triggering a segmentation fault.
This is reachable in Perl using the sqltypecast function:
my $num = 42; DBI::sqltypecast( $num, DBI::SQLNUMERIC, 0 );
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Perl DBIto a version that resolves this vulnerability.Fixed in 1.654
Event History
Frequently Asked Questions
What input is required to trigger the crash?
The vulnerable path is reached when Perl code calls DBI::sql_type_cast with SQL_NUMERIC and supplies an integer (IV) or floating-point (NV) value. For example, casting a numeric value such as 42 can cause a segmentation fault because the value is not stringified before grok_number reads it.
What is the practical impact of successful exploitation?
The described impact is a segmentation fault in the Perl process using DBI, resulting in a denial of service for that process.
Which DBI versions are affected?
Perl DBI versions before 1.654 are affected.