Agreed. Unfortunately, some implementations missed that:
https://github.com/namshi/jose/commit/127b4415e66d89b1fcfb5a...
https://github.com/davedoesdev/python-jwt/commit/5ddb71b2ed5...
https://github.com/namshi/jose/commit/127b4415e66d89b1fcfb5a...
https://github.com/davedoesdev/python-jwt/commit/5ddb71b2ed5...
The docs did say:
returns: ``(header, claims)`` if the token was verified successfully. The token must pass the following tests:
- Its signature must verify using the public key or its algorithm must be ``none``.
but passing the responsibility for checking header['alg'] to the caller was the wrong way round so thanks again!News at 5: Library for securing tokens doesn't secure tokens.