CVE-2022-1587
📋 TL;DR
An out-of-bounds read vulnerability in PCRE2 library's JIT compiler allows reading memory beyond allocated buffers during recursive regular expression processing. This affects any software using PCRE2 library with JIT compilation enabled, potentially leading to information disclosure or application crashes.
💻 Affected Systems
- PCRE2 library
- Software using PCRE2 (nginx, PHP, Apache, various Linux utilities)
📦 What is this software?
Fedora by Fedoraproject
Fedora by Fedoraproject
Ontap Select Deploy Administration Utility by Netapp
View all CVEs affecting Ontap Select Deploy Administration Utility →
Pcre2 by Pcre
Solidfire by Netapp
⚠️ Risk & Real-World Impact
Worst Case
Remote code execution or sensitive information disclosure leading to complete system compromise.
Likely Case
Application crash (denial of service) or limited information disclosure from process memory.
If Mitigated
No impact if JIT compilation is disabled or proper memory protections are in place.
🎯 Exploit Status
Exploitation requires crafting specific regular expressions that trigger the recursion bug.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: PCRE2 10.40 and later
Vendor Advisory: https://github.com/PCRE2Project/pcre2/commit/03654e751e7f0700693526b67dfcadda6b42c9d0
Restart Required: Yes
Instructions:
1. Update PCRE2 library to version 10.40 or later. 2. Recompile any software linked against PCRE2. 3. Restart affected services.
🔧 Temporary Workarounds
Disable JIT compilation
allDisable PCRE2 JIT compilation to prevent exploitation of this vulnerability
For applications: Set PCRE2_NO_JIT=1 environment variable
For nginx: add 'pcre_jit off;' to configuration
For PHP: set 'pcre.jit=0' in php.ini
🧯 If You Can't Patch
- Disable JIT compilation in all applications using PCRE2
- Implement network segmentation to limit exposure of vulnerable systems
🔍 How to Verify
Check if Vulnerable:
Check PCRE2 version: pcre2-config --version or check linked library versions in applications
Check Version:
pcre2-config --version || strings /usr/lib/libpcre2*.so | grep '^PCRE2'
Verify Fix Applied:
Verify PCRE2 version is 10.40 or later and test with known malicious regex patterns
📡 Detection & Monitoring
Log Indicators:
- Application crashes with segmentation faults
- Unusual regex processing patterns in logs
Network Indicators:
- Unusually complex regular expressions in HTTP requests or other inputs
SIEM Query:
source="*" ("segmentation fault" OR "sigsegv") AND process="*pcre*"
🔗 References
- https://bugzilla.redhat.com/show_bug.cgi?id=2077983%2C
- https://github.com/PCRE2Project/pcre2/commit/03654e751e7f0700693526b67dfcadda6b42c9d0
- https://lists.debian.org/debian-lts-announce/2023/03/msg00014.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/DWNG2NS3GINO6LQYUVC4BZLUQPJ3DYHA/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/JXINO3KKI5DICQ45E2FKD6MKVMGJLEKJ/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KAX7767BCUFC7JMDGP7GOQ5GIZCAUGBB/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/M2GLQQUEY5VFM57CFYXVIFOXN2HUZPDM/
- https://security.netapp.com/advisory/ntap-20221028-0009/
- https://bugzilla.redhat.com/show_bug.cgi?id=2077983%2C
- https://github.com/PCRE2Project/pcre2/commit/03654e751e7f0700693526b67dfcadda6b42c9d0
- https://lists.debian.org/debian-lts-announce/2023/03/msg00014.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/DWNG2NS3GINO6LQYUVC4BZLUQPJ3DYHA/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/JXINO3KKI5DICQ45E2FKD6MKVMGJLEKJ/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KAX7767BCUFC7JMDGP7GOQ5GIZCAUGBB/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/M2GLQQUEY5VFM57CFYXVIFOXN2HUZPDM/
- https://security.netapp.com/advisory/ntap-20221028-0009/