CVE-2009-5155
Description
In the GNU C Library (aka glibc or libc6) before 2.28, parse_reg_exp in posix/regcomp.c misparses alternatives, which allows attackers to cause a denial of service (assertion failure and application exit) or trigger an incorrect result by attempting a regular-expression match.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
GNU C Library before 2.28 has a misparsing bug in `parse_reg_exp` that can crash programs via crafted regex patterns.
Vulnerability
The GNU C Library (glibc) before version 2.28 contains a flaw in the parse_reg_exp function within posix/regcomp.c. This function misparses certain regular expression alternatives, specifically when back references and alternations are combined in patterns like (.*)(.*)(.*)\3\2\1 or (|()()0)\2. The bug causes an assertion failure (pop_fail_stack: Assertion num >= 0' failed`) when the malformed parsing leads to an invalid internal state during regex matching [1][2][3]. Affected versions include all glibc releases prior to 2.28.
Exploitation
An attacker can trigger the vulnerability by providing a crafted regular expression to an application that uses glibc's regex engine (e.g., GNU grep with the -E flag). The attacker does not need any special privileges; they only require the ability to supply arbitrary regex input to a program that compiles and executes extended regular expressions. For example, running echo abc | LANG=C grep -E '(.*)(.*)(.*)\3\2\1' causes grep to crash with an assertion failure [1]. Multiple variations of such patterns have been reported, all exploiting the same underlying misparsing [2][3].
Impact
Successful exploitation leads to a denial of service (DoS). The assertion failure aborts the process, causing the application to exit unexpectedly. No further compromise of confidentiality or integrity is achieved, but the crash can disrupt services or other applications relying on the glibc regex engine. The victim program terminates abnormally, potentially affecting availability.
Mitigation
The vulnerability is fixed in glibc version 2.28, which corrects the regex parser logic. Users should upgrade to glibc 2.28 or later. For affected systems, a workaround is to avoid processing untrusted regular expressions, especially those using complex combinations of alternations and back references. No official workaround is available, and the bug is not listed on CISA's Known Exploited Vulnerabilities (KEV) catalog.
AI Insight generated on May 24, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
22- osv-coords21 versionspkg:rpm/opensuse/glibc&distro=openSUSE%20Tumbleweedpkg:rpm/suse/glibc&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/glibc&distro=SUSE%20Enterprise%20Storage%204pkg:rpm/suse/glibc&distro=SUSE%20Enterprise%20Storage%205pkg:rpm/suse/glibc&distro=SUSE%20Linux%20Enterprise%20Desktop%2012%20SP4pkg:rpm/suse/glibc&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015pkg:rpm/suse/glibc&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP1pkg:rpm/suse/glibc&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015pkg:rpm/suse/glibc&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015%20SP1pkg:rpm/suse/glibc&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP2-BCLpkg:rpm/suse/glibc&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP2-LTSSpkg:rpm/suse/glibc&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP3-BCLpkg:rpm/suse/glibc&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP3-LTSSpkg:rpm/suse/glibc&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP4pkg:rpm/suse/glibc&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP2pkg:rpm/suse/glibc&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP3pkg:rpm/suse/glibc&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP4pkg:rpm/suse/glibc&distro=SUSE%20Linux%20Enterprise%20Software%20Development%20Kit%2012%20SP4pkg:rpm/suse/glibc&distro=SUSE%20OpenStack%20Cloud%207pkg:rpm/suse/glibc&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/glibc&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208
< 2.34-1.2+ 20 more
- (no CPE)range: < 2.34-1.2
- (no CPE)range: < 2.22-62.22.5
- (no CPE)range: < 2.22-62.22.5
- (no CPE)range: < 2.22-62.22.5
- (no CPE)range: < 2.22-100.8.1
- (no CPE)range: < 2.26-13.24.1
- (no CPE)range: < 2.26-13.24.1
- (no CPE)range: < 2.26-13.24.1
- (no CPE)range: < 2.26-13.24.1
- (no CPE)range: < 2.22-62.22.5
- (no CPE)range: < 2.22-62.22.5
- (no CPE)range: < 2.22-62.22.5
- (no CPE)range: < 2.22-62.22.5
- (no CPE)range: < 2.22-100.8.1
- (no CPE)range: < 2.22-62.22.5
- (no CPE)range: < 2.22-62.22.5
- (no CPE)range: < 2.22-100.8.1
- (no CPE)range: < 2.22-100.8.1
- (no CPE)range: < 2.22-62.22.5
- (no CPE)range: < 2.22-62.22.5
- (no CPE)range: < 2.22-62.22.5
Patches
15513b4099914Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
11- git.savannah.gnu.org/cgit/gnulib.git/commit/mitrex_refsource_MISC
- debbugs.gnu.org/cgi/bugreport.cgimitrex_refsource_MISC
- debbugs.gnu.org/cgi/bugreport.cgimitrex_refsource_MISC
- debbugs.gnu.org/cgi/bugreport.cgimitrex_refsource_MISC
- lists.apache.org/thread.html/r58af02e294bd07f487e2c64ffc0a29b837db5600e33b6e698b9d696b%40%3Cissues.bookkeeper.apache.org%3Emitremailing-listx_refsource_MLIST
- lists.apache.org/thread.html/rf4c02775860db415b4955778a131c2795223f61cb8c6a450893651e4%40%3Cissues.bookkeeper.apache.org%3Emitremailing-listx_refsource_MLIST
- security.netapp.com/advisory/ntap-20190315-0002/mitrex_refsource_CONFIRM
- sourceware.org/bugzilla/show_bug.cgimitrex_refsource_MISC
- sourceware.org/bugzilla/show_bug.cgimitrex_refsource_MISC
- support.f5.com/csp/article/K64119434mitrex_refsource_CONFIRM
- support.f5.com/csp/article/K64119434mitrex_refsource_CONFIRM
News mentions
0No linked articles in our index yet.