CVE-2019-19012

9.8 CRITICAL

📋 TL;DR

An integer overflow vulnerability in Oniguruma's regexec.c allows attackers to trigger an out-of-bounds read via crafted regular expressions. This affects 32-bit compiled versions of Oniguruma 6.x before 6.9.4_rc2, potentially leading to denial-of-service, information disclosure, or other impacts. Applications using vulnerable Oniguruma libraries for regular expression processing are at risk.

💻 Affected Systems

Products:
  • Oniguruma
  • Software using Oniguruma library (e.g., PHP, Ruby, some text editors)
Versions: 6.x before 6.9.4_rc2
Operating Systems: Any OS with 32-bit compiled Oniguruma
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects 32-bit compiled versions; 64-bit versions are not vulnerable. Applications must process attacker-controlled regular expressions.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete system compromise, though this requires specific memory layout conditions beyond just the out-of-bounds read.

🟠

Likely Case

Denial-of-service through application crashes or information disclosure via memory leaks from the out-of-bounds read.

🟢

If Mitigated

Limited impact if proper input validation and sandboxing prevent malicious regex processing.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: MEDIUM

Exploitation requires crafting specific regular expressions; public proof-of-concept exists in GitHub references.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 6.9.4_rc2 and later

Vendor Advisory: https://github.com/kkos/oniguruma/releases/tag/v6.9.4_rc2

Restart Required: Yes

Instructions:

1. Update Oniguruma to version 6.9.4_rc2 or later. 2. Recompile any applications using Oniguruma with the updated library. 3. Restart affected services.

🔧 Temporary Workarounds

Input Validation for Regex Patterns

all

Validate and sanitize regular expression inputs to prevent malicious patterns from being processed.

Use 64-bit Compilation

all

Compile Oniguruma and dependent applications in 64-bit mode, as the vulnerability only affects 32-bit versions.

🧯 If You Can't Patch

  • Isolate systems using Oniguruma behind firewalls to limit exposure.
  • Implement strict input validation to block crafted regular expressions from reaching vulnerable code.

🔍 How to Verify

Check if Vulnerable:

Check if Oniguruma version is below 6.9.4_rc2 and compiled for 32-bit architecture.

Check Version:

onig-config --version (if installed) or check library files directly.

Verify Fix Applied:

Verify Oniguruma version is 6.9.4_rc2 or later and applications are recompiled with the updated library.

📡 Detection & Monitoring

Log Indicators:

  • Application crashes or abnormal termination logs related to regex processing
  • High memory usage or segmentation faults in logs

Network Indicators:

  • Unusual patterns of regex submissions to applications

SIEM Query:

search for 'segmentation fault' OR 'crash' AND 'regex' OR 'oniguruma' in application logs

🔗 References

📤 Share & Export