CVE-2023-6180 in tokio-boringinfo

Summary

by MITRE • 12/05/2023

The tokio-boring library in version 4.0.0 is affected by a memory leak issue that can lead to excessive resource consumption and potential DoS by resource exhaustion. The set_ex_data function used by the library did not deallocate memory used by pre-existing data in memory each time after completing a TLS connection causing the program to consume more resources with each new connection.

If you want to get the best quality for vulnerability data then you always have to consider VulDB.

Analysis

by VulDB Data Team • 12/05/2023

The tokio-boring library version 4.0.0 contains a critical memory management flaw that manifests as a persistent memory leak vulnerability. This issue specifically impacts applications that utilize the library for TLS connection handling, where each completed TLS session fails to properly release memory allocated through the set_ex_data function. The vulnerability operates at the core of memory allocation and deallocation mechanisms within the OpenSSL-based TLS implementation, creating a gradual but steady accumulation of unreleased memory segments that persist throughout the application lifecycle.

The technical root cause stems from improper memory deallocation practices within the library's TLS connection handling code. When the set_ex_data function is invoked during TLS operations, it stores application-specific data in memory structures associated with the connection context. However, upon connection termination, the library fails to execute the corresponding cleanup routine that would normally free pre-existing data structures. This design flaw creates a memory leak pattern where each new connection consumes additional memory without reclaiming resources from previous connections, leading to progressive memory consumption that grows linearly with the number of established connections.

From an operational perspective, this vulnerability presents a significant risk of resource exhaustion that can ultimately result in denial of service conditions. The memory leak compounds over time, particularly in applications that maintain numerous concurrent TLS connections or frequently establish new connections, such as web servers, proxy services, or any application using tokio-boring for secure communications. The impact extends beyond simple memory consumption as it can lead to application crashes, system instability, and service unavailability, especially in resource-constrained environments where memory management is critical for system performance.

Security practitioners should recognize this vulnerability as a variant of CWE-401 Memory Leak, which falls under the broader category of resource management flaws that can be exploited for denial of service attacks. The issue aligns with ATT&CK technique T1499.004 by enabling resource exhaustion attacks that can disrupt system availability. Organizations using tokio-boring version 4.0.0 should prioritize immediate remediation through library updates to versions that properly implement memory deallocation routines. Additionally, monitoring systems should be implemented to detect abnormal memory consumption patterns that may indicate this vulnerability's exploitation, particularly in high-traffic applications where the memory leak would be most pronounced. The fix typically involves ensuring proper cleanup of ex_data structures during TLS connection termination, which can be verified through memory profiling tools and stress testing of connection handling code paths.

Responsible

Cloudflare, Inc.

Reservation

11/16/2023

Disclosure

12/05/2023

Moderation

accepted

CPE

ready

EPSS

0.00619

KEV

no

Activities

very low

Sources

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!