pyjwt

JSON Web Token implementation in Python

MIT License

Downloads
201.4M
Stars
4.9K
Committers
150

Bot releases are hidden (Show)

pyjwt - v1.5.1

Published by jpadilla over 7 years ago

Changed

  • Change optparse for argparse. #238

Fixed

  • Guard against PKCS1 PEM encododed public keys #277
  • Add deprecation warning when decoding without specifying algorithms #277
  • Improve deprecation messages #270
  • PyJWT.decode: move verify param into options #271

Added

  • Support for Python 3.6 #262
  • Expose jwt.InvalidAlgorithmError #264
pyjwt - v1.5.0

Published by jpadilla over 7 years ago

Changed

  • Add support for ECDSA public keys in RFC 4253 (OpenSSH) format #244
  • Renamed commandline script jwt to jwt-cli to avoid issues with the script clobbering the jwt module in some circumstances. #187
  • Better error messages when using an algorithm that requires the cryptography package, but it isn't available #230
  • Tokens with future 'iat' values are no longer rejected #190
  • Non-numeric 'iat' values now raise InvalidIssuedAtError instead of DecodeError
  • Remove rejection of future 'iat' claims #252

Fixed

  • Add back 'ES512' for backward compatibility (for now) #225
  • Fix incorrectly named ECDSA algorithm #219
  • Fix rpm build #196

Added

  • Add JWK support for HMAC and RSA keys #202
pyjwt - v1.4.2

Published by mark-adams about 8 years ago

Bugfix release

pyjwt - v1.3.0

Published by mark-adams over 9 years ago

Fixed

  • ECDSA (ES256, ES384, ES512) signatures are now being properly serialized [#158][
  • RSA-PSS (PS256, PS384, PS512) signatures now use the proper salt length for PSS padding. [#163]

Added

  • Added a new jwt.get_unverified_header() to parse and return the header portion of a token prior to signature verification.

Removed

  • Python 3.2 is no longer a supported platform. This version of Python is rarely used. Users affected by this should upgrade to 3.3+.
pyjwt - v1.2.0

Published by mark-adams over 9 years ago

Fixed

  • Added back verify_expiration= argument to jwt.decode() that was erroneously removed in 1.1.0.

Changed

  • Refactored JWS-specific logic out of PyJWT and into PyJWS superclass. [#141]

Deprecated

  • verify_expiration= argument to jwt.decode() is now deprecated and will be removed in a future version. Use the option= argument instead.
pyjwt - v1.1.0

Published by mark-adams over 9 years ago

Added

  • Added support for PS256, PS384, and PS512 algorithms. [#132]
  • Added flexible and complete verification options during decode. [#131]
  • Added this CHANGELOG.md file.

Deprecated

  • Deprecated usage of the .decode(..., verify=False) parameter.

Fixed

  • Fixed command line encoding. [#128]
pyjwt - v1.0.1

Published by jpadilla over 9 years ago

Changelog

  • [BUGFIX] Include jwt/contrib' andjwt/contrib/algorithms` when installing. Ref 882524d845349df532e2a96b30fbe7e74e6ff55c
pyjwt - v1.0.0

Published by jpadilla over 9 years ago

Changelog

  • [CLEANUP] Removed api.header. #85
  • [DOCS] README details how to extract public / private keys from an x509 certificate. #100
  • [ENHANCEMENT] Refactor api.py functions into an object (PyJWT). #101
  • [ENHANCEMENT] Support PyCrypto and ecdsa when cryptography isn't available. #103
  • [SECURITY] Added some fixes related to algorithm and key choice. #109
  • [SECURITY] Added support for whitelist validation of the alg header. #110

Security

A security researcher has notified JSON Web Token library maintainers about a number of vulnerabilities allowing attackers to bypass the verification step. Read more about some of this issues here.

This release fixes the vulnerabilities reported, continue reading for details.

None algorithm

Applies if you

  • rely on and do not validate the alg field in the token header.
  • implement the "none" algorithm.

Impact

Attackers can craft a malicious token containing an arbitrary payload that passes the verification step.

Exploit

Create a token with the header {"typ":"JWT","alg":"none"}. Include any payload. Do not include a signature (i.e. the token should end with a period). Note: some implementations include some basic but insufficient checking for a missing signature -- some minor fiddling may be required to produce an exploit.

Asymmetric key of a token signed with a symmetric key

Applies if you

  • rely on and do not validate the alg field in the token header.
  • implement at least one of the HMAC algorithms and at least one of the asymmetric algorithms (e.g. HS256 and RS256).

Impact

If the system is expecting a token signed with one of the asymmetric algorithms, an attacker can bypass the verification step by knowing only the public key.

Exploit

Create an HS256 token. Generate the HMAC signature using the literal bytes of the public key file (often in the PEM format). This will confuse the implementation into interpreting the public key file as an HMAC key.

This release was possible thanks to the awesome @mark-adams.

pyjwt - v0.4.2

Published by jpadilla over 9 years ago

  • Include LICENSE and AUTHORS in the release tarball. #94
  • PyPI package cleanup #91
pyjwt - v0.4.1

Published by jpadilla almost 10 years ago

  • [Fix] Invalid validation of audience claim. #72
  • [Enhancement] Verify that decoded header and payload are JSON objects. #66
  • [Enhancement] Use constant time string comparison routine from hmac module. #64
  • [Enhancement] Add base exception InvalidTokenError for invalid tokens. #60
  • [Enhancement] Allow datetime.timedelta for leeway argument. #56

Pending Deprecation

The following exceptions have been marked for deprecation in favor of a renamed one to follow a better convention and will be removed in the next major version release.

  • ExpiredSignature will be deprecated in favor of ExpiredSignatureError.
  • InvalidAudience will be deprecated in favor of InvalidAudienceError.
  • InvalidIssuer will be deprecated in favor of InvalidIssuerError.

Thanks to @mark-adams and @wbolster for all the work and feedback that went into this release.

pyjwt - v0.4.0

Published by jpadilla almost 10 years ago

Switch from PyCrypto to cryptography.

PR: #51 by @mark-adams

pyjwt - v0.3.2

Published by jpadilla almost 10 years ago

Allow using a custom JSON encoder in jwt.encode()

PR #49 by @defyrlt
Ref #37

Example

import json
import decimal
import jwt


class CustomJSONEncoder(json.JSONEncoder):
    def default(self, o):
        if isinstance(o, decimal.Decimal):
            return float(o)
        return super(CustomJSONEncoder, self).default(o)

data = {
    'some_decimal': decimal.Decimal('2.2')
}

token = jwt.encode(data, 'secret', json_encoder=CustomJSONEncoder)
pyjwt - v0.3.1

Published by jpadilla almost 10 years ago

  • Let header() support unicode input, like decode(). #48
pyjwt - 0.3.0

Published by jpadilla almost 10 years ago

  • Add support for the "nbf" (Not Before) Claim by @skion.
  • Add support for encoding Plaintext JWTs (decode them with verify=False) by @skion.
  • Add support for Elliptic Curve signatures (ES256 / ES384 / ES512) by @sullivanmatt.
  • Fix import and reference of datetime functions in README by @glarrain.
  • Add support for the "aud" (Audience) Claim.
  • Add support for the "iss" (Issuer) Claim.
pyjwt -

Published by jpadilla about 10 years ago

  • Allow keys of type "bytes" in Python 3 by @cjlarose
pyjwt -

Published by progrium over 10 years ago