Use-after-free vulnerability in Oniguruma library (CVE-2019-13224)

libonig Updated 02 Oct 2025

Summary

10/07/2019
N/A
Yes i
Critical
9.8

CVE-2019-13224: A use-after-free in onig_new_deluxe() in regext.c in Oniguruma 6.9.2 allows attackers to potentially cause information disclosure, denial of service, or possibly code execution by providing a crafted regular expression. Affects libonig across 3 version ranges.

< 0f7f61ed1b7b697e283e37bd2d731d0bd57adb55 < 6.9.2-1 >= 0221e9f827632942225586687a33cfd554860d5e, < 481520d3819b0b68b65539ff59b4bd2f018d6e5f

Fixed in 6.9.2-1. 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 Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The Oniguruma library is a regular expression library that provides support for pattern matching using regular expressions. It is commonly used by programming languages like Ruby, PHP, and Rust. The library is responsible for handling regular expressions and can be vulnerable to certain types of attacks.

Vulnerability Detail

The CVE-2019-13224 vulnerability is a use-after-free vulnerability in the Oniguruma library. This vulnerability allows attackers to potentially cause information disclosure, denial of service, or even execute arbitrary code by providing a crafted regular expression. The vulnerability arises when the library handles a pair of a regex pattern and a string with a multi-byte encoding. Attackers can exploit this vulnerability by providing a malicious input that triggers the use-after-free condition in the onig_new_deluxe() function in regext.c. This vulnerability affects Oniguruma versions up to 6.9.2 and can impact applications that use the library, including Ruby, PHP, and Rust applications.

How To Fix

Minimum fixed version

6.9.2-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade libonig

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

Workaround

If updating the library is not immediately feasible, developers can consider implementing input validation and sanitization techniques to mitigate the risk of exploitation. By carefully validating and sanitizing user input before passing it to the Oniguruma library, developers can reduce the likelihood of triggering the use-after-free vulnerability.

Conclusion

The CVE-2019-13224 vulnerability is a use-after-free vulnerability in the Oniguruma library, which can impact applications that use this library, such as Ruby, PHP, and Rust applications. It is crucial to update the library to the fixed version to mitigate the risk of information disclosure, denial of service, or arbitrary code execution. If immediate update is not possible, implementing input validation and sanitization techniques can help reduce the risk. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for libonig →

Share this vulnerability

FAQ

A use-after-free vulnerability occurs when a program continues to use a memory region after it has been freed. This can lead to various security issues, including information disclosure, denial of service, or arbitrary code execution.

This vulnerability affects applications that use the Oniguruma library, including Ruby, PHP, and Rust applications. The impact may vary depending on how the library is utilized within each application.

The potential impact of this vulnerability includes information disclosure, denial of service, or even arbitrary code execution. The severity of the impact may depend on the specific context in which the vulnerable library is used.

You can use the Vulert Playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Simply upload your package-lock.json file and the Vulert Playground will analyze it for any open-source vulnerabilities, including CVE-2019-13224.

You can find more information about this vulnerability, including technical details and the CVE entry, in the vulnerability database provided by Vulert (https://vulert.com).

Related vulnerabilities

Recent vulnerabilities recorded for libonig.

How To Fix

Minimum fixed version

6.9.2-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade libonig

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