AI analysis
Text::CSV_XS for Perl, in versions from 1.46 before 1.65, has a use-after-free (CWE-416) of variables bound with bind_columns when getline skips an empty line. With bind_columns, the parser writes each field into the caller’s own scalar without taking a reference; if skip_empty_rows skips an empty last line, or eof mode skips any empty line, it frees that field scalar without checking whether it is bound and drops a reference the application still holds. Later use of the bound variable then reads freed memory and can crash the process. Applications that parse CSV with this module using bind_columns plus skip_empty_rows or eof mode are affected. No public proof-of-concept is known, the issue is not in CISA KEV, and CVSS has not been scored.
What to do: Upgrade Text::CSV_XS to version 1.65 or later. Until then, do not use bind_columns together with skip_empty_rows or eof mode, especially when parsing untrusted CSV, and watch Perl processes that already use that combination for unexpected crashes.
Affected
| Text::CSV_XS project Text::CSV_XS | 1.46 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 from 1.46 before 1.65 for Perl have a use-after-free of bind_columns variables when skip_empty_rows skips an empty line in getline. With bind_columns, the parser writes each field into the caller's own scalar without taking a reference to it. When skip_empty_rows skips an empty last line, the parser frees the current field scalar without checking whether it is bound, dropping one reference from the application's variable. The "eof" mode does the same on any empty line. The variable is then freed while the application still references it, so later code uses freed memory and can crash the process.