Bug 2587825 (CVE-2026-141180)

Summary: CVE-2026-141180 libmodulemd: libmodulemd: double free when parsing crafted module metadata
Product: [Other] Security Response Reporter: OSIDB Bzimport <bzimport>
Component: vulnerabilityAssignee: Product Security <prodsec-ir-bot>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: akhatavk, aos-team-art-private, asdas, dpaolell, jdelft, jupierce, lgarciaa, mbiarnes, ppalepu, ppostler, prdhamdh, rhel-process-autobot, sghai, sidsharm, suppawar, vlaad, watson-tool-maintainers
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
A flaw was found in libmodulemd. When parsing a module metadata document containing a malformed build options entry, an error object is freed twice, causing the application parsing the document to crash. An attacker able to control repository metadata consumed by a system using dnf can use this flaw to cause a denial of service of the package management tooling.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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).