Add advisory: python-jose JWE CBC-HMAC padding oracle (all versions through 3.5.0)#7122
Open
yugui923 wants to merge 1 commit intogithub:yugui923/advisory-improvement-7122from
Conversation
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 padding oracle vulnerability in python-jose's JWE CBC-HMAC decryption.
Note: The GHSA ID is a placeholder (
GHSA-0000-0000-0001). 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:H/PR:N/UI:N/S:U/C:H/I:N/A:N(5.9 — Moderate)AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:NVulnerability details
_decrypt_and_auth()injose/jwe.pyperforms PKCS#7 CBC decryption before verifying the HMAC authentication tag. Tampered ciphertext with invalid padding raises"Invalid padding bytes."before the tag check, while valid padding with a wrong tag raises"Invalid JWE Auth Tag."This observable error difference enables a classic padding oracle attack recovering the full plaintext without the decryption key (~128 × N requests where N is ciphertext length in bytes).Additionally, the authentication tag comparison uses Python's
!=operator (not constant-time).This is the same vulnerability class as CVE-2021-29443 in the Node.js jose library (GHSA-58f5-hfqc-jgch), which was fixed in 2021.
Disclosure timeline
References