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 Perlstudychunk.
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.
{
"cwe_ids": [
"CWE-190"
],
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/13xxx/CVE-2026-13221.json",
"cna_assigner": "CPANSec"
}{
"cpe": "cpe:2.3:a:perl:perl:*:*:*:*:*:*:*:*",
"source": [
"CPE_RANGE",
"REFERENCES"
],
"extracted_events": [
{
"introduced": "0"
},
{
"last_affected": "5.43.9"
}
]
}"2026-07-22T03:50:37Z"
[
{
"signature_type": "Line",
"id": "CVE-2026-13221-64dd3400",
"deprecated": false,
"source": "https://github.com/perl/perl5/commit/03f74bbbd3a68350d926ee93d56ee4808c28c4c7",
"signature_version": "v1",
"target": {
"file": "regcomp_study.c"
},
"digest": {
"line_hashes": [
"134675665719538900810772585221767670192",
"162168684666736337369435135427539826229",
"144872332641364083640948895312468990898"
],
"threshold": 0.9
}
},
{
"signature_type": "Function",
"source": "https://github.com/perl/perl5/commit/03f74bbbd3a68350d926ee93d56ee4808c28c4c7",
"deprecated": false,
"target": {
"file": "regcomp_study.c",
"function": "Perl_study_chunk"
},
"id": "CVE-2026-13221-945874b1",
"signature_version": "v1",
"digest": {
"function_hash": "236057087489884812036731213027052221607",
"length": 42988.0
}
}
]
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-13221.json"