-
Notifications
You must be signed in to change notification settings - Fork 94
LCORE-1881: Fixes CVE in authlib #1536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
tisnik
merged 1 commit into
lightspeed-core:main
from
tisnik:lcore-1881-fixes-cve-in-authlib
Apr 19, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: lightspeed-core/lightspeed-stack
Length of output: 19487
🌐 Web query:
Authlib 1.7.0 release notes/changelog: didauthlib.joseerror classes (BadSignatureError,DecodeError,ExpiredTokenError,JoseError) orjwt.decode/claims validation behavior change versus 1.6.x?💡 Result:
Yes, there are changes in Authlib 1.7.0 versus 1.6.x for authlib.jose error classes and jwt.decode/claims validation behavior. The primary change is migration to joserfc: authlib.jose is deprecated and affected modules (including JWT handling in oauth2/oidc) now use joserfc, raising joserfc-based exceptions instead of authlib.jose.errors. Error classes like BadSignatureError, DecodeError, ExpiredTokenError, JoseError exist in both, but users catching authlib.jose errors must update to import from joserfc.errors. joserfc has additional errors (e.g. ClaimError, InvalidClaimError) and recent changes like ExpiredTokenError inheriting from ClaimError (joserfc 1.6.1). jwt.decode behavior changes: in authlib.jose, it handles decoding and optional claims validation; in joserfc, decoding and claims validation are separate steps using JWTClaimsRegistry, requiring explicit validation. Changelog mentions "joserfc migration" with breaking changes in exceptions; no other jose/JWT-specific changes listed. GitHub tags/releases show up to v1.6.9 (Mar 2026), but docs confirm v1.7.0 released Apr 18, 2026.
Citations:
Authlib 1.7.0 introduces breaking changes and will break existing code.
Authlib 1.7.0 migrates from
authlib.josetojoserfcwith deprecated and incompatible APIs. The current code atsrc/authentication/jwk_token.pyimports fromauthlib.joseand usesjwt.decode()/claims.validate()with exception handling forauthlib.jose.errorsclasses—all of which have changed in 1.7.0.Update required before merge:
authlib.joseimports withjoserfcequivalentsjwt.decode()now returns decoded claims without validation; call claims registry validation separatelyjoserfc.errorsinstead ofauthlib.jose.errors🤖 Prompt for AI Agents
🧩 Analysis chain
🏁 Script executed:
Repository: lightspeed-core/lightspeed-stack
Length of output: 167
🏁 Script executed:
Repository: lightspeed-core/lightspeed-stack
Length of output: 151
🏁 Script executed:
Repository: lightspeed-core/lightspeed-stack
Length of output: 12414
🏁 Script executed:
Repository: lightspeed-core/lightspeed-stack
Length of output: 37194
🌐 Web query:
authlib 1.7.0 changelog release notes breaking changes💡 Result:
Authlib 1.7.0 was released on April 18, 2026. Here is a summary of the changelog, release notes, and breaking changes from the official documentation. ## Key Features and Changes: - Add support for OpenID Connect RP-Initiated Logout 1.0. - Per RFC 6749 Section 3.3, the scope parameter is now optional at both authorization and token endpoints. client.get_allowed_scope is called to determine the default scope when omitted (issue
#845). - Stop support for Python 3.9, add support for Python 3.14 (pull request#850). - Allow AuthorizationServerMetadata.validate to compose with RFC extension classes. - Fix expires_at=0 being incorrectly treated as None (issue#530). - Allow ResourceProtector decorator to be used without parentheses (issue#604). - Set User-Agent header when fetching server metadata and JWKs (issue#704). - RFC7523 accepts the issuer URL as a valid audience (issue#730). - Upgrade Guide: joserfc migration (pull request#872). ## Breaking Changes: The primary breaking change is the migration to joserfc for JOSE modules (authlib.jose is deprecated). See https://docs.authlib.org/en/v1.7.0/upgrades/jose.html for details: - Affected modules: authlib.oauth2.rfc7523, rfc7591, rfc7592, rfc9068, rfc9101, authlib.oidc.core. - Exceptions now use joserfc-based errors (e.g., from joserfc.errors import JoseError). - JWTAuthenticationRequest uses only recommended JWT algorithms by default. - UserInfoEndpoint signing algorithms limited to recommended JWT algorithms. - Deprecation warnings for key imports; use explicit key types (OctKey, RSAKey, etc.). - get_jwt_config split into resolve_client_private_key, get_client_claims, etc. No specific GitHub release notes for v1.7.0 were found in search results (latest visible tags up to v1.6.9 on March 2, 2026), but official docs confirm the release.Citations:
🌐 Web query:
authlib 1.7.0 authlib.jose removed deprecated compatibility💡 Result:
In Authlib version 1.7.0, released on April 18, 2026, the authlib.jose module is deprecated (not removed) and emits deprecation warnings when used. It has not been removed; instead, Authlib now favors the separate joserfc library for JOSE operations (JWS, JWE, JWK, JWT). Several OAuth2 and OIDC modules now internally use joserfc, leading to breaking changes like different exceptions (now joserfc-based) and API adjustments (e.g., get_jwt_config split into resolve_client_private_key, get_client_claims, get_client_algorithm). Deprecated compatibility code or shims for the old authlib.jose were not explicitly removed based on available changelogs, but the module itself is marked for future removal with a migration guide provided. Users are recommended to migrate to joserfc directly for new code and update exception handling and key imports for compatibility.
Citations:
🌐 Web query:
authlib 1.7.0 authlib.jose.errors exception classes joserfc migration💡 Result:
In Authlib 1.7.0, the authlib.jose module has been deprecated in favor of the separate joserfc library for JOSE (JWS, JWE, JWK, JWT) functionality. This affects modules like authlib.oauth2.rfc7523, rfc7591, rfc7592, rfc9068, rfc9101, and authlib.oidc.core, which now use joserfc internally. Key migration points for authlib.jose.errors: - Update exception imports and catches from authlib.jose.errors to joserfc.errors, as affected modules raise joserfc-based exceptions. - Example: Replace from authlib.jose.errors import JoseError with from joserfc.errors import JoseError. joserfc.errors exception classes (all subclass joserfc.errors.JoseError, the base class): - BadSignatureError: Raised for JWS when signature does not match (error: 'bad_signature'). - ClaimError: Base for JWT claims validation. - ConflictAlgorithmError (error: 'conflict_algorithm'). - DecodeError. - InvalidPayloadError (error: 'invalid_payload'). - InvalidTokenError: Alias of InvalidClaimError. - KeyParameterError (error: 'key_parameter'). - MissingAlgorithmError: Missing 'alg' in header. - MissingClaimError: Missing specific claim. - MissingCritHeaderError: Missing critical header. - MissingKeyError (error: 'missing_key'). - MissingKeyTypeError (error: 'missing_key_type'). - SecurityWarning: Base for security warnings. - UnsupportedAlgorithmError: Unsupported alg in registry (error: 'unsupported_algorithm'). - UnsupportedHeaderError (error: 'unsupported_header'). - UnsupportedKeyAlgorithmError. Legacy authlib.jose.errors (pre-migration, still in source but deprecated) include similar names like JoseError, DecodeError, MissingAlgorithmError, UnsupportedAlgorithmError, BadSignatureError, InvalidClaimError, MissingClaimError, ExpiredTokenError, InvalidTokenError, etc. For full migration details: - Authlib docs: https://docs.authlib.org/en/v1.7.0/upgrades/jose.html (breaking changes on exceptions). - joserfc errors: https://jose.authlib.org/en/api/errors/. - joserfc migration from Authlib: https://jose.authlib.org/en/migrations/authlib. - GitHub issue
#766(milestone v1.7): authlib/authlib#766 (completed Jan 2026). Additionally, get_jwt_config is split into resolve_client_private_key, get_client_claims, get_client_algorithm. Keys must be explicit JWK types (e.g., OctKey.import_key(secret)) instead of raw strings/bytes to avoid deprecation warnings. See detailed examples in docs.Citations:
🌐 Web query:
authlib 1.7.0 CVE security fix vulnerability💡 Result:
No, Authlib 1.7.0 does not address a specific CVE as a security fix in that version. Authlib 1.7.0, released on 2026-04-18, includes features like support for OpenID Connect RP-Initiated Logout 1.0, optional scope parameter per RFC 6749, dropped Python 3.9 support, and a fix for CSRF vulnerability in the Starlette OAuth client when a cache is configured. However, no CVE is explicitly associated with these changes in the changelog or security advisories. Known recent CVEs fixed in earlier versions include: - CVE-2026-28498 (GHSA-m344-f55w-2m6j): OIDC ID Token hash verification fail-open, affecting <=1.6.8, patched in 1.6.9 (2026-03). - CVE-2025-68158 (GHSA-fg6f-75jq-6523): 1-click account takeover via cache-backed state CSRF, affecting <=1.6.5, patched in 1.6.5/1.6.6. Snyk reports no direct vulnerabilities for Authlib 1.7.0. All prior CVEs are fixed in versions before 1.7.0, so 1.7.0 is secure regarding known CVEs.
Citations:
Update pyproject.toml floor to
authlib>=1.7.0, but be aware this version introduces breaking changes requiring code review.While pinning to
authlib==1.7.0inrequirements.hashes.source.txtis good,pyproject.tomlstill allowsauthlib>=1.6.0, which bypasses the lock in non-hash install paths. However, the upgrade from 1.6.9 to 1.7.0 is not a simple CVE patch—it deprecates theauthlib.josemodule in favor ofjoserfc.Your codebase directly imports from the deprecated
authlib.josemodule (JsonWebKey,JsonWebToken, error classes likeBadSignatureError,DecodeError,ExpiredTokenError). In 1.7.0, exception handling may break because affected modules now raisejoserfc-based exceptions instead ofauthlib.jose.errors. Theauthlib.josemodule is not removed yet but is marked for deprecation with warnings.Before updating the floor to
authlib>=1.7.0, verify:src/authentication/jwk_token.pywork with 1.7.0's joserfc integration, orProposed follow-up
Run tests with 1.7.0 to verify exception handling and API compatibility.
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@coderabbitai create issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
@tisnik, I've created a GitHub issue to track the follow-up work required after theauthlib1.7.0 upgrade. The issue captures:authlib.joseusages insrc/authentication/jwk_token.pytojoserfc(or updating exception handling to usejoserfc.errors)pyproject.tomlfloor fromauthlib>=1.6.0toauthlib>=1.7.0The issue has been assigned to you. I'll share the issue URL once the script completes.
🏁 Script executed:
Length of output: 63
@tisnik, the follow-up issue has been created and assigned to you:LCORE-1881 follow-up: Migrate authlib.jose usages to joserfc after authlib 1.7.0 upgrade
The issue tracks:
src/authentication/jwk_token.pyto handlejoserfc-based exceptions fromauthlib 1.7.0pyproject.tomlfloor toauthlib>=1.7.0