Bug 2587639
| Summary: | CVE-2026-140124 mingw-glib2: Unbounded authentication line read in GDBus client enables memory exhaustion denial of service [fedora-all] | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Marco Benatto <mbenatto> |
| Component: | mingw-glib2 | Assignee: | Kalev Lember <kalevlember> |
| Status: | NEW --- | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | rawhide | CC: | fedora, kalevlember, manisandro, marcandre.lureau, rich |
| Target Milestone: | --- | Keywords: | Security, SecurityTracking |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | {"flaws": ["d096e5b5-8427-4783-bb38-9c2fc8830739"]} | ||
| 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: | 2465558 | ||
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: Unbounded Authentication Line Read in GDBus Client Enables Memory-Exhaustion DoS: a malicious D-Bus peer can send an unterminated authentication line during client authentication and force unbounded memory growth until allocation failure, OOM termination, or process crash. Requirements to exploit: An attacker must control, impersonate, or induce use of a D-Bus endpoint that the victim client connects to, then send a very long authentication line without `\r\n` and keep the connection open. No prior authentication is required, but a user or application must initiate the client connection. Component affected: `glib2-2.80.4-12.el10`, `gio/gdbusauth.c`, client authentication handling in `_g_dbus_auth_run_client()` Version affected: `glib2-2.80.4-12.el10` when its GDBus client code is used to connect to an attacker-controlled endpoint Patch available: no released package fix established; proposed patch included below Version fixed: unknown Upstream coordination: Not notified. CVSS: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H - 6.5 (MEDIUM) AV:N - The issue is reachable across supported D-Bus transports when a client connects to a hostile network-reachable endpoint. AC:L - The attack requires only sending a newline-free authentication line and keeping the socket open. PR:N - The peer triggers the issue before authentication succeeds. UI:R - A user or application must initiate a connection to the attacker-controlled endpoint. S:U - The impact is limited to the vulnerable client process. C:N - No confidentiality impact is established from the available evidence. I:N - No integrity impact is established from the available evidence. A:H - The client can be driven into sustained memory growth until failure or termination. Impact: Moderate. This is a real availability issue in the scanned SRPM package, but the evidence supports a client-side denial of service rather than broader compromise. Under Red Hat's severity guidance, remote DoS issues can rate as Important, but this case is materially constrained by deployment: exploitation depends on a client connecting to an attacker-controlled endpoint, which is not the typical trusted local-bus case. That makes Moderate the more defensible rating on the available technical evidence. Embargo: no Reason: The demonstrated impact is a client-side DoS with practical interim mitigations, and exploitation requires the victim to connect to an attacker-controlled endpoint. This does not appear to require embargo handling. Acknowledgement: Aisle Research Vulnerability Details: During client-side D-Bus authentication, the code reads peer-controlled protocol lines without enforcing a maximum line length: ```c line = _my_g_data_input_stream_read_line (dis, &line_length, cancellable, error); ``` The client then processes authentication responses such as `REJECTED ...` from the peer before authentication completes. In this codebase, the underlying line-reading path grows its internal buffer until newline or EOF, including doubling the buffered input size when full. As a result, a malicious peer can send a very large newline-free authentication line and keep the connection open, causing memory usage to grow until the client hits allocation failure, is OOM-killed, or crashes. This is best understood as an unauthenticated, peer-triggered resource-exhaustion flaw in the GDBus client authentication path. The available evidence supports availability impact only. Reachability is configuration- and deployment-dependent: the issue matters when applications use this package's GDBus client functionality against attacker-controlled endpoints, not when they are limited to trusted local buses. Steps to reproduce: 1. Build or use `glib2-2.80.4-12.el10`. 2. Run a fake server that accepts one TCP connection, performs the initial NUL-byte handshake flow expected by the client, then sends `b"REJECTED " + b"A"*200_000_000` without `\r\n`, and keeps the socket open. 3. From a client, call `g_dbus_connection_new_for_address_sync("tcp:host=127.0.0.1,port=<port>", G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT, NULL, NULL, &error)`. 4. Observe the client process's RSS grow continuously during authentication until allocation failure, OOM kill, or crash. 5. As a control, repeat the test with short CRLF-terminated authentication lines and observe that the unbounded memory growth does not occur. Mitigation: Avoid connecting GDBus clients to untrusted or attacker-controlled endpoints until a fix is available. Prefer trusted local bus transports where possible. If an application must speak to less-trusted peers, add external connection policy, input filtering, or process memory limits so a single malicious authentication exchange cannot terminate the client unexpectedly. Proposed Fix: A post-read length check is insufficient because the allocation has already occurred. The bound should be enforced while the line is being read. ```diff diff --git a/gio/gdbusauth.c b/gio/gdbusauth.c index XXXXXXX..YYYYYYY 100644 — a/gio/gdbusauth.c +++ b/gio/gdbusauth.c @@ -269,6 +269,8 @@ _g_dbus_auth_new (GIOStream *stream) /* ---------------------------------------------------------------------------------------------------- */ /* like g_data_input_stream_read_line() but sets error if there's no content to read */ +#define _G_DBUS_AUTH_MAX_LINE_LENGTH (16 * 1024) + static gchar * _my_g_data_input_stream_read_line (GDataInputStream *dis, gsize *out_line_length, @@ -334,6 +336,17 @@ _my_g_input_stream_read_line_safe (GInputStream *i, goto fail; } + if (G_UNLIKELY (str->len >= _G_DBUS_AUTH_MAX_LINE_LENGTH)) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + _("Authentication line too long (%u bytes max)"), + (guint) _G_DBUS_AUTH_MAX_LINE_LENGTH); + goto fail; + } + g_string_append_c (str, (gint) c); if (last_was_cr) { @@ -584,7 +597,6 @@ _g_dbus_auth_run_client (GDBusAuth *auth, gchar *s; GDataInputStream *dis; GDataOutputStream *dos; @@ -607,11 +619,8 @@ _g_dbus_auth_run_client (GDBusAuth *auth, dis = G_DATA_INPUT_STREAM (g_data_input_stream_new (g_io_stream_get_input_stream (auth->priv->stream))); dos = G_DATA_OUTPUT_STREAM (g_data_output_stream_new (g_io_stream_get_output_stream (auth->priv->stream))); g_filter_input_stream_set_close_base_stream (G_FILTER_INPUT_STREAM (dis), FALSE); g_filter_output_stream_set_close_base_stream (G_FILTER_OUTPUT_STREAM (dos), FALSE); - g_data_input_stream_set_newline_type (dis, G_DATA_STREAM_NEWLINE_TYPE_CR_LF); @@ -647,7 +656,8 @@ _g_dbus_auth_run_client (GDBusAuth *auth, line = _my_g_data_input_stream_read_line (dis, &line_length, cancellable, error); + line = _my_g_input_stream_read_line_safe (g_io_stream_get_input_stream (auth->priv->stream), + &line_length, cancellable, error); @@ -690,7 +700,8 @@ _g_dbus_auth_run_client (GDBusAuth *auth, line = _my_g_data_input_stream_read_line (dis, &line_length, cancellable, error); + line = _my_g_input_stream_read_line_safe (g_io_stream_get_input_stream (auth->priv->stream), + &line_length, cancellable, error); @@ -746,7 +757,8 @@ _g_dbus_auth_run_client (GDBusAuth *auth, line = _my_g_data_input_stream_read_line (dis, &line_length, cancellable, error); + line = _my_g_input_stream_read_line_safe (g_io_stream_get_input_stream (auth->priv->stream), + &line_length, cancellable, error); @@ -787,7 +799,8 @@ _g_dbus_auth_run_client (GDBusAuth *auth, line = _my_g_data_input_stream_read_line (dis, &line_length, cancellable, error); + line = _my_g_input_stream_read_line_safe (g_io_stream_get_input_stream (auth->priv->stream), + &line_length, cancellable, error); @@ -828,7 +841,6 @@ out: g_object_unref (dis); g_object_unref (dos); ``` ------ This report was generated using AI technology. Always review AI-generated content prior to use