# CVE-2025-58050: PCRE2: heap-buffer-overflow read in match_ref due to missing boundary restoration in SCS

- Severity: Medium 6.9 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.98%, higher than 63% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2025-08-27T18:47:35.041Z
- Modified: 2026-07-13T07:15:39.720Z
- Also known as: PYSEC-2025-259, GHSA-c2gv-xgf5-5cc2
- Weaknesses: CWE-122, CWE-125, CWE-787
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- PCRE2Project pcre2: = 10.45
- pcre pcre2: 10.45
- pcre2 (PyPI): up to 10.45

## Every score

- GitHub_M: 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`
- NVD: 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`
- PyPA Advisory Database: 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`

## References

- <https://github.com/PCRE2Project/pcre2/security/advisories/GHSA-c2gv-xgf5-5cc2> (exploit, evidence, vendor-advisory)
- <https://github.com/PCRE2Project/pcre2/commit/a141712e5967d448c7ce13090ab530c8e3d82254> (fix, patch)
- <https://github.com/PCRE2Project/pcre2/releases/tag/pcre2-10.46> (advisory, release-notes)

## Sources

- CVE List: [CVE-2025-58050](https://www.cve.org/CVERecord?id=CVE-2025-58050), CVE Terms of Use, modified 2025-08-27
- NVD: [CVE-2025-58050](https://nvd.nist.gov/vuln/detail/CVE-2025-58050), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2025-259](https://osv.dev/vulnerability/PYSEC-2025-259), CC-BY-4.0, modified 2026-07-13

---

Page: https://cve.day/CVE-2025-58050 · Whole record: https://cve.day/CVE-2025-58050.json · Rebuilt by cve.day 2026-11-25T22:59:03.770Z
