GHSA-3ww4-gg4f-jr7f CVE-2023-50782 PYSEC-2026-1283
Python Cryptography package vulnerable to Bleichenbacher timing oracle attack
- Severity
- 8.7 / 10
- High · CVSS 4.0
- Exploit chance (EPSS)
- 1.12%
- Chance of exploitation in the next 30 days. Higher than 66.14% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-203 Observable Discrepancy
- CWE-208 Observable Timing Discrepancy
- CWE-385 Covert Timing Channel
- Fix
42.0.0- Upgrade cryptography to this version or later
Description
A flaw was found in the python-cryptography package. This issue may allow a remote attacker to decrypt captured messages in TLS servers that use RSA key exchanges, which may lead to exposure of confidential or sensitive data.
Affected versions
PyPI
| Package | Vulnerable | Fixed in |
|---|---|---|
| cryptography | < 42.0.0 |
42.0.0 |
| cryptography | < 42.0.0 |
42.0.0 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
cryptography PyPI → 42.0.0
- pip
pip install --upgrade "cryptography>=42.0.0"- poetry
poetry add "cryptography>=42.0.0"- uv
uv add "cryptography>=42.0.0"
Severity breakdown
CVSS 4.0 8.7
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
- Attack vector
- Network
- Attack complexity
- Low
- Attack requirements
- None
- Privileges required
- None
- User interaction
- None
- Confidentiality (vulnerable system)
- High
- Integrity (vulnerable system)
- None
- Availability (vulnerable system)
- None
- Confidentiality (subsequent systems)
- None
- Integrity (subsequent systems)
- None
- Availability (subsequent systems)
- None
CVSS 3.1 7.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- None
- Availability
- None
Weakness
CWE-203: Observable Discrepancy
The product behaves differently or sends different responses under different circumstances in a way that is observable to an unauthorized actor.
How to prevent it
- Architecture and Design: Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area. Ensure that appropriate compartmentalization is built into the system design, and the compartmentalization allows for and reinforces privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide the appropriate time to use privileges and the time to drop privileges.
- Implementation: Ensure that error messages only contain minimal details that are useful to the intended audience and no one else. The messages need to strike the balance between being too cryptic (which can confuse users) or being too detailed (which may reveal more than intended). The messages should not reveal the methods that were used to determine the error. Attackers can use detailed information to refine or optimize their original attack, thereby increasing their chances of success. If errors must be captured in some detail, record them in log messages, but consider what could occur if the log messages can be viewed by attackers. Highly sensitive information such as passwords should never be saved to log files. Avoid inconsistent messaging that might accidentally tip off an attacker about internal state, such as whether a user account exists or not.
CWE-208: Observable Timing Discrepancy
Two separate operations in a product require different amounts of time to complete, in a way that is observable to an actor and reveals security-relevant information about the state of the product, such as whether a particular operation was successful or not.
CWE-385: Covert Timing Channel
Covert timing channels convey information by modulating some aspect of system behavior over time, so that the program receiving the information can observe system behavior and infer protected information.
How to prevent it
- Architecture and Design: Whenever possible, specify implementation strategies that do not introduce time variances in operations.
- Implementation: Often one can artificially manipulate the time which operations take or -- when operations occur -- can remove information from the attacker.
- Implementation: It is reasonable to add artificial or random delays so that the amount of CPU time consumed is independent of the action being taken by the application.
References
Advisories
Packages
Other links
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-m2h6-j472-rp4c python-cryptography verifier accepts wildcard DNS names allowing escape from permittedSubtrees | Medium | Also affects cryptography |
| GHSA-jwv3-5hgf-82ww python-cryptography: Duplicate self-signed intermediates can cause exponential path-building | High | Also affects cryptography |
| GHSA-g6cj-pr64-35w5 cryptography: PKCS#7 EnvelopedData decryption exposes a Bleichenbacher oracle through distinguishable errors and timing | High | Also affects cryptography |
| GHSA-537c-gmf6-5ccf Vulnerable OpenSSL included in cryptography wheels | High | Also affects cryptography |
| GHSA-p423-j2cm-9vmq Cryptography vulnerable to buffer overflow if non-contiguous buffers were passed to APIs | Medium | Also affects cryptography |
| GHSA-m959-cc7f-wv43 cryptography has incomplete DNS name constraint enforcement on peer names | Low | Also affects cryptography |
| GHSA-r6ph-v2qm-q3c2 cryptography Vulnerable to a Subgroup Attack Due to Missing Subgroup Validation for SECT Curves | High | Also affects cryptography |
| GHSA-79v4-65xg-pq4g Vulnerable OpenSSL included in cryptography wheels | Medium | Also affects cryptography |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor