Timing Attack Vulnerability in Python Websockets Package

python-websockets Updated 02 Oct 2025

Summary

06/06/2021
N/A
Yes i
Unrated
Not published

DEBIAN-CVE-2021-33880: The aaugustin websockets library before 9.1 for Python has an Observable Timing Discrepancy on servers when HTTP Basic Authentication is enabled with basic_auth_protocol_factory(credentials=...). Affects python-websockets versions < 8.1-1+deb11u1. Fixed in 8.1-1+deb11u1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

The Python Websockets package is a popular library used for building WebSocket servers and clients in Python. It provides an easy-to-use interface for real-time communication between clients and servers. The library is widely utilized in applications requiring persistent connections, such as chat applications and live data feeds. However, a vulnerability has been identified in versions prior to 9.1, which exposes users to potential timing attacks when HTTP Basic Authentication is enabled.

Vulnerability Detail

The vulnerability, identified as DEBIAN-CVE-2021-33880, arises from an Observable Timing Discrepancy in the aaugustin websockets library before version 9.1. When HTTP Basic Authentication is enabled with the basic_auth_protocol_factory(credentials=...) function, an attacker may exploit this timing discrepancy to guess passwords through a timing attack. This could lead to unauthorized access to sensitive information and compromise the security of the application.

How To Fix

Minimum fixed version

8.1-1+deb11u1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python-websockets

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If immediate upgrading is not feasible, consider disabling HTTP Basic Authentication in your application to mitigate the risk of timing attacks until the package can be updated.

Conclusion

The timing attack vulnerability in the Python Websockets package poses a significant risk to applications utilizing HTTP Basic Authentication. It is crucial to update to the latest patched version to safeguard against potential attacks. Users should also consider temporary workarounds if immediate updates are not possible.

See every vulnerability recorded for python-websockets →

Share this vulnerability

FAQ

The vulnerability is a timing attack that allows an attacker to guess passwords through observable timing discrepancies when using HTTP Basic Authentication.

Versions prior to 9.1 of the Python Websockets package are affected by this vulnerability.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

If you cannot update the package, consider disabling HTTP Basic Authentication as a temporary workaround to reduce the risk.

Related vulnerabilities

Recent vulnerabilities recorded for python-websockets.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

8.1-1+deb11u1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python-websockets

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback