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

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 4.4
- **CVSS:** 4.4 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:L`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: Low; Integrity impact: None; Availability impact: Low
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.16% (percentile 2, 2026-11-26)
- **CWE:** CWE-125
- **Published:** 2026-09-30T15:20:45.601Z
- **Modified:** 2026-11-09T17:17:33.200Z

## Who should check

- Anyone running Algorithm-AhoCorasick-XS \<= 0.04

## 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.

## Affected and fixed versions

- Algorithm-AhoCorasick-XS: \<= 0.04 (cvelist)

## Mitigation

- Vendor workaround: 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" );

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-80490. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-80490.md
Affected: Algorithm-AhoCorasick-XS <= 0.04
Fixed in: no fixed version listed yet

Steps:
1. Search this machine and project for Algorithm-AhoCorasick-XS: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-80490 being exploited?

There is no confirmed exploitation: CVE-2026-80490 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.16% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-80490?

Medium: CVSS 4.4 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2026-80490?

Algorithm-AhoCorasick-XS \<= 0.04.

### Is there a fix for CVE-2026-80490?

No fixed version is listed in the sources yet. Vendor workaround: 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" );

### How do I check if I'm affected by CVE-2026-80490?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

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

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-80490>

HTML: <https://flawdb.com/CVE-2026-80490> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-80490>
