# CVE-2026-16118: Xdgmime: heap-based buffer overflow in _xdg_mime_magic_parse_magic_line() in xdgmimemagic.c

> Heap-based buffer overflow in xdgmime allows attackers to cause crashes or execute code via malicious MIME magic files.

- **Severity:** High 7.1 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 17 Jul 2026
- **Updated:** 29 Oct 2026
- **Also known as:** ALSA-2026:64799, ALSA-2026:64800, ALSA-2026:66451, CLSA-2026-1789032075, CLSA-2026-1789206553, CLSA-2026-1789392191, CLSA-2026-1789602006, CLSA-2026-1789748257, CLSA-2026-1789985854, CLSA-2026-1791466598, CLSA-2026-1791535751, CLSA-2026-1791558283, DEBIAN-CVE-2026-16118, ECHO-c3e8-fe66-18c2, GHSA-cp7g-r78m-cc2g, OESA-2026-3725, OESA-2026-3728, OESA-2026-3909, RHSA-2026:64799, RHSA-2026:64800, RHSA-2026:66451, RHSA-2026:70636, RHSA-2026:71403, RHSA-2026:71404, RHSA-2026:71405, RLSA-2026:64799, RLSA-2026:64800, RLSA-2026:66451, ROOT-OS-DEBIAN-11-CVE-2026-16118, ROOT-OS-DEBIAN-12-CVE-2026-16118, UBUNTU-CVE-2026-16118

## What is CVE-2026-16118?

CVE-2026-16118 is a high-severity memory corruption vulnerability in Cert Manager support for Red Hat OpenShift release 1.17, published on 17 Jul 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

A flaw was found in xdgmime. A heap-based buffer overflow can be triggered in _xdg_mime_magic_parse_magic_line() in the xdgmimemagic.c file on little-endian systems when an attacker-controlled MIME magic file in a user-writable XDG data location (e.g., in the $XDG_DATA_HOME/mime/magic path) is parsed by an application performing MIME type detection (e.g., via g_content_type_guess()). When performing byte-swap, incorrect pointer arithmetic on the write side causes an out-of-bounds write of 2 bytes, resulting in an application crash or memory corruption.

Weakness: CWE-122 (Heap-based Buffer Overflow)

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `glib2` | AlmaLinux:10 | All versions | 2.80.4-12.el10_2.22 |
| `glib2-devel` | AlmaLinux:10 | All versions | 2.80.4-12.el10_2.22 |
| `glib2-doc` | AlmaLinux:10 | All versions | 2.80.4-12.el10_2.22 |
| `glib2-static` | AlmaLinux:10 | All versions | 2.80.4-12.el10_2.22 |
| `glib2-tests` | AlmaLinux:10 | All versions | 2.80.4-12.el10_2.22 |
| `glib2` | AlmaLinux:8 | All versions | 2.56.4-178.el8_10 |
| `glib2-devel` | AlmaLinux:8 | All versions | 2.56.4-178.el8_10 |
| `glib2-doc` | AlmaLinux:8 | All versions | 2.56.4-178.el8_10 |
| `glib2-fam` | AlmaLinux:8 | All versions | 2.56.4-178.el8_10 |
| `glib2-static` | AlmaLinux:8 | All versions | 2.56.4-178.el8_10 |
| `glib2-tests` | AlmaLinux:8 | All versions | 2.56.4-178.el8_10 |
| `glib2` | AlmaLinux:9 | All versions | 2.68.4-19.el9_8.10 |
| `glib2-devel` | AlmaLinux:9 | All versions | 2.68.4-19.el9_8.10 |
| `glib2-doc` | AlmaLinux:9 | All versions | 2.68.4-19.el9_8.10 |
| `glib2-static` | AlmaLinux:9 | All versions | 2.68.4-19.el9_8.10 |
| `glib2-tests` | AlmaLinux:9 | All versions | 2.68.4-19.el9_8.10 |
| `glib2` | Red Hat:enterprise_linux:10.2 | All versions | 0:2.80.4-12.el10_2.22 |
| `glib2-debuginfo` | Red Hat:enterprise_linux:10.2 | All versions | 0:2.80.4-12.el10_2.22 |
| `glib2-debugsource` | Red Hat:enterprise_linux:10.2 | All versions | 0:2.80.4-12.el10_2.22 |
| `glib2-devel` | Red Hat:enterprise_linux:10.2 | All versions | 0:2.80.4-12.el10_2.22 |
| `glib2-devel-debuginfo` | Red Hat:enterprise_linux:10.2 | All versions | 0:2.80.4-12.el10_2.22 |
| `glib2-doc` | Red Hat:enterprise_linux:10.2 | All versions | 0:2.80.4-12.el10_2.22 |
| `glib2-static` | Red Hat:enterprise_linux:10.2 | All versions | 0:2.80.4-12.el10_2.22 |
| `glib2-tests` | Red Hat:enterprise_linux:10.2 | All versions | 0:2.80.4-12.el10_2.22 |
| `glib2-tests-debuginfo` | Red Hat:enterprise_linux:10.2 | All versions | 0:2.80.4-12.el10_2.22 |
| `glib2` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.56.4-178.el8_10 |
| `glib2-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.56.4-178.el8_10 |
| `glib2-debugsource` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.56.4-178.el8_10 |
| `glib2-devel` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.56.4-178.el8_10 |
| `glib2-devel-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.56.4-178.el8_10 |
| `glib2-fam` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.56.4-178.el8_10 |
| `glib2-fam-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.56.4-178.el8_10 |
| `glib2-tests` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.56.4-178.el8_10 |
| `glib2-tests-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.56.4-178.el8_10 |
| `glib2-debuginfo` | Red Hat:enterprise_linux:8::crb | All versions | 0:2.56.4-178.el8_10 |
| `glib2-debugsource` | Red Hat:enterprise_linux:8::crb | All versions | 0:2.56.4-178.el8_10 |
| `glib2-devel-debuginfo` | Red Hat:enterprise_linux:8::crb | All versions | 0:2.56.4-178.el8_10 |
| `glib2-doc` | Red Hat:enterprise_linux:8::crb | All versions | 0:2.56.4-178.el8_10 |
| `glib2-fam-debuginfo` | Red Hat:enterprise_linux:8::crb | All versions | 0:2.56.4-178.el8_10 |
| `glib2-static` | Red Hat:enterprise_linux:8::crb | All versions | 0:2.56.4-178.el8_10 |

## How do I fix CVE-2026-16118?

Apply the vendor's patch.

## Is CVE-2026-16118 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-16118 exists.

## Fix prompt for AI coding agents

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

What it is: CVE-2026-16118 is a high-severity memory corruption vulnerability in Cert Manager support for Red Hat OpenShift release 1.17, published on 17 Jul 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-16118 exists.

Affected product: Cert Manager support for Red Hat OpenShift release 1.17. 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-16118/ (Markdown: https://insights.sbomify.com/CVE-2026-16118/index.md)
```

## Sources

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

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