Skip to main content

Perl CVE-2026-13221

CRITICAL
Integer Overflow or Wraparound (CWE-190)
2026-07-13 CPANSec
Critical
Disputed · 9.1 NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Application builds regex with >65535 fixed-string branches
  2. Delivery
    Trie batching overflows 16-bit delta field
  3. Exploit
    Match-decision table silently truncated
  4. Execution
    Filter/access check returns wrong verdict
  5. Impact
    Attacker input bypasses security control

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Integer overflow checks
MITRE ATT&CK

1 technique across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires a Perl program that compiles a single regular expression whose alternation contains more than 65,535 fixed-string branches (the exact overflow threshold of the 16-bit delta field in Perl_study_chunk), and that uses the resulting match to gate an access, authorization, or filtering decision. The condition is concrete: the branches must be fixed strings eligible for trie optimization, and the span between the first branch and the shared tail must reach U16_MAX. Limiting factors that sharply reduce real-world exposure: such enormous alternations are almost never authored manually and typically arise only from machine-generated patterns over very large data sets; the security impact only materializes when the pattern's match result controls a trust decision; and it affects only Perl builds at or below 5.43.9. Where an application never builds regexes of this scale, the flaw is not reachable.

Impact

The published CVSS 3.1 vector (9.1, AV:N/AC:L/PR:N/UI:N/C:N/I:H/A:H) reads as a critical, trivially remote issue, but the signals conflict and should be treated with caution. The real-world trigger is highly specific: a program must compile a single regex containing more than 65,535 fixed-string branches - an extreme pattern almost never written by hand and usually only produced by machine-generated alternations built from large data sets. That makes AC:L and the network vector optimistic; realistically an attacker needs the target application to construct such a pattern and to use it for a security decision, which is why I assess AC:H. The A:H (availability) rating is also questionable: the described impact is wrong match results (an integrity problem), not a crash or resource exhaustion, so availability impact appears overstated in the input - verify with vendor. No EPSS score was provided and the CVE is not in CISA KEV; there is no evidence of active exploitation. Net assessment: a genuine correctness/integrity defect that is dangerous in the narrow set of deployments that build gigantic regex filters, but not a broad drive-by remote-code-execution priority despite the 9.1 headline.

Exploit ScenarioDerived

An application builds a large deny/allow regex by joining tens of thousands of fixed strings (for example a WAF-style blocklist or an input allowlist) and uses it to decide whether a request is permitted. Because the compiled trie is silently truncated past 65,535 branches, the pattern lets through inputs it should block (false negative) or rejects legitimate inputs (false positive), enabling an attacker to bypass the filter with a string that the corrupted table mis-classifies. The fixing commit includes a deterministic reproducer test, but no weaponized exploit was identified in the source data.

Act Now Prioritize within 24-48h. Why: CRITICAL severity + public POC available.
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 14, 2026

Silently incorrect regular-expression matching in the Perl interpreter (all versions through 5.43.9) lets an oversized alternation of more than 65,535 fixed-string branches overflow a 16-bit delta field when the branches are optimized into a trie, truncating the match-decision table. The result is both false-positive and false-negative matches, so any Perl program that uses such a pattern to gate access or filter input can make wrong security decisions. There is no public exploit identified at time of analysis, though the fixing commit ships a deterministic reproducer test, and the flaw is not listed in CISA KEV.

RemediationAI

