Add advisory: python-jose algorithm confusion via DER keys (CVE-2024-33663 bypass)#7123
Closed
yugui923 wants to merge 1 commit intogithub:yugui923/advisory-improvement-7123from
Conversation
|
Hello @yugui923, thanks for bringing this to our attention. However, this is not the appropriate channel for reporting security vulnerabilities. To ensure your report is appropriately handled, please refer to Privately reporting a security vulnerability where there are instructions for repositories that don't have private vulnerability reporting enabled. Thank you so much for contributing to the GitHub Advisory Database. This database is free, open, and accessible to all, and it's people like you who make it great. Thanks for choosing to help others. We hope you send in more contributions in the future! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New advisory submission
New advisory for a JWT algorithm confusion attack in python-jose when RSA public keys are provided in DER (binary) format. This bypasses the incomplete fix for CVE-2024-33663 (GHSA-6c5p-j8vq-pqhj).
Note: The GHSA ID is a placeholder (
GHSA-0000-0000-0002). Please assign a proper GHSA ID during review. The repository (mpdavis/python-jose) does not have private vulnerability reporting enabled, so this advisory is being submitted directly here.Summary
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N(9.1 — Critical)AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:NVulnerability details
The fix for CVE-2024-33663 (PR #369) added key format checks for PEM (
is_pem_format()) and SSH (is_ssh_key()) formats in the HMAC key constructors, but did not cover DER-encoded keys. DER-encoded asymmetric keys pass both checks and are accepted as HMAC secrets byCryptographyHMACKeyand nativeHMACKey.Combined with the default
algorithms=Noneparameter injwt.decode(), which trusts the algorithm specified in the token header, an attacker who knows the RSA public key (from JWKS endpoints, certificates, etc.) can forge arbitrary JWT tokens signed with HS256 using the DER public key bytes as the HMAC secret. This enables authentication bypass and privilege escalation.Affected components
jose/backends/cryptography_backend.py—CryptographyHMACKey.__init__jose/backends/native.py—HMACKey.__init__jose/jwt.py—jwt.decode()Disclosure timeline
References