Skip to content

fix!: bump authlib to >=1.9.1 and raise python floor to 3.10 - #190

Closed
rmad17 wants to merge 3 commits into
mainfrom
security-fix-authlib
Closed

rmad17 wants to merge 3 commits into
mainfrom
security-fix-authlib

Conversation

@rmad17

@rmad17 rmad17 commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Changes

Bumps authlib from ^1.2 (locked at 1.6.11) to >=1.9.1,<2.0 (locked at 1.9.10) to pick up upstream security fixes. In poetry.lock, authlib 1.9.10 requires python >=3.10, cryptography >=45.0.1 and joserfc >=1.6.8, which drives the rest of this change.

⚠️ Breaking change: Python 3.9 is no longer supported

  • pyproject.toml: python = ">=3.9" becomes ">=3.10".
  • Users on 3.9 stay on the current release or upgrade Python. pip won't install this version on 3.9.

Dependencies (pyproject.toml, requirements.txt and poetry.lock updated together)

  • authlib: ^1.2 becomes >=1.9.1,<2.0
  • cryptography: >=43.0.1 becomes >=45.0.1 (locked 43.0.3 to 51.0.0)
  • New transitive dependency joserfc: 1.7.7 below Python 3.15, 1.8.0 on 3.15 and later
  • cffi: 2.0.0 to 2.1.1
  • Lock entries that only existed for Python 3.9 are removed, such as astroid 3.3.11 and stdlib-list

CI (.github/workflows/test.yml)

  • Matrix changes from 3.9, 3.10, 3.11, 3.12 to 3.10, 3.11, 3.12, 3.13, 3.14.
  • 3.15 is left out on purpose. pydantic 2.13.5 pins pydantic-core 2.46.5, which has no cp315 wheel, so a 3.15 run would build it from source. It gets added once a pydantic release ships cp315 wheels.

Lint and typing (annotations only, no change to any public signature)

  • .ruff.toml: target-version goes from py39 to py310.
  • Type hints in 13 source modules now use the 3.10 style: Optional[X] and Union[X, Y] become X | None and X | Y, and Dict/List become dict/list. Callable now comes from collections.abc.
  • The public type aliases in auth_types are now written as X | Y unions: EnrollAuthenticatorOptions, EnrollmentResponse, VerifyMfaOptions, StartPasswordlessOptions. Their members are unchanged.
  • ServerClient (server_client.py:404) and two Enterprise Connect tests switch from asyncio.iscoroutinefunction to inspect.iscoroutinefunction. The asyncio version is deprecated as of Python 3.14.

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

