CVE-2025-58050PCRE2: heap-buffer-overflow read in match_ref due to missing boundary restoration in SCS
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.
What to do
Fixed builds are available from Alpine, Debian: see the table below for the fixed version per release.
PyPI has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 24.04 | pcre2 | Not affected vulnerable_code_not_present | ||
| Ubuntu 22.04 | pcre2 | Not affected vulnerable_code_not_present | ||
| Debian 14 | pcre2 | Fixed | 10.46-1 | DEBIAN-CVE-2025-58050 |
| Debian 13 | pcre2 | Fixed | 10.46-1~deb13u1 | DEBIAN-CVE-2025-58050 |
| Red Hat Enterprise Linux 10 | mingw32-pcre2 | Not affected | ||
| Red Hat Enterprise Linux 10 | mingw32-pcre2-static | Not affected | ||
| Red Hat Enterprise Linux 10 | mingw64-pcre2 | Not affected | ||
| Red Hat Enterprise Linux 10 | mingw64-pcre2-static | Not affected | ||
| Red Hat Enterprise Linux 10 | pcre2 | Not affected | ||
| Red Hat Enterprise Linux 10 | pcre2-devel | Not affected | ||
| Red Hat Enterprise Linux 10 | pcre2-static | Not affected | ||
| Red Hat Enterprise Linux 10 | pcre2-syntax | Not affected | ||
| Red Hat Enterprise Linux 10 | pcre2-tools | Not affected | ||
| Red Hat Enterprise Linux 10 | pcre2-utf16 | Not affected | ||
| Red Hat Enterprise Linux 10 | pcre2-utf32 | Not affected | ||
| Red Hat Enterprise Linux 9 | mingw32-pcre2 | Not affected | ||
| Red Hat Enterprise Linux 9 | mingw32-pcre2-static | Not affected | ||
| Red Hat Enterprise Linux 9 | mingw64-pcre2 | Not affected | ||
| Red Hat Enterprise Linux 9 | mingw64-pcre2-static | Not affected | ||
| Red Hat Enterprise Linux 9 | pcre2 | Not affected | ||
| Red Hat Enterprise Linux 9 | pcre2-devel | Not affected | ||
| Red Hat Enterprise Linux 9 | pcre2-syntax | Not affected | ||
| Red Hat Enterprise Linux 9 | pcre2-tools | Not affected | ||
| Red Hat Enterprise Linux 9 | pcre2-utf16 | Not affected | ||
| Red Hat Enterprise Linux 9 | pcre2-utf32 | Not affected | ||
| Red Hat Enterprise Linux 8 | pcre2 | Not affected | ||
| Red Hat Enterprise Linux 8 | pcre2-devel | Not affected | ||
| Red Hat Enterprise Linux 8 | pcre2-tools | Not affected | ||
| Red Hat Enterprise Linux 8 | pcre2-utf16 | Not affected | ||
| Red Hat Enterprise Linux 8 | pcre2-utf32 | Not affected | ||
| Red Hat Enterprise Linux 7 | pcre2 | Not affected | ||
| Red Hat Enterprise Linux 7 | pcre2-devel | Not affected | ||
| Red Hat Enterprise Linux 7 | pcre2-static | Not affected | ||
| Red Hat Enterprise Linux 7 | pcre2-tools | Not affected | ||
| Red Hat Enterprise Linux 7 | pcre2-utf16 | Not affected | ||
| Red Hat Enterprise Linux 7 | pcre2-utf32 | Not affected | ||
| Alpine Linux 3.24 | pcre2 | Fixed | 10.46-r0 | ALPINE-CVE-2025-58050 |
| Alpine Linux 3.23 | pcre2 | Fixed | 10.46-r0 | ALPINE-CVE-2025-58050 |
| Alpine Linux 3.22 | pcre2 | Fixed | 10.46-r0 | ALPINE-CVE-2025-58050 |
| PyPI library | pcre2 | Fix pending | PYSEC-2025-259 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- PCRE2Project pcre2: affected: = 10.45
References
- https://github.com/PCRE2Project/pcre2/security/advisories/GHSA-c2gv-xgf5-5cc2
- https://github.com/PCRE2Project/pcre2/commit/a141712e5967d448c7ce13090ab530c8e3d82254
- https://github.com/PCRE2Project/pcre2/releases/tag/pcre2-10.46
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.