# CVE-2026-80490: Algorithm::AhoCorasick::XS versions through 0.04 for Perl read the haystack string length before the scalar is stringified

- Severity: Medium 4.4 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.12%, higher than 2% of CVEs (2026-12-01)
- Published: 2026-09-30T15:20:45.601Z
- Modified: 2026-11-09T17:17:33.200Z
- Weaknesses: CWE-125
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: CPANSec

## Description

Algorithm::AhoCorasick::XS versions through 0.04 for Perl read the haystack string length before the scalar is stringified.

The matches, first_match and match_details methods use the T_STD_STRING typemap to translate Perl scalars (SVs) into strings via the std::string constructor, using the SvPV macro to stringify the haystack input, and the SvCUR macro to determine the length of the SV.

When the input SVs are references, integers (IVs) or floats (NVs), the SvCUR macro will return an invalid length if it is run before the input is stringified, leading to an out-of-bounds read which can abort the process.

Note that the evaluation order of arguments to std::string is unspecified. Depending on the compiler, SvCUR may be run first and lead to an abort that cannot be caught within Perl.

This can be triggered when the haystack is a numeric value, for example,

    my $ac = Algorithm::AhoCorasick::XS->new( [ "11", "22" ] );
    $ac->matches( 211 );

This can occur when the haystack is the result of reading data from decoded JSON or a numeric database column. It can also be triggered when using a blessed object as a haystack.

(As written by CVE List.)

## Affected

- Algorithm-AhoCorasick-XS: up to 0.04

## References

- <https://rt.cpan.org/Ticket/Display.html?id=181560> (issue-tracking, vendor-advisory)
- <https://metacpan.org/release/RJH/Algorithm-AhoCorasick-XS-0.04/source/typemap#L14>
- <https://github.com/richardjharris/Algorithm-AhoCorasick-XS/pull/1> (issue-tracking)
- <https://security.metacpan.org/patches/A/Algorithm-AhoCorasick-XS/0.04/CVE-2026-80490-r1.patch> (patch)
- <http://www.openwall.com/lists/oss-security/2026/09/30/15>

## Sources

- CVE List: [CVE-2026-80490](https://www.cve.org/CVERecord?id=CVE-2026-80490), CVE Terms of Use, modified 2026-11-09
- NVD: [CVE-2026-80490](https://nvd.nist.gov/vuln/detail/CVE-2026-80490), Public domain, modified 2026-11-09

---

Page: https://cve.day/CVE-2026-80490 · Whole record: https://cve.day/CVE-2026-80490.json · Rebuilt by cve.day 2026-11-25T22:59:41.729Z
