CVE-2026-58012 Glib: buffer over-read in g_regex_replace() via glib/gregex.c:string_append() and g_utf8_next_char()
A buffer over-read in GLib's regex replacement allows attackers to disclose minor memory contents or cause a denial of service when using raw byte mode.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-58012?
CVE-2026-58012 is a medium-severity vulnerability in Redhat Enterprise Linux, published on 30 Jun 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
A flaw was found in GLib. A buffer over-read can occur in the g_regex_replace function when used with the `G_REGEX_RAW` compile flag and case-change replacement escapes because the string_append function processes matched substrings using UTF-8 functions that assume valid UTF-8 input, even when the string is treated as raw bytes. This vulnerability can cause a minor information disclosure of 1-5 bytes and a denial of service when the buffer over-read crosses a page boundary.
Weakness: CWE-126
Which versions are affected by CVE-2026-58012?
It affects 2 products.
Products include Gnome Glib, Redhat Enterprise Linux.
How do I fix CVE-2026-58012?
Apply the vendor's patch.
Is CVE-2026-58012 being exploited?
There is no known exploitation of CVE-2026-58012 in the wild and no public exploit code.
Other vulnerabilities in Redhat Enterprise Linux
- CVE-2020-35457 Integer overflow in n/a
- CVE-2009-3289 Privilege escalation in n/a
- CVE-2025-13601 Glib: integer overflow in in g_escape_uri_string()
- CVE-2026-58016 Glib: integer underflow in gio/gdbusintrospection.c via "g_dbus_node_info_new_for_xml"
- CVE-2025-4056 Glib: glib crash after long command line
Sources
Also known as AZL-91436, BELL-CVE-2026-58012, DEBIAN-CVE-2026-58012, ECHO-77f1-be49-886b, GHSA-vwg8-37h9-g38g, JLSEC-2026-1245 and 5 more.