Skip to content

chore: raise the minimum jwcrypto to 1.6.3 - #192

Open
frederikprijck wants to merge 2 commits into
mainfrom
chore/raise-jwcrypto-minimum
Open

frederikprijck wants to merge 2 commits into
mainfrom
chore/raise-jwcrypto-minimum

Conversation

@frederikprijck

@frederikprijck frederikprijck commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Changes

Raise the declared jwcrypto minimum from ^1.5.7 to ^1.6.3. This is the first release with all the security fixes since 1.5.7 (CVE-2026-80179 (fixed in 1.5.9), CVE-2026-84185 (1.6.0), CVE-2026-92091 (1.6.1) and CVE-2026-142105 (1.6.3); the last affects every release up to 1.6.2) and, like 1.5.9 and later, parses a JWKS containing keys of an unknown type and supports newer JOSE algorithms and the AKP key type without requiring a newer cryptography than this repo declares. There is no major version bump and no source change.

  • pyproject.toml: jwcrypto = "^1.5.7" -> "^1.6.3"
  • requirements.txt: jwcrypto>=1.5.6,<2.0.0 -> >=1.6.3,<2.0.0 (kept in step with pyproject.toml, as CLAUDE.md asks, because Snyk SCA installs from it)
  • poetry.lock: jwcrypto 1.5.7 -> 1.6.3 plus the content hash. Nothing else moves; cryptography stays at 43.0.3. Lockfile generated with Poetry 2.3.4, the version that wrote the existing file.

Dependency constraints (from PyPI):

jwcrypto requires_python cryptography
1.5.7 (previously locked) >=3.8 >=3.4
1.5.9 >=3.9 >=49.0.0
1.6.2 >=3.9 >=39.0.0
1.6.3 (now locked) >=3.9 >=39.0.0

1.5.9 to 1.6.1 need cryptography>=49.0.0, which is why the minimum is not 1.5.9. It is 1.6.3 and not 1.6.2 because CVE-2026-142105 (affects every release up to 1.6.2) is fixed only in 1.6.3. The repo's declared python = ">=3.9" and cryptography = ">=43.0.1" stay valid.

Where this repo uses jwcrypto: JWE encrypt/decrypt of session data (encryption/encrypt.py, dir + A256CBC-HS512) and DPoP key handling and proof signing (auth_schemes/dpop_auth.py). Incoming JWTs and JWKS are verified with PyJWT, not jwcrypto.

Behaviour changes between 1.5.7 and 1.6.3 worth knowing (from the release notes):

  • base64url_decode now rejects non-canonical input (padding bits, stray =). Encrypted sessions written by 1.5.7 and by 1.6.3 decrypt with either version (checked, see Testing).
  • JWT claim validation is stricter: exp/nbf/iat must be integers and null claim values are rejected. This applies only to jwcrypto.jwt verification, which this repo does not use for incoming tokens; the DPoP proof is only generated here.
  • JWE zip must be in the protected header, and JWS/JWE header merging was unified. The SDK writes only alg/enc in the protected header.
  • JWE/JWS parsing is limited in the number of dot splits, JWE recipients are limited, and a non-empty encrypted key is rejected in bare ECDH-ES. None of these affects the dir flow used here.
  • JWKS import skips keys of an unknown kty (RFC 7517 section 5) and wraps JWKSet parse errors in InvalidJWKValue. The security fixes (CVE-2026-80179 (fixed in 1.5.9), CVE-2026-84185 (1.6.0), CVE-2026-92091 (1.6.1) and CVE-2026-142105 (1.6.3)) come with the new minimum. Advisories: https://github.com/latchset/jwcrypto/security/advisories

References

Testing

Run poetry install then poetry run pytest and poetry run ruff check ..

before (jwcrypto 1.5.7) after (jwcrypto 1.6.3)
Python 3.12, via poetry install 877 passed; ruff clean 877 passed; ruff clean
Python 3.9.6, cryptography 43.0.3, pip-installed (Poetry could not create a 3.9 environment here) 877 passed 877 passed; ruff clean

All tests run, no Docker needed. Also checked that a session encrypted with encrypt() under jwcrypto 1.5.7 decrypts under 1.6.3 and the reverse. No tests were added because there is no source change. Not run: Python 3.10, 3.11, 3.13 and newer, and the CI matrix itself.

  • This change adds unit test coverage
  • This change adds integration test coverage
  • This change has been tested on the latest version of the platform/language or why not

The platform/language item is left unticked: it was tested on Python 3.9 and 3.12 only, not the newest Python release.

Checklist

🤖 Generated with Claude Code

Raise the declared minimum to the first release that parses a JWKS
containing keys of an unknown type and supports newer JOSE algorithms and
the `AKP` key type without requiring a newer `cryptography` than the repo
declares. No major version bump.

- pyproject.toml: jwcrypto ^1.5.7 -> ^1.6.2
- requirements.txt: jwcrypto >=1.5.6,<2.0.0 -> >=1.6.2,<2.0.0
- poetry.lock: jwcrypto 1.5.7 -> 1.6.3 and the content hash; no other
  package moves (cryptography stays at 43.0.3)

Co-Authored-By: Claude <noreply@anthropic.com>
@frederikprijck
frederikprijck requested a review from a team as a code owner December 4, 2026 12:49
1.6.3 contains the fix for CVE-2026-142105, which affects every release up to 1.6.2. It has the same requirements as 1.6.2 (cryptography>=39.0.0), and the lockfile already resolved it.

Co-Authored-By: Claude <noreply@anthropic.com>
@frederikprijck frederikprijck changed the title chore: raise the minimum jwcrypto to 1.6.2 chore: raise the minimum jwcrypto to 1.6.3 Dec 4, 2026

This branch has not been deployed

No deployments
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.

1 participant