Skip to content

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

Draft
rmad17 wants to merge 1 commit into
mainfrom
fix/authlib-security
Draft

rmad17 wants to merge 1 commit 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
# Source of truth for dependencies: pyproject.toml + poetry.lock

authlib>=1.6.12
authlib~=1.9

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 one of your dependencies:
Line 4 lists a dependency (authlib) with a known vulnerability. The dependency was declared as a version range. Check the installed version to determine impact, then pin it or add a lockfile.

💬 Ignore this finding

To ignore this, reply with:

  • /fp <comment> for false positive
  • /ar <comment> for acceptable risk
  • /other <comment> for all other reasons

Your security policy comments on findings when they have no reachability analysis - contact your Semgrep admin to update this. You can view more details on this finding in the Semgrep AppSec Platform here.

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

authlib>=1.6.12
authlib~=1.9

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 one of your dependencies:
Line 4 lists a dependency (authlib) with a known vulnerability. The dependency was declared as a version range. Check the installed version to determine impact, then pin it or add a lockfile.

💬 Ignore this finding

To ignore this, reply with:

  • /fp <comment> for false positive
  • /ar <comment> for acceptable risk
  • /other <comment> for all other reasons

Your security policy comments on findings when they have no reachability analysis - contact your Semgrep admin to update this. You can view more details on this finding in the Semgrep AppSec Platform here.

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