CVE-2025-58050 PCRE2: heap-buffer-overflow read in match_ref due to missing boundary restoration in SCS
A heap-buffer-overflow in PCRE2 allows attackers to read out-of-bounds memory, potentially causing information disclosure or crashes.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2025-58050?
CVE-2025-58050 is a medium-severity memory corruption vulnerability in PCRE2Project pcre2, published on 27 Aug 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
The PCRE2 library is a set of C functions that implement regular expression pattern matching. In version 10.45, a heap-buffer-overflow read vulnerability exists in the PCRE2 regular expression matching engine, specifically within the handling of the (*scs:...) (Scan SubString) verb when combined with (*ACCEPT) in src/pcre2_match.c. This vulnerability may potentially lead to information disclosure if the out-of-bounds data read during the memcmp affects the final match result in a way observable by the attacker. This issue has been resolved in version 10.46.
Which versions are affected by CVE-2025-58050?
1 open source package ship an affected version, including pcre2. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
pcre2 PyPI | All versions to 10.45 | None |
Linux distribution packages (5)
pcre2 SUSE:Linux Enterprise Server 16.0 | All versions | 10.45-160000.3.1 |
pcre2 SUSE:Linux Enterprise Server for SAP applications 16.0 | All versions | 10.45-160000.3.1 |
pcre2 SUSE:Linux Micro 6.2 | All versions | 10.45-160000.3.1 |
pcre2 openSUSE:Leap 16.0 | All versions | 10.45-160000.3.1 |
pcre2 openSUSE:Tumbleweed | All versions | 10.46-1.1 |
Products include Pcre Pcre2.
How do I fix CVE-2025-58050?
Upgrade to a fixed version.
Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.
Is CVE-2025-58050 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-58050 exists.
Other vulnerabilities in PCRE2Project pcre2
Sources
Also known as ALPINE-CVE-2025-58050, BELL-CVE-2025-58050, DEBIAN-CVE-2025-58050, GHSA-c2gv-xgf5-5cc2, JLSEC-2026-60, MINI-q86x-4f29-q5jr and 7 more.