Skip to content

fix: bump authlib to ^1.9.1 and cryptography floor to >=45.0.1 - #169

Merged
rmad17 merged 2 commits into
mainfrom
fix/authlib-security
Dec 4, 2026
Merged

rmad17 merged 2 commits into
mainfrom
fix/authlib-security

Conversation

@rmad17

@rmad17 rmad17 commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Changes

Raises the authlib floor to 1.9.1 to pick up upstream security fixes, and raises the cryptography floor to match what authlib 1.9.x requires.

Dependencies

  • pyproject.toml
    • authlib: ^1.0 becomes ^1.9.1 (locked 1.7.2 to 1.9.10)
    • cryptography: >=43.0.1 becomes >=45.0.1. authlib 1.9.10 declares cryptography>=45.0.1, so the floor we state now matches what actually resolves. The locked version stays at 50.0.2.
  • requirements.txt (read by the Snyk SCA scan): authlib>=1.6.12 becomes authlib~=1.9
  • poetry.lock: only the authlib version and the content hash change. joserfc (1.7.4) already meets authlib's >=1.6.8.

Endpoints, classes and methods: none added, removed, deprecated or changed.

Behavior changes from authlib 1.7.2 to 1.9.10
These come from a diff of authlib/jose between the two wheels. Every change is a stricter check:

  • A JSON-serialized JWS with an empty or None signatures list is now rejected (rfc7515/jws.py).
  • Importing an oct (HMAC) key now rejects empty keys and keys that look like PEM or SSH public keys (rfc7518/oct_key.py). This doesn't apply to this SDK, because ApiClient only allows RS256 for access tokens and ES256 for DPoP proofs.
  • Booleans are no longer accepted as numeric dates, so exp: true is now rejected (rfc7519/claims.py).

Integrator impact

  • Minimum versions are now authlib 1.9.1 and cryptography 45.0.1. Apps that pin older versions will get resolver conflicts when they upgrade.
  • authlib.jose raises AuthlibDeprecationWarning on import (authlib forces it to always show). This repo already saw it with 1.7.2, but integrators still on authlib 1.6.x will see it for the first time. Test suites that run with -W error will fail when importing the SDK.
  • The Python floor (3.10) doesn't change.

Alternatives considered

  • Moving from authlib.jose to joserfc would remove the deprecation warning. It's left for a follow-up because it changes token verification and needs its own review.
  • authlib<2.0 stays, through the caret pin: authlib says authlib.jose "will be compatible before version 2.0.0". No 2.x release is on PyPI yet.

Testing

poetry install
poetry check --lock
poetry run pytest
poetry run ruff check .
  • poetry check --lock exits 0.
  • pytest: 506 passed, 93% coverage. The only warning is the existing authlib.jose deprecation at api_client.py:9.
  • ruff check .: all checks passed.

The tests ran against the same resolved versions this PR locks. The later edits to ^1.9.1 he lock's content hash.

  • 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

Checklist

@rmad17
rmad17 requested a review from a team as a code owner December 2, 2026 10:00
Comment thread requirements.txt Outdated
# Source of truth for dependencies: pyproject.toml + poetry.lock

authlib>=1.6.12
authlib~=1.9

@semgrepcode-auth0 semgrepcode-auth0 Bot Dec 2, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High severity issue identified in your code:

Risk: Affected versions of Authlib are vulnerable to Improper Authentication / Inadequate Encryption Strength / Use of Weak Credentials. Authlib accepts an empty (zero-length) oct key as a valid HMAC key. If the key passed to JWT/JWS signing or verification is empty, anyone can compute a valid HS256/HS384/HS512 signature and forge tokens with arbitrary claims, bypassing authentication.

Manual Review Advice: A vulnerability from this advisory is reachable if you sign or verify HMAC (HS256/HS384/HS512) tokens with a key that can be empty at runtime, such as an environment variable, configuration value, client secret, or key resolver that defaults to an empty string

Fix: Upgrade this library to at least version 1.9.1 at auth0-api-python/requirements.txt:4.

Reference(s): https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-108517, GHSA-8m4g-j4wp-wgcg, CVE-2026-114616

⭐ Fixed in commit dbfe599 ⭐

@rmad17
rmad17 marked this pull request as draft December 2, 2026 10:02
Comment thread requirements.txt Outdated
# Source of truth for dependencies: pyproject.toml + poetry.lock

authlib>=1.6.12
authlib~=1.9

@semgrepcode-auth0 semgrepcode-auth0 Bot Dec 2, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High severity issue identified in your code:

Risk: Affected versions of Authlib are vulnerable to Authorization Bypass Through User-Controlled Key / Insecure Default Initialization of Resource. Authlib's RFC 7592 ClientConfigurationEndpoint does not verify that the presented registration access token was issued to the client being read, updated, or deleted, and the documented implementations of authenticate_client and check_permission do not perform this binding either. Any holder of a valid registration access token (e.g. obtained by self-registering through an open dynamic client registration endpoint) can read another client's metadata and secret, hijack its redirect URIs, or delete it by targeting its client_id.

Manual Review Advice: A vulnerability from this advisory is reachable if you do not verify in your check_permission or authenticate_client implementation that the registration access token belongs to the requested client

Fix: Upgrade this library to at least version 1.9.1 at auth0-api-python/requirements.txt:4.

Reference(s): https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-111112, GHSA-c73q-w75p-j82v, CVE-2026-116672

🌟 Fixed in commit dbfe599 🌟

@rmad17
rmad17 marked this pull request as ready for review December 4, 2026 11:14

@kishore7snehil kishore7snehil left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@rmad17
rmad17 merged commit a617f6b into main Dec 4, 2026
8 checks passed
@rmad17
rmad17 deleted the fix/authlib-security branch December 4, 2026 12:06
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