Description
DBI versions before 1.652 for Perl allow a heap out-of-bounds write on 32-bit perl via an integer wraparound in the output buffer size computed by preparse.

preparse reserves its output buffer with `newSV(strlen(statement) * 7 + 16)`, budgeting seven output bytes per input byte for the longest ':p99999' expansion. The product is computed in STRLEN, which is 32 bits wide on a 32-bit perl build, so a statement of 613,566,757 bytes multiplies to 4,294,967,299, wraps modulo 2^32 to 3, and reserves 19 bytes. The parser then copies the statement out through a raw pointer with no capacity check, writing the whole 585 MB input past the end of the allocation. The 99,999 placeholder limit does not bound this path, which is reached by ordinary non-placeholder content.

Any caller that passes an untrusted statement of that length to preparse on a 32-bit perl gets a heap out-of-bounds write of attacker controlled bytes. Builds with a 64-bit STRLEN are not affected, since the wrap there needs a statement of about 2.3 exabytes.
Published: 2026-08-15
Score: 9.8 Critical
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

DBI versions prior to 1.652 on 32‑bit Perl compute the preparse output buffer size with a 32‑bit integer, allowing a wraparound on a statement of 613,566,757 bytes. This results in a buffer allocated only 19 bytes in size yet a 585 MB string is copied into it, overwriting heap memory with attacker controlled data. The vulnerability arises from an integer overflow (CWE‑190) followed by an out‑of‑bounds write (CWE‑787). If an attacker can supply such a large statement to preparse, the overflow can corrupt heap structures or inject malicious payloads, leading to loss of integrity or arbitrary code execution.

Affected Systems

The flaw affects Perl DBI module versions earlier than 1.652 running on 32‑bit Perl interpreters. Operations that accept untrusted SQL statements on such builds are vulnerable; 64‑bit Perl builds are not impacted because the 32‑bit STRLEN wraparound does not occur.

Risk and Exploitability

The flaw is limited to 32‑bit Perl builds; 64‑bit builds would require an impractically large statement to trigger the wraparound. The vulnerability carries a CVSS score of 9.8, indicating critical severity. The EPSS score is below 1% (approximately 0.00199), indicating a low current exploitation probability, and the vulnerability is not listed in CISA KEV. Nonetheless, the high potential for code execution remains, and a single oversized SQL command can trigger the issue wherever untrusted SQL is processed.

Generated by OpenCVE AI on August 18, 2026 at 00:50 UTC.

Remediation

Vendor Solution

Upgrade to DBI 1.652 or later.


Vendor Workaround

On 32-bit depoyments that cannot be upgraded, limit the size of SQL statements under 292 megabytes.


OpenCVE Recommended Actions

  • Upgrade the Perl DBI module to version 1.652 or later
  • On 32‑bit deployments that cannot be upgraded, enforce a maximum SQL statement size of less than 292 MB
  • Validate and limit input SQL lengths before passing them to preparse
  • Consider switching to a 64‑bit Perl interpreter to eliminate the 32‑bit integer wraparound

Generated by OpenCVE AI on August 18, 2026 at 00:50 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Debian DLA Debian DLA DLA-4764-1 libdbi-perl security update
Debian DSA Debian DSA DSA-6473-1 libdbi-perl security update
History

Tue, 25 Aug 2026 12:15:00 +0000

Type Values Removed Values Added
References
Metrics threat_severity

None

threat_severity

Important


Mon, 17 Aug 2026 21:30:00 +0000

Type Values Removed Values Added
Metrics cvssV3_1

{'score': 9.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'}

ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Mon, 17 Aug 2026 11:30:00 +0000

Type Values Removed Values Added
First Time appeared Perl5-dbi
Perl5-dbi dbi
Vendors & Products Perl5-dbi
Perl5-dbi dbi

Sat, 15 Aug 2026 12:30:00 +0000

Type Values Removed Values Added
Description DBI versions before 1.652 for Perl allow a heap out-of-bounds write on 32-bit perl via an integer wraparound in the output buffer size computed by preparse. preparse reserves its output buffer with `newSV(strlen(statement) * 7 + 16)`, budgeting seven output bytes per input byte for the longest ':p99999' expansion. The product is computed in STRLEN, which is 32 bits wide on a 32-bit perl build, so a statement of 613,566,757 bytes multiplies to 4,294,967,299, wraps modulo 2^32 to 3, and reserves 19 bytes. The parser then copies the statement out through a raw pointer with no capacity check, writing the whole 585 MB input past the end of the allocation. The 99,999 placeholder limit does not bound this path, which is reached by ordinary non-placeholder content. Any caller that passes an untrusted statement of that length to preparse on a 32-bit perl gets a heap out-of-bounds write of attacker controlled bytes. Builds with a 64-bit STRLEN are not affected, since the wrap there needs a statement of about 2.3 exabytes.
Title DBI versions before 1.652 for Perl allow a heap out-of-bounds write on 32-bit perl via an integer wraparound in the output buffer size computed by preparse
Weaknesses CWE-190
CWE-787
References

cve-icon MITRE

Status: PUBLISHED

Assigner: CPANSec

Published:

Updated: 2026-08-17T20:31:48.261Z

Reserved: 2026-08-11T11:58:19.137Z

Link: CVE-2026-73193

cve-icon Vulnrichment

Updated: 2026-08-17T20:31:39.603Z

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-08-15T13:17:48.327

Modified: 2026-08-28T15:42:20.060

Link: CVE-2026-73193

cve-icon Redhat

Severity : Important

Publid Date: 2026-08-15T12:09:03Z

Links: CVE-2026-73193 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-08-18T01:00:05Z

Weaknesses