Fedora Account System
Red Hat Associate
Red Hat Customer
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: glib-networking-2.80.0-3.el10 ------ Summary: Unbounded Memory Growth in TLS 1.3 Session Ticket Queue: a malicious or compromised TLS 1.3 server can cause a glib-networking client to accumulate an unbounded number of cached session tickets for one host during the cache lifetime, leading to process memory exhaustion and denial of service. Requirements to exploit: The victim must use `glib-networking-2.80.0-3.el10` as a TLS client with session resumption enabled and connect to a TLS 1.3 server controlled by, or acting on behalf of, the attacker. The server must send excessive `NewSessionTicket` messages for the same client-side `session_id`. Repeated connections to the same host identity make the imbalance easier to sustain because each lookup removes only one queued ticket. Component affected: `glib-networking-2.80.0-3.el10`, primarily `tls/base/gtlssessioncache.c` in `g_tls_store_session_data()` and `g_tls_lookup_session_data()`, with reachable call paths from `tls/gnutls/gtlsclientconnection-gnutls.c` and `tls/openssl/gtlsclientconnection-openssl.c`. Version affected: `glib-networking-2.80.0-3.el10` 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:N/S:U/C:N/I:N/A:H - 7.5 (HIGH) AV:N - The triggering input is delivered by a remote TLS server over the network. AC:L - No unusual preconditions are required beyond causing the client to process excessive TLS 1.3 session tickets. PR:N - The attacker does not need privileges on the client. UI:N - No additional user action is needed after the client initiates the TLS connection. S:U - The impact is confined to the vulnerable client process using the library. C:N - No confidentiality impact is established by the available evidence. I:N - No integrity impact is established by the available evidence. A:H - The queue can grow until the client process experiences significant memory pressure or denial of service. Impact: Important. The established impact is remote denial of service against client applications using this package. Red Hat guidance classifies flaws that allow remote users to cause denial of service as Important when the effect can compromise availability. This issue does not show code execution or confidentiality/integrity impact, so Critical is not justified. Although exploitation depends on the client connecting to a malicious or compromised TLS 1.3 endpoint, the vulnerable behavior is present in normal client-side operation and session resumption is enabled by default outside tests. Embargo: no Reason: The demonstrated impact is availability loss in client processes, with straightforward mitigation and no evidence of confidential data exposure, integrity impact, or system compromise. Acknowledgement: Aisle Research Vulnerability Details: `g_tls_store_session_data()` creates a per-`session_id` queue for TLS 1.3 tickets and appends every new ticket without any per-host bound. The global cache limit of 50 entries constrains the number of host identities in the table, but it does not constrain the number of TLS 1.3 tickets retained for a single host. Later, `g_tls_lookup_session_data()` removes only one queued ticket per lookup. If a server issues tickets faster than the client consumes them, memory usage grows monotonically for that host. ```c #define SESSION_CACHE_MAX_SIZE 50 #define SESSION_CACHE_MAX_AGE (10ll * 60ll * G_USEC_PER_SEC) /* ten minutes */ ... if ((protocol_version >= G_TLS_PROTOCOL_VERSION_TLS_1_3 && protocol_version < G_TLS_PROTOCOL_VERSION_DTLS_1_0) || protocol_version > G_TLS_PROTOCOL_VERSION_DTLS_1_2) { g_queue_push_tail (cache_data->tls1_3_session_tickets, session_data_tmp); } ``` ```c /* Note that session tickets should be used only once since TLS 1.3, so we remove from the queue after retrieval. See RFC 8446 §C.4. */ session_data = g_queue_pop_head (cache_data->tls1_3_session_tickets); ``` Session resumption is enabled by default outside tests through the `session-resumption-enabled` property. Both supported client backends store tickets in this shared cache: the GnuTLS path calls `g_tls_store_session_data()` from `handshake_thread_session_ticket_received_cb()`, and the OpenSSL path calls it from `g_tls_client_connection_openssl_new_session()`. A relevant limiting factor is that cache entries expire after ten minutes, and the expiration time is set when the host entry is created. The available code does not refresh that expiration time on subsequent ticket stores. This means the growth is not permanent, but it remains numerically unbounded within the cache lifetime and can still be large enough to exhaust memory in a client process before expiry. Steps to reproduce: 1. Build the package with debug symbols or temporary logging enabled. 2. Add temporary logging in `g_tls_store_session_data()` to print `g_queue_get_length (cache_data->tls1_3_session_tickets)` after each TLS 1.3 ticket is queued. 3. Run a TLS 1.3 server you control that emits many `NewSessionTicket` messages after a successful handshake. 4. Run any client linked against this package with session resumption enabled and connect repeatedly to the same host identity so the same `session_id` is reused. 5. Observe that the queue length for that host grows while `g_tls_lookup_session_data()` removes only one ticket per reconnect. 6. Monitor client RSS and confirm increasing memory consumption over time. 7. As a control, disable session resumption and verify that the queue growth stops. Mitigation: Until a package fix is available, disable TLS session resumption for affected client workloads where possible, or avoid connecting those clients to untrusted TLS 1.3 endpoints that can emit arbitrary numbers of session tickets. Deployments that do not use the client-side TLS session cache or do not negotiate TLS 1.3 are not exposed to this code path. Proposed Fix: Introduce a per-host cap for queued TLS 1.3 session tickets and evict the oldest entries before appending new ones. ```diff diff --git a/tls/base/gtlssessioncache.c b/tls/base/gtlssessioncache.c — a/tls/base/gtlssessioncache.c +++ b/tls/base/gtlssessioncache.c @@ -44,6 +44,7 @@ static GHashTable client_session_cache; / (owned) GString -> (owned) GTlsCacheData */ #define SESSION_CACHE_MAX_SIZE 50 #define SESSION_CACHE_MAX_AGE (10ll * 60ll * G_USEC_PER_SEC) /* ten minutes */ +#define SESSION_CACHE_MAX_TLS13_TICKETS_PER_HOST 32 @@ -154,6 +155,15 @@ g_tls_store_session_data (gchar *session_id, protocol_version > G_TLS_PROTOCOL_VERSION_DTLS_1_2) { + while (g_queue_get_length (cache_data->tls1_3_session_tickets) >= + SESSION_CACHE_MAX_TLS13_TICKETS_PER_HOST) + { + gpointer evicted = g_queue_pop_head (cache_data->tls1_3_session_tickets); + if (evicted && cache_data->dec_ref) + cache_data->dec_ref (evicted); + } + g_queue_push_tail (cache_data->tls1_3_session_tickets, session_data_tmp); } ``` ------ This report was generated using AI technology. Always review AI-generated content prior to use