Bug 2587477
| Summary: | CVE-2026-139844 glib2: glib2: Denial of Service via file descriptor exhaustion in GDBus [fedora-all] | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Marco Benatto <mbenatto> |
| Component: | glib2 | Assignee: | Matthias Clasen <mclasen> |
| Status: | NEW --- | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | rawhide | CC: | gnome-sig, mclasen, rhughes, rstrode |
| Target Milestone: | --- | Keywords: | Security, SecurityTracking |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | {"flaws": ["8384c885-cce3-4a30-ad7f-150c055aa55c"]} | ||
| Fixed In Version: | Doc Type: | --- | |
| Doc Text: | 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: | |||
| Bug Depends On: | |||
| Bug Blocks: | 2470419 | ||
Disclaimer: Community trackers are created by Red Hat Product Security team on a best effort basis. Package maintainers are required to ascertain if the flaw indeed affects their package, before starting the update process. AI_ONLY_REPORT package: glib2-2.80.4-12.el10 ------ Summary: Local DoS via SCM_RIGHTS FD Accumulation in GDBusWorker Read Path: a local peer can exhaust process file descriptors by repeatedly sending `SCM_RIGHTS` ancillary data that is accumulated before capability and message validation completes. Requirements to exploit: The attacker must be able to connect as an untrusted local peer to a UNIX socket used by a `GDBusConnection` in `glib2-2.80.4-12.el10`, and repeatedly send malformed or incomplete D-Bus traffic together with `SCM_RIGHTS` file descriptors. Component affected: `glib2-2.80.4-12.el10`, vendored `glib-2.80.4/gio/gdbusprivate.c`, `_g_dbus_worker_do_read_cb()` Version affected: `glib2-2.80.4-12.el10` on UNIX configurations where an untrusted local peer can reach a `GDBusConnection` over a UNIX socket Patch available: no released package fix established; proposed patch included below Version fixed: unknown Upstream coordination: Not notified. CVSS: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - 5.5 (MEDIUM) AV:L - Exploitation requires local access to a reachable UNIX socket endpoint. AC:L - The observed behavior does not require a race or unusual preconditions beyond maintaining a connection and sending ancillary FDs with malformed or partial input. PR:N - No prior privileges are required once the attacker can reach the socket. UI:N - No user interaction is required. S:U - The impact is confined to the vulnerable process and its resources. C:N - The available evidence does not show unauthorized data disclosure. I:N - The available evidence does not show unauthorized data modification. A:H - Repeated FD accumulation can drive the target process into `EMFILE` and service failure. Impact: Moderate. The issue can cause meaningful availability loss through file descriptor exhaustion, but the currently established attack is local-only and depends on a deployment that exposes a `GDBusConnection` over a UNIX socket to untrusted local peers. The available evidence does not support confidentiality, integrity, or broader system-compromise impact, so this is better classified as a configuration-dependent local denial of service rather than an Important or Critical issue. Embargo: no Reason: The demonstrated impact is limited to local denial of service, with practical mitigations available through local socket access controls and deployment hardening. Based on the available evidence, this does not appear to require embargoed handling. Acknowledgement: Aisle Research Vulnerability Details: In the affected read path, received `SCM_RIGHTS` descriptors are appended to `worker->read_fd_list` before the message is known to be valid and before receive-side enforcement of negotiated UNIX FD passing is evident: ```c else if (G_IS_UNIX_FD_MESSAGE (control_message)) { fds = g_unix_fd_message_steal_fds (fd_message, &num_fds); if (worker->read_fd_list == NULL) worker->read_fd_list = g_unix_fd_list_new_from_array (fds, num_fds); else for (n = 0; n < num_fds; n++) g_unix_fd_list_append (worker->read_fd_list, fds[n], NULL); } ``` If message decoding then fails, the worker emits disconnect and exits the read callback without immediately clearing `worker->read_fd_list`: ```c if (message == NULL) { _g_dbus_worker_emit_disconnected (worker, FALSE, error); goto out; } ``` The accumulated FD list is only released later during worker teardown: ```c if (worker->read_fd_list != NULL) g_object_unref (worker->read_fd_list); ``` Taken together, these behaviors allow a local peer to keep feeding malformed or incomplete input while attaching many file descriptors, causing attacker-controlled growth in the victim's open FD count before cleanup completes. The reachability and impact are strongest where the package is used on UNIX systems with a socket reachable by untrusted local users. Steps to reproduce: 1. Run a target that accepts untrusted local peers over a UNIX socket and uses `GDBusConnection`. 2. Connect as a local peer. 3. Repeatedly send small fragments, for example 1-byte chunks, and attach many `SCM_RIGHTS` file descriptors to each send. 4. Keep the D-Bus messages malformed or incomplete so the worker does not successfully deliver a valid decoded message. 5. Monitor the target process FD count until it rises substantially and failures such as `EMFILE` or service degradation appear. 6. As an optional verification step, log negotiated capabilities and confirm that the receive path still accepts attached FDs before effective capability enforcement. Mitigation: Until a code fix is available, avoid exposing affected UNIX-socket `GDBusConnection` endpoints to untrusted local peers. Restrict socket filesystem permissions and peer access so only trusted local principals can connect. Where practical, apply process-level resource controls to reduce the impact of FD exhaustion. Proposed Fix: Reject ancillary UNIX FDs when `G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING` was not negotiated, and clear any accumulated `worker->read_fd_list` on fatal decode paths before disconnect handling. ```diff diff --git a/gio/gdbusprivate.c b/gio/gdbusprivate.c @@ +static void +clear_read_fd_list_unlocked (GDBusWorker *worker) +{ +#ifdef G_OS_UNIX + if (worker->read_fd_list != NULL) + { + g_object_unref (worker->read_fd_list); + worker->read_fd_list = NULL; + } +#endif +} @@ _g_dbus_worker_do_read_cb (...) #ifdef G_OS_UNIX else if (G_IS_UNIX_FD_MESSAGE (control_message)) { GUnixFDMessage *fd_message; gint *fds; gint num_fds; + gint i; fd_message = G_UNIX_FD_MESSAGE (control_message); fds = g_unix_fd_message_steal_fds (fd_message, &num_fds); + if (!(worker->capabilities & G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING)) + { + for (i = 0; i < num_fds; i++) + (void) g_close (fds[i], NULL); + g_free (fds); + g_set_error (&error, G_IO_ERROR, G_IO_ERROR_FAILED, + "Received UNIX_FD ancillary data without negotiated capability"); + clear_read_fd_list_unlocked (worker); + _g_dbus_worker_emit_disconnected (worker, TRUE, error); + g_error_free (error); + goto out; + } if (worker->read_fd_list == NULL) worker->read_fd_list = g_unix_fd_list_new_from_array (fds, num_fds); @@ if (message == NULL) { + clear_read_fd_list_unlocked (worker); _g_dbus_worker_emit_disconnected (worker, FALSE, error); g_error_free (error); goto out; } ``` ------ This report was generated using AI technology. Always review AI-generated content prior to use