Docs

  • README.md now says "This library requires Python 3.10+."
  • Code in examples/ConfigureStore.md, EnterpriseConnect.md, MultipleCustomDomains.md, OrganizationLogin.md and StepUpAuthentication.md is updated to the 3.10 typing style.
  • CLAUDE.md, references/code-style.md and references/pitfalls.md now describe the 3.10045/UP035` rules.

Alternatives considered: pinning to the newest authlib 1.6.x patch, which would keep 3.9 past end of life, and the 1.9 line is where upstream fixes land.

References

  • authlib security advisories: <add advisory / CVE links>
  • Ticket: <add if tracked>

Testing

poetry install
poetry run pytest
poetry run ruff check .

CI runs the same suite on 3.10 through 3.14. No functional tests were added, because the code changes only affect type annotations.

  • 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 (CI covers 3.14)

Checklist

Comment thread requirements.txt
@@ -1,7 +1,7 @@
# Core dependencies for auth0-server-python SDK
cryptography>=43.0.1
cryptography>=45.0.1

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 2 lists a dependency (cryptography) 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.

Comment thread requirements.txt
@@ -1,7 +1,7 @@
# Core dependencies for auth0-server-python SDK
cryptography>=43.0.1
cryptography>=45.0.1

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 2 lists a dependency (cryptography) 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.

Comment thread requirements.txt
@@ -1,7 +1,7 @@
# Core dependencies for auth0-server-python SDK
cryptography>=43.0.1
cryptography>=45.0.1

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 2 lists a dependency (cryptography) 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.

Comment thread requirements.txt
@@ -1,7 +1,7 @@
# Core dependencies for auth0-server-python SDK
cryptography>=43.0.1
cryptography>=45.0.1

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 2 lists a dependency (cryptography) 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.

@semgrepcode-auth0

Copy link
Copy Markdown

Semgrep found 1 ssc-f9d53b7a-782c-4959-b1a1-96c02bad7f9d finding:

  • src/auth0_server_python/auth_server/server_client.py

🟠 High severity issue identified in your code:

Risk: Affected versions of pyjwt are vulnerable to Improper Verification of Cryptographic Signature. PyJWT HMACAlgorithm.from_jwk accepts a symmetric (oct) JWK with an empty k value and returns a zero-length HMAC key. When such a key (loaded via PyJWK, PyJWKSet or PyJWKClient) is used to verify tokens, an attacker can forge HS256/HS384/HS512 tokens with arbitrary claims by computing the HMAC with an empty key, leading to authentication bypass and privilege escalation.

Manual Review Advice: A vulnerability from this advisory is reachable if you verify HMAC-signed tokens with a symmetric (oct) JWK whose k value is empty (e.g. generated from an unset secret) and you have not enabled the enforce_minimum_key_length option

Fix: Upgrade this library to at least version 2.14.0 at auth0-server-python/requirements.txt:3.

Reference(s): GHSA-pxh4-856f-4h89

View Dataflow Graph
flowchart LR
    classDef invis fill:white, stroke: none
    classDef default fill:#e7f5ff, color:#1c7fd6, stroke: none

    subgraph File0["<b>src/auth0_server_python/auth_server/server_client.py</b>"]
        direction LR
        %% Source

        subgraph Source
            direction LR

            v0["<a href=https://github.com/auth0/auth0-server-python/blob/92766a104e3bab9d17bfd37dfbf5b93de23cb10c/src/auth0_server_python/auth_server/server_client.py#L607 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 607] jwt.PyJWK.from_dict(key)</a>"]
        end
        %% Intermediate

        subgraph Traces0[Traces]
            direction TB

            v2["<a href=https://github.com/auth0/auth0-server-python/blob/92766a104e3bab9d17bfd37dfbf5b93de23cb10c/src/auth0_server_python/auth_server/server_client.py#L607 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 607] signing_key</a>"]
        end
        %% Sink

        subgraph Sink
            direction LR

            v1["<a href=https://github.com/auth0/auth0-server-python/blob/92766a104e3bab9d17bfd37dfbf5b93de23cb10c/src/auth0_server_python/auth_server/server_client.py#L618 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 618] jwt.decode(token, signing_key.key, **kwargs)</a>"]
        end
    end
    %% Class Assignment
    Source:::invis
    Sink:::invis

    Traces0:::invis
    File0:::invis

    %% Connections

    Source --> Traces0
    Traces0 --> Sink

Loading

Semgrep found 4 ssc-0dd2841a-3fd5-26dc-14b9-d8227979c9bc findings:

🟠 High severity issue identified in your code:

Risk: Affected versions of PyJWT are vulnerable to Incorrect Authorization / Insufficient Verification of Data Authenticity. PyJWT's JWS decoder does not enforce RFC 7515 crit (Critical) header handling: tokens that declare unknown critical header extensions in crit are accepted instead of being rejected. This can enable JWT policy/authorization bypass in deployments that rely on crit-signaled requirements (e.g., MFA/token binding/PoP such as cnf), and can cause "split-brain" verification where RFC-compliant components reject a token but PyJWT accepts it.

Fix: Upgrade this library to at least version 2.12.0 at auth0-server-python/requirements.txt:3.

Reference(s): https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-11728, GHSA-752w-5fwx-jx9f, CVE-2026-32597

Comment thread requirements.txt
cryptography>=45.0.1
pyjwt>=2.8.0
authlib>=1.2.0,<2.0.0
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.

Comment thread requirements.txt
cryptography>=45.0.1
pyjwt>=2.8.0
authlib>=1.2.0,<2.0.0
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 changed the title fix: bump authlib to >=1.9.1 and raise python floor to 3.10 fix!: bump authlib to >=1.9.1 and raise python floor to 3.10 Dec 4, 2026
@rmad17 rmad17 closed this Dec 4, 2026
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