Out-of-Bounds Read Vulnerability in PCRE2 Library

pcre2 Updated 02 Oct 2025

Summary

16/05/2022
N/A
Yes i
Critical
9.1

CVE-2022-1587: An out-of-bounds read vulnerability was discovered in the PCRE2 library in the get_recurse_data_length() function of the pcre2_jit_compile.c file. Affects pcre2 across 2 version ranges.

< 10.36-r1 < 03654e751e7f0700693526b67dfcadda6b42c9d0

Fixed in 10.36-r1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The PCRE2 library is a regular expression library that provides support for pattern matching using regular expressions. It is widely used in various applications and programming languages. This vulnerability, identified as CVE-2022-1587, affects the PCRE2 library and specifically the get_recurse_data_length() function in the pcre2_jit_compile.c file. The vulnerability arises due to recursions in JIT-compiled regular expressions caused by duplicate data transfers.

Vulnerability Detail

The out-of-bounds read vulnerability in the PCRE2 library can be exploited by an attacker to read data outside the bounds of an allocated buffer. This can lead to information disclosure or potential crashes in applications that utilize the PCRE2 library. The vulnerability has a CVSS score of 9.1, indicating a high severity level. It was published on May 16, 2022, and last modified on November 29, 2023.

How To Fix

Minimum fixed version

10.36-r1

This is the first release that contains the fix.

sudo apk add --upgrade pcre2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no specific workaround mentioned for this vulnerability.

Conclusion

The out-of-bounds read vulnerability in the PCRE2 library poses a significant risk to applications utilizing this library. It is crucial to update the library to a fixed version to mitigate the vulnerability. For further support and assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for pcre2 →

Share this vulnerability

FAQ

The vulnerability can potentially allow an attacker to read sensitive data or cause application crashes.

The vulnerability affects versions 0 to 10.36-r1 of the PCRE2 library in the Alpine Linux distributions v3.13 to v3.18.

There is no information available regarding any known exploits for this vulnerability at the moment.

The recommended mitigation is to update the PCRE2 library to a fixed version.

You can find more information about this vulnerability in the CVE-2022-1587 JSON file available at the provided source link.

Related vulnerabilities

Recent vulnerabilities recorded for pcre2.

How To Fix

Minimum fixed version

10.36-r1

This is the first release that contains the fix.

sudo apk add --upgrade pcre2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback