# 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.

- **Severity:** Medium 6.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 30 Jun 2026
- **Updated:** 29 Oct 2026
- **Also known as:** AZL-91436, BELL-CVE-2026-58012, DEBIAN-CVE-2026-58012, ECHO-77f1-be49-886b, GHSA-vwg8-37h9-g38g, JLSEC-2026-1245, MINI-j95g-c7vv-gfjm, ROOT-OS-ALPINE-323-CVE-2026-58012, ROOT-OS-DEBIAN-11-CVE-2026-58012, ROOT-OS-DEBIAN-12-CVE-2026-58012, UBUNTU-CVE-2026-58012

## 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 (Buffer Over-read)

## Which versions are affected by CVE-2026-58012?

It affects 2 products.


Products: 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](https://insights.sbomify.com/CVE-2020-35457/): Integer overflow in n/a (high 7.8)
- [CVE-2009-3289](https://insights.sbomify.com/CVE-2009-3289/): Privilege escalation in n/a (high 7.8)
- [CVE-2025-13601](https://insights.sbomify.com/CVE-2025-13601/): Glib: integer overflow in in g_escape_uri_string() (high 7.7)
- [CVE-2026-58016](https://insights.sbomify.com/CVE-2026-58016/): Glib: integer underflow in gio/gdbusintrospection.c via "g_dbus_node_info_new_for_xml" (high 7.5)
- [CVE-2025-4056](https://insights.sbomify.com/CVE-2025-4056/): Glib: glib crash after long command line (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-58012 and fix it if it is affected.

What it is: 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.
Exploitation: There is no known exploitation of CVE-2026-58012 in the wild and no public exploit code.

Affected product: Redhat Enterprise Linux. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-58012/ (Markdown: https://insights.sbomify.com/CVE-2026-58012/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-58012
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-58012
- OSV: https://osv.dev/vulnerability/CVE-2026-58012

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-58012/
Summaries are generated and may contain mistakes; the official description above is the record.
