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.
Published: 2026-07-17
Score: 7.1 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability is a heap‑based buffer overflow in xdgmime, caused by incorrect pointer arithmetic when parsing a MIME magic file line on little‑endian systems. The overflow writes two bytes beyond the intended buffer, leading to application crashes or memory corruption. An attacker may trigger memory corruption or cause the application to crash, potentially enabling further exploitation if additional vulnerabilities are present.

Affected Systems

Red Hat Enterprise Linux 10, 7, 8, and 9 contain the vulnerable xdgmime component, and any distribution that ships the xdg:xdgmime package is affected. The vulnerability manifests when an attacker supplies a crafted MIME magic file in a user‑writable XDG data directory such as $XDG_DATA_HOME/mime/magic.

Risk and Exploitability

The CVSS score of 7.1 indicates moderate to high severity, while the EPSS score of < 1% suggests a low but not zero chance of exploitation. The vulnerability is not listed in the CISA KEV catalog. Exploitation requires write access to a user’s XDG data directory and is likely local; however, if a malicious file is placed in an environment where MIME detection code runs under other users’ contexts, the impact could spread beyond the local user.

Generated by OpenCVE AI on July 30, 2026 at 23:37 UTC.

Remediation

Vendor Workaround

Do not install a MIME magic file or content from untrusted sources.


OpenCVE Recommended Actions

  • Remove or sanitize any unexpected MIME magic files supplied by untrusted parties in the $XDG_DATA_HOME/mime/magic directory.
  • Disable or restrict automatic loading of user‑supplied MIME magic files by configuring applications or adjusting directory permissions.
  • Ensure that no writable XDG data directories are accessible by untrusted users to prevent crafting malicious MIME files.

Generated by OpenCVE AI on July 30, 2026 at 23:37 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Wed, 22 Jul 2026 19:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Sat, 18 Jul 2026 12:15:00 +0000

Type Values Removed Values Added
References
Metrics threat_severity

None

threat_severity

Moderate


Fri, 17 Jul 2026 20:00:00 +0000

Type Values Removed Values Added
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.
Title Xdgmime: heap-based buffer overflow in _xdg_mime_magic_parse_magic_line() in xdgmimemagic.c
First Time appeared Redhat
Redhat enterprise Linux
Weaknesses CWE-122
CPEs cpe:/o:redhat:enterprise_linux:10
cpe:/o:redhat:enterprise_linux:7
cpe:/o:redhat:enterprise_linux:8
cpe:/o:redhat:enterprise_linux:9
Vendors & Products Redhat
Redhat enterprise Linux
References
Metrics cvssV3_1

{'score': 7.1, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H'}


Subscriptions

Redhat Enterprise Linux
cve-icon MITRE

Status: PUBLISHED

Assigner: redhat

Published:

Updated: 2026-07-29T16:55:45.562Z

Reserved: 2026-07-17T15:50:21.345Z

Link: CVE-2026-16118

cve-icon Vulnrichment

Updated: 2026-07-22T18:18:34.443Z

cve-icon NVD

No data.

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-07-07T00:00:00Z

Links: CVE-2026-16118 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-08-02T20:35:57Z

Weaknesses
  • CWE-122

    Heap-based Buffer Overflow