cve.bz

CVE-2025-58050 pcre pcre2: Out-of-bounds Write

6.9 mediumExploit referenceEPSS 0.9%Fix available

Medium (6.9) in pcre pcre2. EPSS 0.9% estimated probability of exploitation activity in the next 30 days.

On this page
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.

Severity

CVSS 4.0

6.9 medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:L/SC:L/SI:N/SA:L

CVSS 3.1

9.1 critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
EPSS
0.9% (unchanged from 0.9% a week ago; 0.8% 30 days ago) estimated probability of exploitation activity in the next 30 days; 61st percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: PoC · Automatable: yes · Technical impact: partial, assessed 2025-08-27. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWEs
CWE-787 Out-of-bounds Write
CWE-122 Heap-based Buffer Overflow
CWE-125 Out-of-bounds Read
Published
Modified
NVD analysis
Analyzed
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2025-58050 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2025-58050?via=ask-ai-copy and https://cve.bz/cve/CVE-2025-58050?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2025-58050 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
pcre:pcre210.45

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
PYSEC-2025-259PyPIpcre2<=10.45no fix published

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian13pcre210.46-1~deb13u1DEBIAN-CVE-2025-58050
Debian14pcre210.46-1DEBIAN-CVE-2025-58050
Ubuntu25.04pcre210.45-1ubuntu0.1USN-7777-1
SUSELinux Enterprise Server 16.0, Linux Enterprise Server for SAP applications 16.0pcre210.45-160000.3.1SUSE-SU-2026:21172-1
SUSELinux Micro 6.2pcre210.45-160000.3.1SUSE-SU-2026:21094-1
openSUSELeap 16.0pcre210.45-160000.3.1openSUSE-SU-2026:20512-1
openSUSETumbleweedpcre210.46-1.1openSUSE-SU-2025:15501-1
Alpinev3.22, v3.23, v3.24pcre210.46-r0ALPINE-CVE-2025-58050
Alpaquitastreampcre210.46-r0BELL-CVE-2025-58050
BellSoft Hardened Containersstreampcre210.46-r0BELL-CVE-2025-58050

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; SUSE security data, CC BY 4.0; the Alpine secdb, CC BY-SA 4.0; BellSoft's OSV database, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · SUSE · openSUSE · Alpine · Alpaquita · BellSoft Hardened Containers.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

The bug is in src/pcre2_match.c. When (*scs:...) temporarily restricts the match boundaries to a captured substring, the engine restores the current subject pointer (Feptr) correctly on an immediate (*ACCEPT), but it fails to restore mb->end_subject and mb->true_end_subject. If execution later calls match_ref (for example for a backreference like \2), the bounds check can underflow because mb->end_subject - eptr becomes negative and is cast to an unsigned size. That makes the length check pass incorrectly and memcmp reads past the end of the allocated buffer, causing a heap-buffer-overflow read.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 10mingw-pcre2Not affected
Red Hat Enterprise Linux 10pcre2Not affected
Red Hat Enterprise Linux 7pcre2Not affected
Red Hat Enterprise Linux 8pcre2Not affected
Red Hat Enterprise Linux 9mingw-pcre2Not affected
Red Hat Enterprise Linux 9pcre2Not affected
Red Hat OpenShift Container Platform 4openshift/ose-rhel-coreos-8Not affected
Red Hat OpenShift Container Platform 4openshift/ose-rhel-coreos-9Not affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2025-58050.

Attack patterns (CAPEC)

  • CAPEC-92 Forced Integer Overflow Likelihood: High · Severity: High
  • CAPEC-540 Overread Buffers Likelihood: Low · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON