Skip to content

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
yugui923:yugui923-python-jose-algorithm-confusion-der
Closed

Add advisory: python-jose algorithm confusion via DER keys (CVE-2024-33663 bypass)#7123
yugui923 wants to merge 1 commit intogithub:yugui923/advisory-improvement-7123from
yugui923:yugui923-python-jose-algorithm-confusion-der

Conversation

@yugui923
Copy link

@yugui923 yugui923 commented Mar 5, 2026

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

  • Package: python-jose (PyPI)
  • Affected: all versions through 3.5.0 (no fix exists; project appears unmaintained)
  • Related: CVE-2024-33663 (GHSA-6c5p-j8vq-pqhj)
  • CWE: CWE-327 (Use of Broken Crypto Algorithm), CWE-345 (Insufficient Verification of Data Authenticity)
  • CVSS v3.1: AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N (9.1 — Critical)
  • CVSS v4.0: AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N

Vulnerability 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 by CryptographyHMACKey and native HMACKey.

Combined with the default algorithms=None parameter in jwt.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.pyCryptographyHMACKey.__init__
  • jose/backends/native.pyHMACKey.__init__
  • jose/jwt.pyjwt.decode()

Disclosure timeline

  • 2026-02-17: Maintainer contacted via email
  • 2026-03-05: No response after 14+ days; repository has no SECURITY.md and no private vulnerability reporting

References

@github-actions github-actions bot changed the base branch from main to yugui923/advisory-improvement-7123 March 5, 2026 22:28
@yhidad31
Copy link

yhidad31 commented Mar 6, 2026

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!

@yhidad31 yhidad31 closed this Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants