CVE-2026-58012
Medium · 6.5CVSS
6.5
EPSS
0.5%
Published
Jun 30, 2026
CISA due date
—
Cloudanix analysis
Some software using a common Linux library can be made to crash or reveal a few unintended bytes when it processes specially crafted text-like input.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Moderate
- Impact
- Data Exposure
- Component
- Library
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
This flaw is a buffer over-read in GLib's g_regex_replace() when regular expressions are compiled with G_REGEX_RAW and replacement strings use case-changing escapes. In this mode the input is treated as raw bytes, but part of the replacement handling still uses UTF-8-oriented processing that assumes valid UTF-8. Crafted non-UTF-8 byte sequences can cause GLib to read 1 to 5 bytes past the intended buffer. If the over-read remains in mapped memory, a small amount of adjacent process memory may be incorporated into output; if it crosses an unmapped page boundary, the process can crash. The impact is limited to confidentiality and availability; there is no known direct code execution or data integrity impact.
Why it matters to the business
Applications, daemons, desktop components, and services that rely on GLib and expose regex replacement behavior to untrusted input may leak a few bytes of process memory or crash. Because GLib is a foundational library used broadly across Linux and GNOME-related ecosystems, exposure may be indirect through downstream applications rather than obvious direct use. The current exploitation signal is low: EPSS is low, it is not in CISA KEV, it is not associated with ransomware use, and no public exploit maturity is reported. Organizations should still prioritize inventory and patching for internet-facing, high-availability, or input-processing services because a small parsing flaw in a shared library can affect many dependent products.
How an attack unfolds
An attacker first identifies an application or service that uses GLib regular expression replacement on attacker-controlled bytes, specifically where the regex was compiled with G_REGEX_RAW and the replacement expression includes case-change escapes. The attacker sends input containing malformed or carefully positioned non-UTF-8 byte sequences. During replacement, GLib treats the original subject as raw bytes but then processes the matched substring through UTF-8-aware logic. This mismatch can make the library read a few bytes beyond the valid input buffer. If those extra bytes are copied into a response, log, transformed output, or other attacker-observable channel, the attacker may obtain a very small memory disclosure. If the read crosses a memory page boundary, the process may terminate with a segmentation fault, creating a denial-of-service condition. Exploitation depends heavily on a vulnerable application pattern; GLib being installed alone is not sufficient unless reachable code paths use the affected API and flags with untrusted input.
How to fix it
Apply vendor-provided GLib updates as soon as fixed packages are available for the operating system or distribution in use. Because no exact fixed versions were provided in the input, track the relevant distribution advisories for glib2/libglib2.0 packages and upgrade to the vendor-designated fixed release. Rebuild and redeploy containers, appliances, and statically linked software that bundle GLib rather than relying only on host package updates. For application-level mitigation, avoid using G_REGEX_RAW with untrusted input when replacement strings use case-change escapes; validate or normalize input to valid UTF-8 before calling g_regex_replace(); or disable user-controlled regex replacement features until patched. Where immediate patching is not possible, reduce exposure of affected parsing paths, add request size/rate limits, and use process supervision to limit denial-of-service blast radius.
How to confirm the fix worked
Confirm that GLib packages have been updated using the platform package manager and vendor advisory metadata for glib2/libglib2.0. Inventory applications, containers, and embedded runtimes that bundle their own GLib copy, and verify they were rebuilt against a fixed library. For code-level validation, search source and dependency code for g_regex_replace() combined with G_REGEX_RAW and replacement strings that use case-changing escapes. Run regression tests using malformed non-UTF-8 byte input against any affected code path and confirm the application neither crashes nor emits unintended adjacent bytes. In production, validate that crash logs and core dumps no longer show GLib regex replacement stack frames after patching.
Typical attack path
- Find a network-accessible or otherwise attacker-reachable application that performs GLib regex replacement on untrusted input.
- Confirm or infer that the application uses g_regex_replace() with G_REGEX_RAW and case-change replacement escapes.
- Submit crafted raw-byte input containing invalid UTF-8 or boundary-positioned byte sequences.
- Trigger the vulnerable replacement path so GLib processes raw bytes using UTF-8 assumptions.
- Observe either a small unintended memory disclosure in returned/transformed output or a process crash.
- Repeat requests to cause service instability if the vulnerable process automatically restarts.
How to detect it
There are no public, reliable network indicators or known threat actor campaigns tied to this vulnerability. Detection should focus on evidence that a reachable application is exercising the vulnerable GLib regex replacement path and then crashing or emitting anomalous transformed data. Review application logs, system journals, crash reporters, core dump metadata, and EDR telemetry for segmentation faults or aborts in processes that use GLib, especially stack traces containing g_regex_replace or related GLib regex functions. Look for repeated unauthenticated requests containing invalid UTF-8, binary bytes in text fields, unusual escape-heavy replacement patterns, or inputs that repeatedly precede crashes. If core dumps are available, inspect stack traces for GLib regex replacement frames and correlate timestamps with inbound requests. For possible information disclosure, review responses, logs, or transformed outputs for unexpected non-input bytes appearing near regex replacement results. Absence of these artifacts does not prove safety, because exploitation may only cause a small memory disclosure without a crash if application output exposes the over-read bytes.
- g_regex_replace
- G_REGEX_RAW
- g_regex_replace_eval
- g_regex_match
- g_regex_replace_literal
- string_append
- SIGSEGV
- segmentation fault
- Segmentation fault (core dumped)
- Process terminated with signal SIGSEGV
- GLib-CRITICAL
- libglib-2.0.so
- libglib-2.0.so.0
What your security team should do
- Inventory GLib usage across servers, containers, desktop components, and third-party applications, prioritizing internet-facing services and parsers that process untrusted input.
- Monitor operating system and distribution advisories for fixed glib2/libglib2.0 packages, then patch and redeploy affected systems and images.
- Ask application owners to identify any use of g_regex_replace() with G_REGEX_RAW and case-changing replacement escapes on untrusted data.
- Temporarily disable or restrict user-controlled regex replacement functionality in high-risk services until patched.
- Enable or review crash telemetry for segmentation faults involving GLib regex functions to identify possible exploitation attempts or reliability impact.
- Because exploitation activity is not currently reported and EPSS is low, handle this as a measured remediation item rather than an emergency KEV-style response, unless a critical exposed application is confirmed vulnerable.
The record
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.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|
Related vulnerabilities
- CVE-2026-112404 Pillow is a Python imaging library. CWE-126
- CVE-2026-112394 Pillow is a Python imaging library. CWE-126
- CVE-2026-85745 MariaDB server is a community developed fork of MySQL server. CWE-126
- CVE-2026-97399 The strncasecmp function in the GNU C Library 2.24 and later optimized for the Power8… CWE-126
- CVE-2026-94286 An out-of-bounds read in libXtst's RECORD reply parser in libXtst before 1.2.6 could be… CWE-126
- CVE-2026-76653 A missing authentication vulnerability in the VPN configuration management has been… CWE-126
- CVE-2026-83949 Buffer over-read in Microsoft Office Word allows an unauthorized attacker to disclose… CWE-126
- CVE-2026-83951 Buffer over-read in Microsoft Office Word allows an unauthorized attacker to disclose… CWE-126