---
id: CVE-2026-16118
title: A flaw was found in xdgmime
summary: >-
  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 …
severity: high
cvss: 7.1
cvssVector: 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H'
cwe:
  - CWE-122
vendor: xdg
product: xdgmime
affected:
  - xdgmime (all versions)
  - glib2 (all versions)
  - glib2 (all versions)
  - glib2 (all versions)
  - glib2 (all versions)
  - glib2 (all versions)
  - glib2 (all versions)
  - glib2 (all versions)
  - rhui5/cds-kubernetes-rhel9 (all versions)
  - rhui5/cds-rhel9 (all versions)
  - rhui5/haproxy-rhel9 (all versions)
  - rhui5/installer-rhel9 (all versions)
  - rhui5/rhua-rhel9 (all versions)
  - glib2 (all versions)
  - webkitgtk4 (all versions)
  - webkit2gtk3 (all versions)
  - webkit2gtk3 (all versions)
patched:
  - enterprise_linux_appstream_v_10
  - enterprise_linux_appstream_v_9
  - enterprise_linux_baseos_v_10
  - enterprise_linux_baseos_v_9
  - enterprise_linux_codeready_linux_builder_v_10
  - enterprise_linux_codeready_linux_builder_v_9
published: '2026-07-17'
updated: '2026-09-24'
sourceUpdated: '2026-09-24T18:17:13.030'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-16118'
references:
  - url: 'https://access.redhat.com/errata/RHSA-2026:64799'
    label: secalert@redhat.com
  - url: 'https://access.redhat.com/errata/RHSA-2026:64800'
    label: secalert@redhat.com
  - url: 'https://access.redhat.com/errata/RHSA-2026:66451'
    label: secalert@redhat.com
  - url: 'https://access.redhat.com/errata/RHSA-2026:67956'
    label: secalert@redhat.com
  - url: 'https://access.redhat.com/errata/RHSA-2026:70636'
    label: secalert@redhat.com
  - url: 'https://access.redhat.com/errata/RHSA-2026:71403'
    label: secalert@redhat.com
  - url: 'https://access.redhat.com/errata/RHSA-2026:71404'
    label: secalert@redhat.com
  - url: 'https://access.redhat.com/errata/RHSA-2026:71405'
    label: secalert@redhat.com
  - url: 'https://access.redhat.com/security/cve/CVE-2026-16118'
    label: secalert@redhat.com
  - url: 'https://bugzilla.redhat.com/show_bug.cgi?id=2501732'
    label: secalert@redhat.com
  - url: 'https://gitlab.freedesktop.org/xdg/xdgmime/-/work_items/41'
    label: secalert@redhat.com
  - url: 'https://gitlab.freedesktop.org/xdg/xdgmime/-/work_items/41'
    label: 134c704f-9b21-4f2e-91b3-4a467353bcc0
  - url: >-
      https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-16118.json
  - url: 'https://www.cve.org/CVERecord?id=CVE-2026-16118'
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2026-16118'
tags:
  - nvd
  - cve.org
  - exploit-available
  - csaf
  - vex
  - red-hat
epss: 0.00267
epssPercentile: 0.1681
exploitAvailable: true
ssvc:
  exploitation: poc
  automatable: 'no'
  technicalImpact: partial
  timestamp: '2026-07-22T18:18:50.584747Z'
ingestedAt: '2026-09-04T04:14:25.433Z'
---

## Overview

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.

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.

## Vendor advisories

- **RHSA-2026:64799** · Red Hat · fixed in: Red Hat Enterprise Linux AppStream (v. 10), Red Hat Enterprise Linux BaseOS (v. 10), Red Hat Enterprise Linux CodeReady Linux Builder (v. 10) · released 2026-09-08 · [advisory](https://access.redhat.com/errata/RHSA-2026:64799)
- **RHSA-2026:64800** · Red Hat · fixed in: Red Hat Enterprise Linux AppStream (v. 9), Red Hat Enterprise Linux BaseOS (v. 9), Red Hat Enterprise Linux CodeReady Linux Builder (v. 9) · released 2026-09-08 · [advisory](https://access.redhat.com/errata/RHSA-2026:64800)
- **Red Hat VEX** · Moderate · affected: Red Hat Enterprise Linux 7, Red Hat Enterprise Linux 8, Red Hat Enterprise Linux 9 · no fix planned: Red Hat Enterprise Linux 7, Red Hat Enterprise Linux 8, Red Hat Enterprise Linux 9 · updated 2026-09-24 · [vex](https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-16118.json)
- **RHSA-2026:66451** · Red Hat · fixed in: Red Hat Enterprise Linux BaseOS (v. 8), Red Hat Enterprise Linux CRB (v. 8) · released 2026-09-11 · [advisory](https://access.redhat.com/errata/RHSA-2026:66451)
- **RHSA-2026:67956** · Red Hat · fixed in: Red Hat Update Infrastructure 5 · released 2026-09-16 · [advisory](https://access.redhat.com/errata/RHSA-2026:67956)
- **RHSA-2026:70636** · Red Hat · fixed in: Red Hat Enterprise Linux AppStream E4S (v.9.4), Red Hat Enterprise Linux BaseOS E4S (v.9.4) · released 2026-09-23 · [advisory](https://access.redhat.com/errata/RHSA-2026:70636)
- **RHSA-2026:71404** · Red Hat · fixed in: Red Hat Enterprise Linux AppStream EUS (v. 10.0), Red Hat Enterprise Linux BaseOS EUS (v. 10.0), Red Hat Enterprise Linux CodeReady Linux Builder EUS (v. 10.0) · released 2026-09-24 · [advisory](https://access.redhat.com/errata/RHSA-2026:71404)
- **RHSA-2026:71405** · Red Hat · fixed in: Red Hat Enterprise Linux AppStream E4S (v.9.2), Red Hat Enterprise Linux BaseOS E4S (v.9.2) · released 2026-09-24 · [advisory](https://access.redhat.com/errata/RHSA-2026:71405)
- **RHSA-2026:71403** · Red Hat · fixed in: Red Hat Enterprise Linux AppStream EUS (v.9.6), Red Hat Enterprise Linux BaseOS EUS (v.9.6), Red Hat CodeReady Linux Builder EUS (v.9.6) · released 2026-09-24 · [advisory](https://access.redhat.com/errata/RHSA-2026:71403)
