CVE-2019-13225
Description
A NULL pointer dereference in Oniguruma 6.9.2's regexec.c allows denial of service via a crafted regular expression.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A NULL pointer dereference in Oniguruma 6.9.2's regexec.c allows denial of service via a crafted regular expression.
Vulnerability
A NULL pointer dereference vulnerability exists in the match_at() function in regexec.c of Oniguruma version 6.9.2. The flaw occurs during the compilation of if-then-else patterns in regular expressions, where the code path fails to properly handle a NULL Else branch, leading to a crash. This library is widely used as a dependency in Ruby, PHP, and Rust, making the vulnerability reachable in many applications.
Exploitation
An attacker can trigger the vulnerability by supplying a specially crafted regular expression that includes an if-then-else construct without an Else branch. No authentication or special privileges are required; the attack can be performed remotely if the application processes user-supplied regex patterns. The NULL pointer dereference occurs during the compilation phase, before any matching is attempted.
Impact
Successful exploitation results in a denial of service (DoS) condition, causing the application to crash. The vulnerability does not lead to arbitrary code execution or information disclosure based on the available references. The impact is limited to availability, affecting any service or application that uses Oniguruma to compile untrusted regular expressions.
Mitigation
The issue was fixed in commit c509265 [1] and released in Oniguruma version 6.9.3. Users should upgrade to version 6.9.3 or later. The Gentoo security advisory (GLSA 201911-03) [4] recommends upgrading to >=dev-libs/oniguruma-6.9.3. No workaround is available for unpatched versions.
AI Insight generated on May 26, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
51- Oniguruma/Onigurumadescription
- Range: = 6.9.2
- osv-coords49 versionspkg:rpm/almalinux/apcu-panelpkg:rpm/almalinux/libzippkg:rpm/almalinux/libzip-develpkg:rpm/almalinux/libzip-toolspkg:rpm/almalinux/onigurumapkg:rpm/almalinux/oniguruma-develpkg:rpm/almalinux/phppkg:rpm/almalinux/php-bcmathpkg:rpm/almalinux/php-clipkg:rpm/almalinux/php-commonpkg:rpm/almalinux/php-dbapkg:rpm/almalinux/php-dbgpkg:rpm/almalinux/php-develpkg:rpm/almalinux/php-embeddedpkg:rpm/almalinux/php-enchantpkg:rpm/almalinux/php-fpmpkg:rpm/almalinux/php-gdpkg:rpm/almalinux/php-gmppkg:rpm/almalinux/php-intlpkg:rpm/almalinux/php-jsonpkg:rpm/almalinux/php-ldappkg:rpm/almalinux/php-mbstringpkg:rpm/almalinux/php-mysqlndpkg:rpm/almalinux/php-odbcpkg:rpm/almalinux/php-opcachepkg:rpm/almalinux/php-pdopkg:rpm/almalinux/php-pearpkg:rpm/almalinux/php-pecl-apcupkg:rpm/almalinux/php-pecl-apcu-develpkg:rpm/almalinux/php-pecl-rrdpkg:rpm/almalinux/php-pecl-xdebugpkg:rpm/almalinux/php-pecl-zippkg:rpm/almalinux/php-pgsqlpkg:rpm/almalinux/php-processpkg:rpm/almalinux/php-recodepkg:rpm/almalinux/php-snmppkg:rpm/almalinux/php-soappkg:rpm/almalinux/php-xmlpkg:rpm/almalinux/php-xmlrpcpkg:rpm/opensuse/oniguruma&distro=openSUSE%20Leap%2015.5pkg:rpm/opensuse/oniguruma&distro=openSUSE%20Leap%2015.6pkg:rpm/opensuse/oniguruma&distro=openSUSE%20Tumbleweedpkg:rpm/suse/oniguruma&distro=SUSE%20Linux%20Enterprise%20Micro%205.1pkg:rpm/suse/oniguruma&distro=SUSE%20Linux%20Enterprise%20Micro%205.2pkg:rpm/suse/oniguruma&distro=SUSE%20Linux%20Enterprise%20Micro%205.3pkg:rpm/suse/oniguruma&distro=SUSE%20Linux%20Enterprise%20Micro%205.4pkg:rpm/suse/oniguruma&distro=SUSE%20Linux%20Enterprise%20Micro%205.5pkg:rpm/suse/oniguruma&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP5pkg:rpm/suse/oniguruma&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP6
< 5.1.17-1.module_el8.3.0+2009+b272fdef+ 48 more
- (no CPE)range: < 5.1.17-1.module_el8.3.0+2009+b272fdef
- (no CPE)range: < 1.5.2-1.module_el8.5.0+152+112d3b8c
- (no CPE)range: < 1.5.2-1.module_el8.4.0+2229+b272fdef
- (no CPE)range: < 1.5.2-1.module_el8.5.0+152+112d3b8c
- (no CPE)range: < 6.8.2-2.el8
- (no CPE)range: < 6.8.2-2.el8
- (no CPE)range: < 7.3.20-1.module_el8.4.0+2229+b272fdef
- (no CPE)range: < 7.3.20-1.module_el8.4.0+2229+b272fdef
- (no CPE)range: < 7.3.20-1.module_el8.5.0+152+112d3b8c
- (no CPE)range: < 7.3.20-1.module_el8.3.0+2009+b272fdef
- (no CPE)range: < 7.3.20-1.module_el8.5.0+152+112d3b8c
- (no CPE)range: < 7.3.20-1.module_el8.3.0+2009+b272fdef
- (no CPE)range: < 7.3.20-1.module_el8.4.0+2229+b272fdef
- (no CPE)range: < 7.3.20-1.module_el8.3.0+2009+b272fdef
- (no CPE)range: < 7.3.20-1.module_el8.4.0+2229+b272fdef
- (no CPE)range: < 7.3.20-1.module_el8.5.0+152+112d3b8c
- (no CPE)range: < 7.3.20-1.module_el8.4.0+2229+b272fdef
- (no CPE)range: < 7.3.20-1.module_el8.3.0+2009+b272fdef
- (no CPE)range: < 7.3.20-1.module_el8.5.0+152+112d3b8c
- (no CPE)range: < 7.3.20-1.module_el8.3.0+2009+b272fdef
- (no CPE)range: < 7.3.20-1.module_el8.5.0+152+112d3b8c
- (no CPE)range: < 7.3.20-1.module_el8.5.0+152+112d3b8c
- (no CPE)range: < 7.3.20-1.module_el8.4.0+2229+b272fdef
- (no CPE)range: < 7.3.20-1.module_el8.3.0+2009+b272fdef
- (no CPE)range: < 7.3.20-1.module_el8.5.0+152+112d3b8c
- (no CPE)range: < 7.3.20-1.module_el8.5.0+152+112d3b8c
- (no CPE)range: < 1:1.10.9-1.module_el8.3.0+2009+b272fdef
- (no CPE)range: < 5.1.17-1.module_el8.5.0+152+112d3b8c
- (no CPE)range: < 5.1.17-1.module_el8.3.0+2009+b272fdef
- (no CPE)range: < 2.0.1-1.module_el8.6.0+2750+78feabcb
- (no CPE)range: < 2.8.0-1.module_el8.5.0+152+112d3b8c
- (no CPE)range: < 1.15.4-1.module_el8.4.0+2229+b272fdef
- (no CPE)range: < 7.3.20-1.module_el8.5.0+152+112d3b8c
- (no CPE)range: < 7.3.20-1.module_el8.4.0+2229+b272fdef
- (no CPE)range: < 7.3.20-1.module_el8.5.0+152+112d3b8c
- (no CPE)range: < 7.3.20-1.module_el8.3.0+2009+b272fdef
- (no CPE)range: < 7.3.20-1.module_el8.4.0+2229+b272fdef
- (no CPE)range: < 7.3.20-1.module_el8.4.0+2229+b272fdef
- (no CPE)range: < 7.3.20-1.module_el8.5.0+152+112d3b8c
- (no CPE)range: < 6.7.0-150000.3.6.1
- (no CPE)range: < 6.7.0-150000.3.6.1
- (no CPE)range: < 6.9.7.1-1.2
- (no CPE)range: < 6.7.0-150000.3.6.1
- (no CPE)range: < 6.7.0-150000.3.6.1
- (no CPE)range: < 6.7.0-150000.3.6.1
- (no CPE)range: < 6.7.0-150000.3.6.1
- (no CPE)range: < 6.7.0-150000.3.6.1
- (no CPE)range: < 6.7.0-150000.3.6.1
- (no CPE)range: < 6.7.0-150000.3.6.1
Patches
0No patches discovered yet.
Vulnerability mechanics
Root cause
"A NULL pointer dereference occurs in the regular expression engine due to improper handling of if-then-else patterns during compilation."
Attack vector
An attacker can trigger this vulnerability by providing a specially crafted regular expression to an application utilizing the affected library. When the engine processes this input, the flaw in the pattern compilation logic leads to a NULL pointer dereference, potentially resulting in a denial of service. This issue is documented to affect Oniguruma 6.9.2 [ref_id=1].
Affected code
The vulnerability is located in `regexec.c` within the `match_at()` function. The compilation logic for `BAG_IF_ELSE` nodes in `compile_bag_node()` and `compile_length_bag_node()` is identified as the source of the defect [ref_id=1].
What the fix does
The patch modifies the compilation logic for if-then-else patterns in `regexec.c` to ensure proper handling of conditional branches and jump offsets. By explicitly calculating `else_len` and adjusting the jump address logic, the fix prevents the engine from dereferencing a NULL pointer when an `Else` branch is missing or improperly structured [ref_id=1]. These changes ensure that the bytecode generation correctly accounts for all possible execution paths within the bag node.
Preconditions
- inputThe application must accept and process user-supplied regular expressions.
Generated on Jun 1, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
4- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/JWCPDTZOIUKGMFAD5NAKUB7FPJFAIQN5/mitrevendor-advisoryx_refsource_FEDORA
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/SNL26OZSQRVLEO6JRNUVIMZTICXBNEQW/mitrevendor-advisoryx_refsource_FEDORA
- security.gentoo.org/glsa/201911-03mitrevendor-advisoryx_refsource_GENTOO
- github.com/kkos/oniguruma/commit/c509265c5f6ae7264f7b8a8aae1cfa5fc59d108cmitrex_refsource_CONFIRM
News mentions
0No linked articles in our index yet.