CVE-2026-19487
Received Received - Intake

Incorrect Regex Match in Perl

Vulnerability report for CVE-2026-19487, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-08-13

Last updated on: 2026-08-13

Assigner: CPANSec

Description

Perl versions from 5.9.4 before 5.41.9 produce incorrect regular expression match results when a stale failure flag ends the Aho-Corasick prescan early in S_find_byclass. The prescan walks the subject for positions where the full pattern could match, and the engine tries it from the leftmost one recorded. A failing transition sets the failed flag, and a later successful transition does not clear it, so the prescan reads the stale flag as a failure and stops before it can record a candidate that starts earlier. It takes a subject where one candidate is recorded and a later character then forces a fallback through a fail link that succeeds. Example: "ABCDE" =~ m/ABCF|BCDE|C/; # matches C at offset 2, not BCDE "ABCDE" =~ m/ABCF|BCDE|C(G)/; # no match, BCDE missed An alternation like this can miss input it should match, or match it on the wrong branch, so an access or filtering decision made from the result can be wrong.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-08-13
Last Modified
2026-08-13
Generated
2026-08-13
AI Q&A
2026-08-13
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 3 associated CPEs
Vendor Product Version / Range
perl perl to 5.41.9 (exc)
perl perl 5.10
perl perl 5.40.0

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-670 The code contains a control flow path that does not reflect the algorithm that the path is intended to implement, leading to incorrect behavior any time this path is navigated.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability affects Perl's regular expression engine. It causes incorrect matching results when a specific optimization (Aho-Corasick prescan) fails to reset a failure flag properly. This leads to patterns like 'ABCF|BCDE|C' matching incorrectly, such as matching 'C' instead of 'BCDE' in the string 'ABCDE'.

Detection Guidance

This vulnerability is specific to Perl's regex engine and cannot be detected via standard network or system commands. Instead, check your Perl version with 'perl -v' and compare it against versions 5.9.4 to 5.41.9. If affected, test regex patterns like 'ABCDE' =~ m/ABCF|BCDE|C' to see if they produce incorrect matches.

Impact Analysis

If you use Perl versions between 5.9.4 and 5.41.9 for tasks involving regular expressions with alternations, the vulnerability could cause incorrect matches. This might lead to wrong data processing, security bypasses, or incorrect filtering decisions in applications relying on regex patterns.

Compliance Impact

This vulnerability in Perl's regex engine could lead to incorrect data processing or filtering decisions, potentially causing non-compliance with data protection regulations like GDPR or HIPAA if such decisions rely on flawed regex matching. For example, incorrect pattern matching might result in improper handling of personal or sensitive data.

Mitigation Strategies

Upgrade Perl to version 5.41.9 or later to apply the fix. If upgrading is not possible, avoid using regex patterns with alternations that may trigger the bug, such as those with overlapping prefixes or shared suffixes.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-19487. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart