CVE-2026-58012
Undergoing Analysis Undergoing Analysis - In Progress

Buffer Over-Read in GLib via g_regex_replace

Vulnerability report for CVE-2026-58012, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-06-30

Last updated on: 2026-06-30

Assigner: Red Hat, Inc.

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-06-30
Last Modified
2026-06-30
Generated
2026-06-30
AI Q&A
2026-06-30
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
gnome glib From 2026-06-24 (inc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-126 The product reads from a buffer using buffer access mechanisms such as indexes or pointers that reference memory locations after the targeted buffer.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability exists in the GLib library's g_regex_replace() function when it is used with the G_REGEX_RAW compile flag and case-change replacement escapes such as \U, \L, \u, and \l.

In G_REGEX_RAW mode, the function treats the input string as raw bytes rather than UTF-8 encoded text. However, the internal string_append() function processes matched substrings using UTF-8 functions that assume the input is valid UTF-8.

If the matched substring contains arbitrary byte sequences that are not valid UTF-8, this mismatch can cause the function to read beyond the allocated buffer, leading to a heap-buffer-overflow read.

Compliance Impact

The provided information does not specify how this vulnerability affects compliance with common standards and regulations such as GDPR or HIPAA.

Impact Analysis

This vulnerability can lead to two main impacts:

  • Minor information disclosure of 1-5 bytes due to buffer over-read.
  • Denial of service (DoS) if the buffer over-read crosses a memory page boundary, potentially crashing the application.
Mitigation Strategies

To mitigate this vulnerability, you should update GLib to a version where the g_regex_replace function properly handles the G_REGEX_RAW compile flag and case-change replacement escapes, preventing buffer over-read.

Avoid using the g_regex_replace function with the G_REGEX_RAW flag combined with case-change replacement escapes (\U, \L, \u, \l) until a patched version is applied.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-58012. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart