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.
Published: 2026-06-30
Score: 6.5 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability resides in the GLib library's regular expression replacement routine. When the G_REGEX_RAW compile flag is used together with case-change escape sequences, the internal string_append function processes the substitution text as UTF-8 even though it represents raw bytes. This mismatch allows an attacker to read beyond the intended buffer, exposing 1-5 bytes of data and triggering a denial of service if the over-read crosses a page boundary. The weakness is classified as CWE-126, a buffer over-read.

Affected Systems

The flaw impacts all Red Hat Enterprise Linux releases that ship the affected GLib package, including RHEL 6, 7, 8, 9, 10, and Red Hat Hardened Images. The vulnerability is tied to the GLib component, which is widely used across system libraries and applications. No specific version is identified, so any installation of GLib running on these operating systems is potentially vulnerable.

Risk and Exploitability

The CVSS v3 score of 6.5 places the vulnerability in the medium severity range, and it is not currently listed in the CISA KEV catalog. Because the issue depends on how an application compiles regular expressions and the content of user-supplied replacement strings, the attack vector is likely local or remote where the attacker can influence g_regex_replace calls. Exploitation requires that the application use the G_REGEX_RAW flag and include case-change modifiers; once these conditions are met, an attacker can read a few bytes of arbitrary memory or cause a service crash, potentially impacting confidentiality and availability.

Generated by OpenCVE AI on June 30, 2026 at 15:52 UTC.

Remediation

Vendor Workaround

To mitigate this vulnerability, implement strict input validation to sanitize user-supplied replacement strings, specifically rejecting or escaping case-change modifiers (\u, \l, \U, \L) before calling g_regex_replace() or g_regex_replace_eval() when the G_REGEX_RAW compile flag is used. Removing the G_REGEX_RAW flag or hardcoding the replacement strings will completely neutralize this issue.


OpenCVE Recommended Actions

  • Apply the vendor-released GLib update that addresses the buffer over-read in g_regex_replace.
  • Remove the G_REGEX_RAW compilation flag from any g_regex_replace usage or substitute it with a safer alternative.
  • Sanitize user-supplied replacement strings by rejecting or escaping case-change escape sequences (\u, \l, \U, \L) before calling g_regex_replace or g_regex_replace_eval.

Generated by OpenCVE AI on June 30, 2026 at 15:52 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Wed, 01 Jul 2026 10:30:00 +0000

Type Values Removed Values Added
First Time appeared Gnome
Gnome glib
Redhat hardened Images
Vendors & Products Gnome
Gnome glib
Redhat hardened Images

Tue, 30 Jun 2026 14:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Tue, 30 Jun 2026 13:15:00 +0000

Type Values Removed Values Added
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.
Title Glib: buffer over-read in g_regex_replace() via glib/gregex.c:string_append() and g_utf8_next_char()
First Time appeared Redhat
Redhat enterprise Linux
Redhat hummingbird
Weaknesses CWE-126
CPEs cpe:/a:redhat:hummingbird:1
cpe:/o:redhat:enterprise_linux:10
cpe:/o:redhat:enterprise_linux:6
cpe:/o:redhat:enterprise_linux:7
cpe:/o:redhat:enterprise_linux:8
cpe:/o:redhat:enterprise_linux:9
Vendors & Products Redhat
Redhat enterprise Linux
Redhat hummingbird
References
Metrics cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L'}


Subscriptions

Gnome Glib
Redhat Enterprise Linux Hardened Images Hummingbird
cve-icon MITRE

Status: PUBLISHED

Assigner: redhat

Published:

Updated: 2026-06-30T14:38:17.617Z

Reserved: 2026-06-26T20:59:47.855Z

Link: CVE-2026-58012

cve-icon Vulnrichment

Updated: 2026-06-30T13:18:15.484Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-01T10:01:38Z

Weaknesses