Description
DBI versions before 1.652 for Perl allow a heap out-of-bounds write via an unvalidated numeric placeholder that sets the binder counter in preparse.

preparse reserves seven output bytes per input byte, the width of the longest ':p99999' expansion. The ':N' branch parses the number with `atoi(src)` and assigns it to the binder counter with no range check, so a statement containing ':2147483648' leaves the counter negative (-2147483648 with glibc, where atoi wraps). Each following '?' then expands through `sprintf(start, ":p%d", idx++)` to ':p-2147483648', 14 bytes with the terminating NUL where the buffer budgets 7. The placeholder limit added in 1.650 tests the counter against 99,999, which a negative counter passes.

Any caller that preparses an untrusted statement into ':pN' style placeholders gets a heap out-of-bounds write that grows with the number of '?' marks following the poisoned placeholder. The '?' and '%s' return styles compare the parsed number against the expected sequence and error out, and are unaffected.
Published: 2026-08-15
Score: n/a
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The DBI module for Perl contains a flaw that allows an unvalidated numeric placeholder to be parsed as an out‑of‑range number. When a placeholder such as ':2147483648' is encountered, the binder counter is set to a negative value, so subsequent placeholder expansion writes beyond the allocated buffer. This out‑of‑bounds write can corrupt heap memory and, depending on the environment and data, may enable an attacker to execute arbitrary code or cause a denial of service. The type of weakness is a classic buffer overflow (CWE-787) combined with a lack of input validation (CWE-1284).

Affected Systems

Any deployment that uses the Perl DBI library older than version 1.652 is vulnerable. The issue exists in all releases before 1.652, and the 1.650 version only introduced a positive placeholder limit but does not guard against negative counter values. Affected systems include all Perl applications that embed or construct SQL statements through DBI without validating numeric placeholders.

Risk and Exploitability

The exploit requires the attacker to supply a crafted SQL statement containing an oversized numeric placeholder. While application logic limits are usually the first line of defence, the vulnerability remains exploitable if inputs are not properly sanitized. EPSS is not available and the issue is not listed in the CISA KEV catalog, but the lack of range checks and the potential for arbitrary memory corruption make the risk high. No public exploit has been documented, yet the severity of a heap overflow means that the vulnerability should be treated with urgency.

Generated by OpenCVE AI on August 15, 2026 at 15:52 UTC.

Remediation

Vendor Solution

Upgrade to DBI 1.652 or later.


Vendor Workaround

For deployments that cannot be upgraded, limit SQL statements to 99,999 placeholders.


OpenCVE Recommended Actions

  • Upgrade to DBI 1.652 or newer.
  • If upgrading is not possible, configure the application to restrict SQL statements to a maximum of 99,999 placeholders.
  • Validate or sanitize all numeric placeholder values before they are passed to DBI, ensuring they fall within a safe range (e.g., 0–99,999).

Generated by OpenCVE AI on August 15, 2026 at 15:52 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

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 via an unvalidated numeric placeholder that sets the binder counter in preparse. preparse reserves seven output bytes per input byte, the width of the longest ':p99999' expansion. The ':N' branch parses the number with `atoi(src)` and assigns it to the binder counter with no range check, so a statement containing ':2147483648' leaves the counter negative (-2147483648 with glibc, where atoi wraps). Each following '?' then expands through `sprintf(start, ":p%d", idx++)` to ':p-2147483648', 14 bytes with the terminating NUL where the buffer budgets 7. The placeholder limit added in 1.650 tests the counter against 99,999, which a negative counter passes. Any caller that preparses an untrusted statement into ':pN' style placeholders gets a heap out-of-bounds write that grows with the number of '?' marks following the poisoned placeholder. The '?' and '%s' return styles compare the parsed number against the expected sequence and error out, and are unaffected.
Title DBI versions before 1.652 for Perl allow a heap out-of-bounds write via an unvalidated numeric placeholder that sets the binder counter in preparse
Weaknesses CWE-1284
CWE-787
References

Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: CPANSec

Published:

Updated: 2026-08-15T12:09:22.962Z

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

Link: CVE-2026-73194

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

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

Modified: 2026-08-15T13:17:48.433

Link: CVE-2026-73194

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-15T16:00:07Z

Weaknesses
  • CWE-1284

    Improper Validation of Specified Quantity in Input

  • CWE-787

    Out-of-bounds Write