Upstream fix available (PR/commit); released patched version not independently confirmed - apply the official commit 03f74bbbd3a68350d926ee93d56ee4808c28c4c7 (https://github.com/Perl/perl5/commit/03f74bbbd3a68350d926ee93d56ee4808c28c4c7.patch), or upgrade to the first Perl 5.44 release that includes it once your distribution ships it. Until a packaged build is available, the most effective compensating control is to avoid constructing regexes with alternations approaching 65,535 branches for any access-control or filtering decision: cap the number of alternatives, or replace a giant fixed-string alternation with a hash/set membership test (e.g. exists $set{$x}) or a trie built in application code, which sidesteps the compiler path entirely and is typically faster with no correctness risk. If you must keep such patterns, split them into multiple smaller regexes each well under the 65,535-branch limit and combine the boolean results, accepting the added code complexity. Track vendor advisories at https://github.com/Perl/perl5/issues/23388 and https://seclists.org/oss-sec/2026/q3/126 for the tagged release.

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The bug lives in Perl's regex compiler optimization stage, specifically Perl_study_chunk() in regcomp_study.c, which batches long chains of fixed-string alternation branches (a|b|c|...) into a trie for fast matching. During this batching the compiler stores the delta between the first branch (startbranch) and the shared tail in a 16-bit field; when tail - startbranch reaches U16_MAX the value wraps, and the trie's decision table is built from the truncated offset with no warning or error. This is a classic CWE-190 integer overflow (the vendor tags also flag it as a buffer/integer overflow). The affected component is the core Perl language runtime itself (CPE cpe:2.3:a:shay:perl), not a specific CPAN module, so the defect is present wherever the vulnerable Perl versions are installed. The upstream fix (commit 03f74bbbd3a6) simply skips trie-batching any branch set whose span would exceed U16_MAX, leaving those branches as an ordinary (correct but slower) alternation.

Know when Perl gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Sources disagree (Medium–Critical)
NVD PRIMARY 9.1 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
vuln.today AI 5.9 MEDIUM

Impact is silently wrong matches corrupting access/filter decisions, so integrity-only (I:H, C:N/A:N); the required 65,535+ fixed-string alternation is an unusual precondition, hence AC:H.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
4.0 AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
SUSE 7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Red Hat 5.9 MEDIUM

vuln.today treats the vendor’s rating as authoritative. A higher third-party CVSS (e.g. CISA-ADP) is shown for transparency but does not drive the headline severity.

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
High

Lifecycle Timeline

3
CVSS changed
Jul 14, 2026 - 14:22 NVD
9.1 (CRITICAL)
CVE Published
Jul 13, 2026 - 15:40 cve.org
UNKNOWN (no severity yet)
CVE Published
Jul 13, 2026 - 15:40 cve.org
CRITICAL 9.1

DescriptionNVD

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.

Executive ViewAI

Why It Matters

A critical regex-matching flaw in Perl interpreter (CVSS 9.1) breaks the security logic of any Perl application using large alternation patterns for access control or input validation, causing both false-positive rejections and false-negative security bypasses. Organizations with Perl-based authentication, API gateway logic, or input-filtering services face immediate risk of unauthorized access and service instability. All affected systems require vendor patch deployment within 30 days.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.2%
Top 89% exploitable
Prevalence
High
Perl interpreter ships with most Unix/Linux systems and many toolchains
Exploit
POC
Public exploit code exists
Social Media
2
Sightings
Data Quality
7 sources
Confidence: High
NVD CVE.org EPSS Vulnrichment MSRC Vendor CIRCL GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC Yes
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity + public POC available
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Partial

Priority Score

66
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +46
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.

Integer overflow occurs when an arithmetic operation produces a result that exceeds the maximum value a given integer type can store.

Affected Products (CPE)NVD

cpe:2.3:a:shay:perl:*:*:*:*:*:*:*:*

More in Perl

View all
CVE-2012-6329 HIGH POC
7.5 Jan 04

The _compile function in Maketext.pm in the Locale::Maketext implementation in Perl before 5.17.7 does not properly hand

CVE-2017-12814 CRITICAL POC
9.8 Sep 28

Stack-based buffer overflow in the CPerlHost::Add method in win32/perlhost.h in Perl before 5.24.3-RC1 and 5.26.x before

CVE-2015-8608 CRITICAL POC
9.8 Feb 07

The VDir::MapPathA and VDir::MapPathW functions in Perl 5.22 allow remote attackers to cause a denial of service (out-of

CVE-2018-18314 CRITICAL POC
9.8 Dec 07

Perl before 5.26.3 has a buffer overflow via a crafted regular expression that triggers invalid write operations. Rated

CVE-2018-18312 CRITICAL POC
9.8 Dec 05

Perl before 5.26.3 and 5.28.0 before 5.28.1 has a buffer overflow via a crafted regular expression that triggers invalid

CVE-2018-18313 CRITICAL POC
9.1 Dec 07

Perl before 5.26.3 has a buffer over-read via a crafted regular expression that triggers disclosure of sensitive informa

CVE-2016-2381 HIGH
7.5 Apr 08

Perl might allow context-dependent attackers to bypass the taint protection mechanism in a child process via duplicate e

CVE-2023-31484 HIGH POC
8.1 Apr 29

CPAN.pm before 2.35 does not verify TLS certificates when downloading distributions over HTTPS. Rated high severity (CVS

CVE-2016-6185 HIGH POC
7.8 Aug 02

The XSLoader::load method in XSLoader in Perl does not properly locate .so files when called in a string eval, which mig

CVE-2018-12015 HIGH POC
7.5 Jun 07

In Perl through 5.26.2, the Archive::Tar module allows remote attackers to bypass a directory-traversal protection mecha

CVE-2020-10543 HIGH
8.2 Jun 05

Perl before 5.30.3 on 32-bit platforms allows a heap-based buffer overflow because nested regular expression quantifiers

CVE-2015-8853 HIGH
7.5 May 25

The (1) S_reghop3, (2) S_reghop4, and (3) S_reghopmaybe3 functions in regexec.c in Perl before 5.24.0 allow context-depe

Vendor StatusVendor

SUSE

Severity: Important
Product Status
SUSE Linux Micro 6.2 Affected
SLES15-SP5-CHOST-BYOS-SAP-CCloud Not-Affected
SLES15-SP6-CHOST-BYOS Not-Affected
SLES15-SP6-CHOST-BYOS-Aliyun Not-Affected
SLES15-SP6-CHOST-BYOS-Azure Not-Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy