CVE-2022-41409
Description
In pcre2test before version 10.41, a negative repeat value triggers an integer overflow, causing indefinite looping and denial of service.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
In pcre2test before version 10.41, a negative repeat value triggers an integer overflow, causing indefinite looping and denial of service.
Vulnerability
A vulnerability exists in pcre2test (bundled with PCRE2) prior to version 10.41. When processing a subject line containing a negative repeat value (e.g., {-10}), the code at line 6860 in pcre2test.c miscalculates buffer size due to integer overflow, leading to an infinite loop. The issue is triggered by passing a negative number to the repeat quantifier pattern.
Exploitation
An attacker can cause denial of service by providing a crafted input file to pcre2test that includes a negative repeat value. No special privileges or authentication are required; the attack is performed locally by supplying the malformed input file. The tool enters an infinite loop while resizing the dbuffer, resulting in indefinite hang or resource exhaustion.
Impact
Successful exploitation results in a denial of service (DoS) condition: pcre2test hangs indefinitely, consuming CPU and memory. Although the description mentions "other unspecified impacts", no other consequences are documented in the references. The tool is typically used for testing PCRE2 patterns, so the impact is limited to disruption of testing operations.
Mitigation
The vulnerability is fixed in commit 94e1c001761373b7d9450768aa15d04c25547a35, which was included in PCRE2 version 10.41 and later. The fix adds bounds checking: if (i-- <= 0) and reports "Zero or negative repeat not allowed". Users should upgrade to PCRE2 10.41 or later. No workaround is available. The issue is not listed in CISA's Known Exploited Vulnerabilities (KEV).
[1] [2]
AI Insight generated on May 26, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
17- pcre2test/pcre2testdescription
- osv-coords15 versionspkg:rpm/opensuse/pcre2&distro=openSUSE%20Leap%2015.4pkg:rpm/opensuse/pcre2&distro=openSUSE%20Leap%2015.5pkg:rpm/opensuse/pcre2&distro=openSUSE%20Leap%20Micro%205.3pkg:rpm/opensuse/pcre2&distro=openSUSE%20Leap%20Micro%205.4pkg:rpm/suse/pcre2&distro=SUSE%20Linux%20Enterprise%20Micro%205.1pkg:rpm/suse/pcre2&distro=SUSE%20Linux%20Enterprise%20Micro%205.2pkg:rpm/suse/pcre2&distro=SUSE%20Linux%20Enterprise%20Micro%205.3pkg:rpm/suse/pcre2&distro=SUSE%20Linux%20Enterprise%20Micro%205.4pkg:rpm/suse/pcre2&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP4pkg:rpm/suse/pcre2&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP5pkg:rpm/suse/pcre2&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP5pkg:rpm/suse/pcre2&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP5pkg:rpm/suse/pcre2&distro=SUSE%20Linux%20Enterprise%20Software%20Development%20Kit%2012%20SP5pkg:rpm/suse/pcre2&distro=SUSE%20Manager%20Proxy%204.2pkg:rpm/suse/pcre2&distro=SUSE%20Manager%20Server%204.2
< 10.39-150400.4.9.1+ 14 more
- (no CPE)range: < 10.39-150400.4.9.1
- (no CPE)range: < 10.39-150400.4.9.1
- (no CPE)range: < 10.39-150400.4.9.1
- (no CPE)range: < 10.39-150400.4.9.1
- (no CPE)range: < 10.31-150000.3.15.1
- (no CPE)range: < 10.31-150000.3.15.1
- (no CPE)range: < 10.39-150400.4.9.1
- (no CPE)range: < 10.39-150400.4.9.1
- (no CPE)range: < 10.39-150400.4.9.1
- (no CPE)range: < 10.39-150400.4.9.1
- (no CPE)range: < 10.34-1.13.1
- (no CPE)range: < 10.34-1.13.1
- (no CPE)range: < 10.34-1.13.1
- (no CPE)range: < 10.31-150000.3.15.1
- (no CPE)range: < 10.31-150000.3.15.1
Patches
0No patches discovered yet.
Vulnerability mechanics
Root cause
"An integer overflow vulnerability exists in pcre2test when processing negative input for repeat counts."
Attack vector
An attacker can provide a negative number as a repeat count in the subject line of a pcre2test input file. This negative input is not properly diagnosed, leading to an infinite loop within the pcre2test utility. The vulnerability is triggered by crafting specific test cases that include malformed repeat specifiers.
Affected code
The vulnerability is located in the pcre2test utility, specifically within the code that parses and processes repeat counts in test subject lines. The relevant change is in the comparison `if (i-- == 0)` which was modified to `if (i-- <= 0)` to handle negative repeat values [ref_id=1].
What the fix does
The patch modifies the condition that checks for zero repeat counts to also include negative values. Previously, the code `if (i-- == 0)` only checked for zero. The updated condition `if (i-- <= 0)` now correctly identifies and rejects both zero and negative repeat counts, preventing the infinite loop and diagnosing the issue with the message '** Zero or negative repeat not allowed ' [ref_id=1].
Preconditions
- inputThe attacker must be able to control or influence the input provided to the pcre2test utility, specifically the repeat counts within test subject lines.
Generated on Jun 7, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
2News mentions
1- GitLab Security Release: 16.6.1, 16.5.3, 16.4.3GitLab Security Releases · Nov 30, 2023