CVE-2021-33880: Websockets Observable Timing Discrepancy Vulnerability
HIGHCVE-2021-33880 is a HIGH (CVSS 5.9) observable timing discrepancy vulnerability (CWE-203: Observable Discrepancy) affecting Websockets libraries in the PyPI ecosystem. The issue involves observable timing discrepancy in aaugustin websockets library. Remediation is available by upgrading affected packages to version 9.1.
CVE-2021-33880 at a Glance
Security Impact
CVSS: 5.9
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2021-33880
To remediate this vulnerability, upgrade all affected Websockets dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install websockets>=9.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show websockets
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2021-33880, inspect your installed packages using pip:
pip show websockets
Analyze the terminal output to locate any version of Websockets in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 9.1), your application is affected.
Note: The pip show websockets command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-203: Observable Discrepancy, where the product behaves differently or sends different responses under different circumstances in a way that is observable to an unauthorized actor. In Websockets, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2021-33880 Affected Websockets Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
websockets
|
PyPI |
< 9.1
|
9.1
|
References
Frequently Asked Questions
What is CVE-2021-33880?
Which Websockets versions are affected?
What version fixes CVE-2021-33880?
Is websockets affected?
What is the CVSS score of CVE-2021-33880?
What CWE is associated with CVE-2021-33880?
How can I check PyPI dependencies for CVE-2021-33880?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-8ch4-58qp-g3mp",
"modified" : "2024-11-19T18:19:55Z",
"published" : "2021-06-11T17:43:14Z",
"aliases" : [ "CVE-2021-33880" ],
"summary" : "Observable Timing Discrepancy in aaugustin websockets library",
"details" : "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=...). An attacker may be able to guess a password via a timing attack.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "websockets"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "9.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-33880"
}, {
"type" : "WEB",
"url" : "https://github.com/aaugustin/websockets/commit/547a26b685d08cac0aa64e5e65f7867ac0ea9bc0"
}, {
"type" : "WEB",
"url" : "https://github.com/aaugustin/websockets"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/websockets/PYSEC-2021-95.yaml"
}, {
"type" : "WEB",
"url" : "https://www.oracle.com/security-alerts/cpuapr2022.html"
}, {
"type" : "WEB",
"url" : "https://www.oracle.com/security-alerts/cpujan2022.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-203", "CWE-208" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-06-10T16:24:45Z",
"nvd_published_at" : "2021-06-06T15:15:00Z"
}
}