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

Published Jul 17, 2026
·
Updated

A flaw was found in xdgmime, affecting all versions. A heap-based buffer overflow can occur in xdgmimemagicparsemagicline() 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 $XDGDATAHOME/mime/magic path) is parsed by an application performing MIME type detection (e.g., via gcontenttypeguess()). 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. To exploit this flaw, an attacker must trick a user into installing a malicious MIME magic file.

Other sources

A flaw was found in xdgmime. A heap-based buffer overflow can be triggered in xdgmimemagicparsemagicline() 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 $XDGDATAHOME/mime/magic path) is parsed by an application performing MIME type detection (e.g., via gcontenttypeguess()). 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.

— NVD

Affected Software

2 affected componentsFixes available
xdgmime=undefined
debian/glib2.0<=2.74.6-2+deb12u9, <=2.74.6-2+deb12u2
2.84.4-3~deb13u52.90.0-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/glib2.0 to a version that resolves this vulnerability.

    Fixed in 2.84.4-3~deb13u5Fixed in 2.90.0-1

Event History

Jul 17, 2026
Data Sourced
via Red Hat·02:30 PM
DescriptionSeverityAffected Software
CVE Published
via MITRE·07:44 PM
Data Sourced
via MITRE·07:44 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·08:17 PM
DescriptionSeverityWeakness
Sep 21, 2026
Data Sourced
via Launchpad·07:54 PM
Description
Data Sourced
via Debian·07:54 PM
DescriptionAffected Software
Sep 22, 2026
Data Sourced
via Ubuntu·07:54 PM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-16118?

CVE-2026-16118 has a high severity score of 7.1.

2

How do I fix CVE-2026-16118?

To fix CVE-2026-16118, update the xdgmime library to the latest version where the vulnerability is addressed.

3

What type of vulnerability is CVE-2026-16118?

CVE-2026-16118 is classified as a heap-based buffer overflow.

4

On which systems is CVE-2026-16118 exploitable?

CVE-2026-16118 is specifically exploitable on little-endian systems.

5

What is affected by CVE-2026-16118?

The flaw affects the _xdg_mime_magic_parse_magic_line() function in the xdgmimemagic.c file.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203