Description
The regcomp and regexec functions in the GNU C Library version 2.3 to version 2.44 may read freed memory and free the same heap block twice when a memory allocation fails while a regular expression is compiled or matched. The re_dfa_add_node (the NFA node table) and build_range_exp (bracket ranges) grow several arrays with consecutive realloc calls and store the new pointers only after all of them succeed. When a later call fails, the pattern buffer keeps pointers to blocks that were already freed, and the error cleanup frees them again. In regexec, the back-reference cache (match_ctx_add_entry) frees its array when a realloc fails but keeps the pointer, which is freed again on the error path.
An attacker does not need to supply a crafted regular expression: patterns large enough to grow these arrays are common. The failure has to hit a specific allocation, though, so the issue can only be reached when the system is already under memory pressure. An attacker who supplies the pattern or the subject string has little control over which allocation fails, so the expected impact is a crash of the process. This issue affects all architectures and ABIs supported by the GNU C Library.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| The GNU C Library | glibc | 2.3 – ≤ 2.44 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | glibc | No fix yet | — |
| Debian 13 | glibc | No fix yet | — |
| Debian 12 | glibc | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | glibc | No fix yet | — |
| Ubuntu 26.04 LTS | glibc | No fix yet | — |
| Ubuntu 24.04 LTS | glibc | No fix yet | — |
| Ubuntu 22.04 LTS | glibc | No fix yet | — |
Show 4 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 20.04 LTS | glibc | No fix yet | — |
| Ubuntu Pro 18.04 LTS | glibc | No fix yet | — |
| Ubuntu Pro 16.04 LTS | glibc | No fix yet | — |
| Ubuntu Pro 14.04 LTS | eglibc | No fix yet | — |
Azure Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Azure Linux 3 | glibc | No fix yet | — |
Advisories 1
- WID-SEC-2026-4521 GNU libc: Mehrere Schwachstellen BSI CERT-Bund (WID) · Nov 11, 2026
References
- https://sourceware.org/bugzilla/show_bug.cgi?id=34991 issue-tracking
- https://sourceware.org/bugzilla/show_bug.cgi?id=31935 issue-tracking
- https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=advisories/GLIBC-SA-2026-0028 vendor-advisory