CVE-2026-13221
Perl versions through 5.43.9 produce silently incorrect regular expression matches when an alternation of more than 65535 fixed string branches is compiled into a trie in Perl_study_chunk
Description
Perl versions through 5.43.9 produce silently incorrect regular expression matches when an alternation of more than 65535 fixed string branches is compiled into a trie in Perl_study_chunk. When such branches are combined into a trie, the delta between the first branch and the shared tail is stored in a 16-bit field. A branch count above 65535 overflows the field, and the trie's match decision table is truncated with no warning or error. A pattern of this shape produces false positive matches (matching strings it should not) and false negative matches (failing to match strings it should). When such a pattern gates an access or filtering decision, the result is wrong.
INFO
Published Date :
July 13, 2026, 5:16 p.m.
Last Modified :
July 13, 2026, 8:16 p.m.
Remotely Exploit :
No
Source :
9b29abf9-4ab0-4765-b253-1875cd9b441e
Solution
- Update Perl to a version past 5.43.9.
- Avoid complex regexes with many fixed string branches.
- Implement rigorous testing for regex behavior.
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2026-13221.
| URL | Resource |
|---|---|
| https://github.com/Perl/perl5/commit/03f74bbbd3a68350d926ee93d56ee4808c28c4c7.patch | |
| https://github.com/Perl/perl5/issues/23388 | |
| http://www.openwall.com/lists/oss-security/2026/07/13/5 |
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2026-13221 is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2026-13221
weaknesses.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2026-13221 vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2026-13221 vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
CVE Modified by af854a3a-2127-422b-91ae-364da2661108
Jul. 13, 2026
Action Type Old Value New Value Added Reference http://www.openwall.com/lists/oss-security/2026/07/13/5 -
New CVE Received by 9b29abf9-4ab0-4765-b253-1875cd9b441e
Jul. 13, 2026
Action Type Old Value New Value Added Affected [{'repo': 'https://github.com/Perl/perl5', 'vendor': 'SHAY', 'product': 'perl', 'versions': [{'status': 'affected', 'version': '0', 'versionType': 'custom', 'lessThanOrEqual': '5.43.9'}], 'packageName': 'perl', 'programFiles': ['regcomp_study.c'], 'collectionURL': 'https://cpan.org/modules', 'defaultStatus': 'unaffected', 'programRoutines': [{'name': 'Perl_study_chunk'}]}] Added Description Perl versions through 5.43.9 produce silently incorrect regular expression matches when an alternation of more than 65535 fixed string branches is compiled into a trie in Perl_study_chunk. When such branches are combined into a trie, the delta between the first branch and the shared tail is stored in a 16-bit field. A branch count above 65535 overflows the field, and the trie's match decision table is truncated with no warning or error. A pattern of this shape produces false positive matches (matching strings it should not) and false negative matches (failing to match strings it should). When such a pattern gates an access or filtering decision, the result is wrong. Added CWE CWE-190 Added Reference https://github.com/Perl/perl5/commit/03f74bbbd3a68350d926ee93d56ee4808c28c4c7.patch Added Reference https://github.com/Perl/perl5/issues/23388