VAITP Dataset

← Back to the dataset

CVE-2026-114620

Authlib <1.9.0 SSRF via unchecked request_uri in JWTAuthenticationRequest.

  • CVSS 5.4
  • CWE-918
  • Input Validation and Sanitization
  • Remote

Authlib is a Python library which builds OAuth and OpenID Connect servers. Prior to 1.9.0, Authlib's RFC 9101 JWTAuthenticationRequest passes the unauthenticated, client-controlled request_uri parameter to the abstract get_request_object() hook before applying a destination or registration policy; the hook itself performs no network request, while the documentation demonstrates an unrestricted HTTP fetch. In deployments whose integrator implements that hook as an unrestricted outbound fetch, a remote attacker who knows a valid public client identifier can make the authorization server request internal, link-local, or otherwise unintended URLs and can distinguish fetch outcomes through different error responses and timing. Deployments whose custom hook already applies a secure allowlist, destination controls, and retrieval limits are not affected. The JWTAuthenticationRequest implementation in authlib/oauth2/rfc9101/authorization_server.py forwards request_uri to get_request_object() before an application-approved retrieval policy accepts the destination. This issue is fixed in version 1.9.0.

CVSS base score
5.4
Published
2026-10-22
OWASP
A10 Server-Side Request Forgery (SSRF)
Orthogonal defect classification
Checking
Code defect classification
Missing Check
Category
Input Validation and Sanitization
Subcategory
Insecure Direct Object References (IDOR)
Accessibility scope
Remote
Impact
Information Disclosure
Affected component
Authlib
Fixed by upgrading
Yes

Solution

Upgrade Authlib to version 1.9.0 or later.

Vulnerable code sample

import re
from urllib.parse import urlparse

class AuthServer:
    def get_request_object(self, request_uri: str) -> dict:
        # In a typical integration this might perform an unrestricted HTTP fetch.
        # Here we simulate the unsafe behavior.
        return {"fetched": request_uri}

    def handle_jwt_authentication(self, request):
        # Extract request_uri from the JWT authentication request (unvalidated)
        request_uri = request.get("request_uri")
        # VULNERABLE: passes client‑controlled request_uri to get_request_object before any policy check
        request_obj = self.get_request_object(request_uri)
        # Further processing assumes request_obj is safe
        return request_obj

Patched code sample

import re
from urllib.parse import urlparse

class AuthServer:
    def get_request_object(self, request_uri: str) -> dict:
        # Secure implementation still performs the fetch but expects a validated URI.
        return {"fetched": request_uri}

    def _is_allowed_uri(self, uri: str) -> bool:
        # Simple allow‑list: only HTTPS URLs to example.com are permitted
        parsed = urlparse(uri)
        return (
            parsed.scheme == "https" and
            re.fullmatch(r"[^.]+\.example\.com", parsed.hostname or "")
        )

    def handle_jwt_authentication(self, request):
        request_uri = request.get("request_uri")
        # FIX: validate request_uri against an allow‑list before calling get_request_object
        if not self._is_allowed_uri(request_uri):
            raise ValueError("Disallowed request_uri")
        request_obj = self.get_request_object(request_uri)
        return request_obj

Published fix

Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.

  • fix(oauth): enforce nonce and JAR request validation (authlib/authlib)
    authlib/integrations/base_client/async_openid.py · AsyncOpenIDMixin.parse_id_token, authlib/integrations/base_client/sync_openid.py · OpenIDMixin.parse_id_token, authlib/oauth2/rfc9101/authorization_server.py, authlib/oauth2/rfc9101/authorization_server.py · JWTAuthenticationRequest.get_request_object, authlib/oauth2/rfc9101/authorization_server.py · JWTAuthenticationRequest.get_request_object_signing_algorithms, authlib/oauth2/rfc9101/authorization_server.py · JWTAuthenticationRequest.get_server_metadata, authlib/oauth2/rfc9101/authorization_server.py · JWTAuthenticationRequest.parse_authorization_request, authlib/oauth2/rfc9101/authorization_server.py · JWTAuthenticationRequest._decode_request_object, authlib/oauth2/rfc9101/authorization_server.py · JWTAuthenticationRequest._get_raw_request_object
  • fix(oidc): separate request URI registration from JAR policy (authlib/authlib)
    authlib/oauth2/rfc9101/authorization_server.py, authlib/oauth2/rfc9101/authorization_server.py · JWTAuthenticationRequest.get_server_metadata, authlib/oauth2/rfc9101/authorization_server.py · JWTAuthenticationRequest.validate_request_uri, authlib/oauth2/rfc9101/authorization_server.py · JWTAuthenticationRequest._get_raw_request_object, authlib/oidc/core/__init__.py

Cite this entry

@misc{vaitp:cve2026114620,
  title        = {{Authlib <1.9.0 SSRF via unchecked request_uri in JWTAuthenticationRequest.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-114620},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-114620/}}
}

Download this entry as JSON Download the whole dataset

Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.