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

Summary

CVECVE-2026-80490
StatePUBLISHED
AssignerCPANSec
Source PriorityCVE Program / NVD first with legacy fallback
Published2026-09-30 16:19:10 UTC
Updated2026-09-30 19:57:08 UTC
DescriptionAlgorithm::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.

Risk And Classification

EPSS: 0.002090000 probability, percentile 0.100110000 (date 2026-10-01)

Problem Types: CWE-125 | CWE-125 CWE-125 Out-of-bounds Read

References

ReferenceSourceLinkTags
security.metacpan.org/patches/A/Algorithm-AhoCorasick-XS/0.04/CVE-2026-80490-r1.patch 9b29abf9-4ab0-4765-b253-1875cd9b441e security.metacpan.org
metacpan.org/release/RJH/Algorithm-AhoCorasick-XS-0.04/source/typemap 9b29abf9-4ab0-4765-b253-1875cd9b441e metacpan.org
github.com/richardjharris/Algorithm-AhoCorasick-XS/pull/1 9b29abf9-4ab0-4765-b253-1875cd9b441e github.com
rt.cpan.org/Ticket/Display.html 9b29abf9-4ab0-4765-b253-1875cd9b441e rt.cpan.org
www.openwall.com/lists/oss-security/2026/09/30/15 af854a3a-2127-422b-91ae-364da2661108 www.openwall.com
CVE Program record CVE.ORG www.cve.org canonical
NVD vulnerability detail NVD nvd.nist.gov canonical, analysis

Additional Advisory Data

Workarounds

CNA: No fixed release is available. Apply the patch or the change in the linked pull request. For deployments that cannot apply the patch, ensure that all input passed to the matching functions is stringified, for example $ac->matches( "$input" );

© CVE.report 2026

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

Free CVE JSON API cve.report/api

CVE.report and Source URL Uptime Status status.cve.report