CVE-2026-58012: Glib: buffer over-read in g_regex_replace() via glib/gregex.c:string_append() and g_utf8_next_char()

Published Jun 24, 2026
·
Updated

A flaw was found in GLib. A buffer over-read can occur in the gregexreplace function when used with the GREGEXRAW compile flag and case-change replacement escapes because the stringappend 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.

Other sources

A heap-buffer-overflow READ vulnerability exists in GLib's gregexreplace() function when used with GREGEXRAW compile flag and case-change replacement escapes (\U, \L, \u, \l). In GREGEXRAW mode, PCRE2 treats the subject string as raw bytes rather than UTF-8. Matched substrings can therefore contain arbitrary byte sequences that are not valid UTF-8. When the replacement string contains case-change escapes (e.g., \U\0 to uppercase the match), the internal stringappend() function processes the matched substring using UTF-8 functions (gutf8getchar(), gutf8nextchar()) which assume valid UTF-8 input. A multi-byte UTF-8 lead byte (e.g., 0xF4 indicating a 4-byte sequence) in the matched data causes these functions to read beyond the heap-allocated buffer.

Red Hat

Glib: buffer over-read in gregexreplace() via glib/gregex.c:stringappend() and gutf8nextchar()

Microsoft

Affected Software

9 affected componentsFixes available
GLib g_regex_replace()
Gnome GLib<2.86.5
Gnome GLib=2.88.0
redhat Enterprise Linux=6.0
redhat Enterprise Linux=7.0
redhat Enterprise Linux=8.0
redhat Enterprise Linux=9.0
redhat Enterprise Linux=10.0
Microsoft azl3 glib 2.78.6-9<2.78.6-10
2.78.6-10

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 2.78.6-10

Event History

Jun 24, 2026
Data Sourced
via Red Hat·04:49 PM
DescriptionSeverityAffected Software
Jun 30, 2026
CVE Published
via MITRE·12:57 PM
Data Sourced
via MITRE·12:57 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·01:19 PM
DescriptionSeverityWeaknessAffected Software
Jul 1, 2026
Data Sourced
via Microsoft·08:02 AM
DescriptionSeverityWeaknessAffected Software
Updated
via Microsoft·08:02 AM
DescriptionSeverity
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-58012?

The severity of CVE-2026-58012 is rated as high with a score of 8.2.

2

How do I fix CVE-2026-58012?

To fix CVE-2026-58012, update GLib to the latest stable version provided by your distribution that addresses the vulnerability.

3

What systems are affected by CVE-2026-58012?

CVE-2026-58012 affects Red Hat Enterprise Linux and GNOME GLib implementations of the g_regex_replace function.

4

What kind of vulnerability is CVE-2026-58012?

CVE-2026-58012 is a buffer over-read vulnerability that can occur in the g_regex_replace function when handling invalid UTF-8 input.

5

Are there any known exploits for CVE-2026-58012?

As of now, there are no known exploits specifically targeting CVE-2026-58012.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203