CVE-2025-58050

9.1 CRITICAL

📋 TL;DR

A heap-buffer-overflow read vulnerability in PCRE2 library version 10.45 allows attackers to read out-of-bounds memory when processing specific regular expression patterns containing (*scs:...) and (*ACCEPT) verbs. This could lead to information disclosure if the memory read affects match results observable to attackers. Any software using PCRE2 10.45 is affected.

💻 Affected Systems

Products:
  • PCRE2 library
  • Software using PCRE2 10.45 (e.g., PHP, Apache, Nginx, various parsers)
Versions: PCRE2 version 10.45 only
Operating Systems: All platforms where PCRE2 10.45 is installed
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability triggers only when processing specific regex patterns with (*scs:...) and (*ACCEPT) verbs.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Sensitive memory contents (passwords, keys, session data) could be disclosed to attackers through carefully crafted regular expressions.

🟠

Likely Case

Information disclosure of adjacent heap memory, potentially revealing application state or sensitive data fragments.

🟢

If Mitigated

Limited impact if memory protections (ASLR, heap canaries) are effective, but information leakage still possible.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: MEDIUM

Exploitation requires crafting specific regex patterns and understanding target application's regex usage.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 10.46

Vendor Advisory: https://github.com/PCRE2Project/pcre2/security/advisories/GHSA-c2gv-xgf5-5cc2

Restart Required: Yes

Instructions:

1. Download PCRE2 10.46 from official repository. 2. Compile and install following standard build procedures. 3. Recompile any applications linking against PCRE2. 4. Restart affected services.

🔧 Temporary Workarounds

Input Validation

all

Sanitize or reject regex patterns containing (*scs:...) and (*ACCEPT) verbs before processing.

🧯 If You Can't Patch

  • Implement WAF rules to block regex patterns containing (*scs:...) and (*ACCEPT) verbs
  • Isolate vulnerable systems from untrusted networks and limit regex processing to trusted inputs only

🔍 How to Verify

Check if Vulnerable:

Check PCRE2 version: pcre2-config --version or check library files for version 10.45

Check Version:

pcre2-config --version || strings /usr/lib*/libpcre2*.so | grep '^PCRE2_VERSION'

Verify Fix Applied:

Verify version is 10.46 or higher using pcre2-config --version

📡 Detection & Monitoring

Log Indicators:

  • Application crashes or abnormal termination when processing regex patterns
  • Memory access violation errors in application logs

Network Indicators:

  • Unusual regex patterns in input data
  • Repeated regex processing attempts with similar patterns

SIEM Query:

source="application.logs" AND ("segmentation fault" OR "heap overflow" OR "memory violation") AND process="*pcre*"

🔗 References

📤 Share & Export