Skip to main content
Vulnerability Database/CVE-2026-110755

CVE-2026-110755: Text::CSV_XS for Perl DOS Vulnerability

CVE-2026-110755 is a denial of service flaw in Text::CSV_XS for Perl caused by quadratic CPU usage when processing CR-only line endings. This post covers technical details, affected versions, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-110755 Overview

CVE-2026-110755 affects Text::CSV_XS versions before 1.65 for Perl. The parser exhibits quadratic CPU consumption when processing CSV input that uses CR-only (classic Mac) line endings through the getline method. With the default eol configuration, Perl reads the entire input as a single chunk because line separators are not recognized. The parser then copies the full unparsed remainder into a new buffer after every record, causing total work to scale with the square of input size. A reader with default options spends seconds of CPU time on only a megabyte of input, enabling an algorithmic complexity denial of service [CWE-407].

Critical Impact

A remote attacker can submit crafted CSV data with CR-only line endings to exhaust CPU resources on any application that parses untrusted CSV through Text::CSV_XS with default settings.

Affected Products

  • Text::CSV_XS for Perl, all versions prior to 1.65
  • Perl applications using getline with default eol configuration
  • Downstream distributions and tools that bundle vulnerable Text::CSV_XS releases

Discovery Timeline

  • 2026-10-16 - CVE-2026-110755 published to NVD
  • 2026-10-20 - Last updated in NVD database

Technical Details for CVE-2026-110755

Vulnerability Analysis

The flaw is an algorithmic complexity issue in the XS parser backing Text::CSV_XS. When callers invoke getline without setting the eol option, Perl's I/O layer uses its default line separator (\n). Input that uses only carriage returns (\r) as line terminators therefore arrives at the parser as one monolithic buffer rather than as discrete records.

After extracting each record, the parser saves the unparsed tail in the _AHEAD slot by allocating a new SV and copying the remaining bytes. The next call parses the next record from that copy and then copies the still-remaining tail again. For N records, this produces O(N²) copying work and quadratic CPU scaling.

Root Cause

The root cause lives in CSV_XS.xs, in the branch that persists leftover input between getline invocations. The original code unconditionally executed newSVpvn (csv.bptr + csv.used, csv.size - csv.used) and stored the result under _AHEAD, duplicating the entire remainder on every record boundary. There was no reuse of the already-allocated _AHEAD scalar when the parser owned the sole reference to it.

Attack Vector

Any network-accessible service that accepts CSV uploads or feeds and parses them with Text::CSV_XS default options is reachable. An attacker submits a CSV payload that uses \r as the only line terminator. The server consumes the file through getline, triggering quadratic parsing. Modest payload sizes produce sustained CPU saturation, resulting in service degradation or outage.

text
// Patch excerpt from CSV_XS.xs: Re-use AHEAD with \r instead of copying
     if (csv.useIO) {
 	if (csv.tmp && csv.used < csv.size && csv.has_ahead) {
-	    SV *sv = newSVpvn (csv.bptr + csv.used, csv.size - csv.used);
-	    (void)hv_store  (hv, "_AHEAD", 6, sv, 0);
+	    SV **svp;
+	    if (ahead && SvREFCNT (csv.tmp) == 1
+		      && (svp = hv_fetchs (hv, "_AHEAD", FALSE)) && *svp == csv.tmp)
+		/* The remainder already lives in _AHEAD: drop the parsed
+		 * part in place instead of copying the whole tail again,
+		 * which made CR-only input quadratic */
+		sv_chop (csv.tmp, csv.bptr + csv.used);
+	    else {
+		SV *sv = newSVpvn (csv.bptr + csv.used, csv.size - csv.used);
+		(void)hv_store  (hv, "_AHEAD", 6, sv, 0);
+		}
 	    }

Source: GitHub Commit Patch

Detection Methods for CVE-2026-110755

Indicators of Compromise

  • Sustained single-core CPU saturation in Perl worker processes handling CSV input
  • Request latency spikes correlated with inbound CSV payloads containing \r but no \n bytes
  • Growth of _AHEAD scalar memory in long-lived Perl parsers processing uploaded CSV

Detection Strategies

  • Inventory Perl applications and CPAN dependencies to identify Text::CSV_XS versions below 1.65
  • Inspect HTTP body samples at ingress for CSV content whose line terminators are exclusively \r
  • Add runtime timing instrumentation around Csv::getline call sites and alert on per-record parse time exceeding a baseline threshold

Monitoring Recommendations

  • Monitor process-level CPU time and wall-clock duration for CSV ingestion endpoints
  • Log and alert on upload sizes that produce disproportionate parse durations relative to byte count
  • Track CPAN package versions through configuration management and flag drift from the patched release

How to Mitigate CVE-2026-110755

Immediate Actions Required

  • Upgrade Text::CSV_XS to version 1.65 or later across all Perl environments
  • Identify and prioritize internet-exposed services that parse user-supplied CSV with default options
  • Apply input size limits and request timeouts to CSV ingestion endpoints until patching completes

Patch Information

The fix is included in Text::CSV_XS1.65, released by H.Merijn Brand. The patch modifies the _AHEAD handling in CSV_XS.xs to reuse the existing scalar via sv_chop when the parser owns the sole reference, eliminating the per-record tail copy. See the GitHub Commit Patch and the MetaCPAN Release Changes for details.

Workarounds

  • Explicitly set the eol attribute on the parser so Perl's I/O layer recognizes \r and chunks input into records
  • Normalize line endings in a preprocessing step by converting \r to \n before invoking getline
  • Enforce strict maximum payload sizes and per-request CPU time limits on endpoints that accept CSV
bash
# Upgrade to the fixed release from CPAN
cpanm Text::CSV_XS@1.65

# Verify installed version
perl -MText::CSV_XS -e 'print $Text::CSV_XS::VERSION, "\n"'

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.