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.
Problem types
CWE-825 Expired Pointer Dereference
Product status
Any version before 1.62
Timeline
| 2026-04-25: | Fix committed to public Github repository |
| 2026-04-26: | CVE number reserved |
| 2026-04-29: | Version 1.62 with the fix released to CPAN |
Credits
Leon Timmermans
References
github.com/...c17f31a5f2bf36674748eb4b6e25672f0571a224.patch
metacpan.org/release/HMBRAND/Text-CSV_XS-1.62/changes