AI analysis
Text::CSV_XS before 1.65 can exhaust process memory when it handles an RFC 7111 fragment selector. The fragment() path expands a row= or col= range into one array entry per selected index before it reads any CSV data, and it does not clamp an explicit end column in a cell= selector to the actual row; only range syntax and order are checked. A caller that passes a request-supplied fragment to fragment() or csv() can therefore be forced to allocate a huge array from a tiny input, ending the process with an out-of-memory error that eval cannot catch. Any Perl application using an affected Text::CSV_XS that accepts untrusted fragments is exposed. There is no known public proof of concept and no report of exploitation in the wild.
What to do: Upgrade Text::CSV_XS to version 1.65 or later. Until then, do not pass request-supplied or otherwise untrusted RFC 7111 fragment selectors to fragment() or csv(), and bound process memory so an oversized selector cannot take down the host.
Affected
| H.Merijn Brand Text::CSV_XS | versions before 1.65 |
Estimated exposure
—No basis for an estimate.
Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.
Description
Text::CSV_XS versions before 1.65 for Perl allow memory exhaustion by allocating one entry per index of an RFC 7111 selector in fragment. fragment expands a row= or col= selector into an array with one element per selected index before it reads any data, and it does not clamp an explicit end column in a cell= selector to the row. Only the syntax and order of the ranges are checked, so row=1-400000000 on a two-line file allocates 400 million elements. An application that passes a request-supplied fragment to fragment or csv can be made to exhaust memory, which ends the process with an Out of memory error that eval cannot catch.