You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Algorithm validation is optional - potential signature verification bypass #424
The algorithm validation in _verify_signature() at jose/jws.py line 258 is conditional and can be bypassed.
Details
The current code only validates the algorithm when algorithms is not None:
ifalgorithmsisnotNoneandalgnotinalgorithms:
raiseJWSError("The specified alg value is not allowed")
When algorithms is None (or not provided), the function accepts any algorithm from the JWT header without validation.
Impact
This could allow signature verification to succeed with unexpected or weaker algorithms than intended, potentially leading to security issues depending on how the library is used.
Suggested Fix
Consider making algorithm validation mandatory or enforcing a secure default list of allowed algorithms.
Environment
Library: python-jose
Affected code: jose/jws.py, _verify_signature() function
Activity