Bug 2587825 (CVE-2026-141180) - CVE-2026-141180 libmodulemd: libmodulemd: double free when parsing crafted module metadata
Summary: CVE-2026-141180 libmodulemd: libmodulemd: double free when parsing crafted mo...
Keywords:
Status: NEW
Alias: CVE-2026-141180
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-12-01 11:07 UTC by OSIDB Bzimport
Modified: 2026-12-01 11:28 UTC (History)
17 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2026-12-01 11:07:17 UTC
An external researcher reported (via JSM PSIRTSUPT-31690, with PoC, sanitizer output, backtraces and a proposed fix) a double free of a GError in libmodulemd's buildopts parsing. modulemd_buildopts_parse_yaml() in modulemd/modulemd-buildopts.c declares nested_error as g_autoptr(GError) and calls g_propagate_error(error, nested_error) without g_steal_pointer() (line 374 on main 2f75d47, identical in 2.13.0 and 2.15.0), so the autoptr cleanup frees the GError while the caller holds it; the caller then reads it via g_error_copy (use-after-free read) and frees it again (double free). Trigger: a modulemd document (v1 or v2) whose buildopts.rpms entry is not a mapping. Introduced in 2.7.0 (commit 1df0553, 2019); every release since is affected, including the versions shipped in RHEL 8 (2.13.0), RHEL 9 (2.13.0) and RHEL 10 (2.15.0). Reproduced by Product Security on Rocky Linux 10.2 with the shipped libmodulemd-2.15.0-12.el10 as an unprivileged user: modulemd-validator segfaults, and dnf makecache against a local repository whose modules metadata carries the crafted document segfaults with the chain dnf -> libdnf ModuleMetadata::addMetadataFromString -> modulemd_module_index_update_from_string -> g_error_copy. Valgrind on the unmodified RPM attributes both the use-after-free read in g_error_copy and the double free from the caller's autoptr to the buildopts autoptr cleanup; without the memory error the input is handled as an ordinary validation failure. Reachability: dnf parses repository modules metadata on every metadata refresh and dnf-makecache.timer is enabled by default, with repo_gpgcheck off by default, so an attacker controlling repository metadata (compromised mirror, network position on a plain-HTTP mirror path, or an administrator-added repository) can crash the process parsing it; on EL8/EL9 the reporter additionally observed glib slice freelist corruption with repeated crashes from cached metadata until dnf clean all (reporter evidence only). No code execution demonstrated; impact is denial of service. Fix: g_propagate_error(error, g_steal_pointer(&nested_error)) (reporter's patch, applies cleanly); four additional same-class sites in modulemd-yaml-util.c (g_propagate_prefixed_error with un-stolen autoptr on emitter error paths) should be fixed in the same commit. Proposed CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H = 5.9 (Moderate).


Note You need to log in before you can comment on or make changes to this bug.