/

CVE-2026-40961

Severity:

HIGH RISK

(7.2)

Open Redirect (CWE-601) in Apache Airflow Login Redirect Route

CVE-2026-40961

Analyzed

Vulnerability type

Category:

Open Redirect

CWE:

CWE-601

Impact:

User Redirection and Phishing Facilitation

Severity:

HIGH RISK

(7.2)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

An open redirect flaw in Apache Airflow's login redirect route allowed authenticated users to construct URLs that bypassed the is_safe_url check and redirected browsers from a trusted Airflow domain to attacker-controlled origins.

When users follow such crafted links, their trust in the legitimate Airflow domain can be abused for phishing, credential theft, or session hijacking via chained attacks.

Affected context

The issue occurs in Apache Airflow deployments that expose the web UI's login route and rely on the built‑in redirect mechanism that uses next= query parameters to send users back to a target page after authentication.

In affected versions, the safety validation around redirect targets could be bypassed by specially crafted URLs, allowing redirection to external origins.

The vulnerability is relevant in environments where users commonly access Airflow via emailed links, bookmarks, or SSO/login workflows that include a post‑login redirect parameter.

Exploit preconditions

  • Attack surface: Airflow web UI login route reachable over HTTP(S).
  • Required access: Attacker can authenticate as a user or trick an already authenticated user into following a crafted link; they must be able to supply a malicious next= parameter.
  • Trigger point: Victim visits the specially crafted Airflow login (or login-adjacent) URL, completes any necessary authentication, and the application performs the post-login redirect.
  • Why exploitation is possible: The redirect logic relied on a safety check (is_safe_url) that could be bypassed, allowing untrusted values in the next= parameter to be treated as trusted redirect targets and permitting navigation to off-domain origins.

Why this happens

This vulnerability stems from insufficient validation of user-controlled redirect targets in the login flow.

While Airflow attempted to enforce same-origin or otherwise safe redirects via is_safe_url, the implementation allowed crafted URLs to slip past the checks.

This aligns with CWE-601: Open Redirect, where an application uses untrusted input to construct a URL for redirection without reliably verifying that the target is within an allowed set of destinations.

Conceptually, the bug class is "trusting a user-supplied next parameter to decide where to send the browser," instead of enforcing a strict, server-side-controlled navigation policy.

Potential impact

  • Users may be redirected from the trusted Airflow domain to phishing pages that mimic Airflow or related services.
  • Attackers could leverage the trusted URL to increase the success rate of credential harvesting campaigns.
  • Open redirects may be chained with other weaknesses (e.g., session fixation, token theft via query parameters) to escalate impact.
  • Users could be redirected to sites hosting malware or drive‑by downloads.
  • Security controls that rely on referrer or origin trust may be weakened if users regularly pass through attacker-controlled endpoints after visiting Airflow.

General mitigation guidance

Effective mitigation typically centers on enforcing strict control over redirect targets and reducing reliance on user-supplied navigation hints:

  • Prefer server-side, whitelist-based redirect logic where only known internal paths or a small set of enumerated routes are allowed as post-login destinations.
  • Normalize and strictly validate any redirect parameter, ensuring it is a relative path without protocol, host, or port information, and rejecting or ignoring values that do not conform.
  • Consider ignoring arbitrary next parameters altogether and instead redirecting users to a fixed, safe landing page after login unless a redirect has been established through a trusted server-side mechanism.
  • Place Airflow behind a reverse proxy or gateway that strips or sanitizes off-domain next= (or similar) parameters before they reach the application and enforces consistent origin policies.
  • Educate users and operators not to distribute or trust login URLs containing unexpected redirect parameters, especially if delivered via unsolicited channels.

How teams detect issues like this

Organizations can look for open redirect patterns in Airflow and similar applications by:

  • Using static analysis to flag uses of user-controlled input (e.g., next, redirect, return_url) that feed directly into redirect functions or HTTP 3xx responses without strict validation or whitelisting.
  • Adding code review checklists that call out redirect logic, requiring reviewers to confirm that redirect targets are limited to relative paths or vetted domains.
  • Implementing security tests or fuzzing that automatically attempts common open redirect payload patterns (e.g., absolute URLs, protocol-relative URLs, encoded external hosts) against login and logout endpoints.
  • Monitoring HTTP logs for unusual redirect patterns, such as redirects from the Airflow domain to unrelated external domains, especially when concentrated around authentication endpoints.
  • Applying web application firewall or reverse proxy rules to detect and optionally block requests that include suspicious redirect parameters, logging them for later review.

Sources

SourceLink
github.comgithub.com/apache/airflow/pull/65557
lists.apache.orglists.apache.org/thread/qmt8ksh7gty6b8hr9w294t94j36jdv1q
openwall.comopenwall.com/lists/oss-security/2026/05/31/2

Frequently asked

questions

Yes. An attacker can remotely send or host crafted Airflow login URLs. However, exploitation requires that a victim user (or the attacker themselves, if authenticated) follow the URL and complete the login flow so that the open redirect is triggered.

The redirect behavior affects authenticated users, but attackers can often register or obtain low-privileged accounts in many environments or trick already authenticated users into clicking a crafted link. The vulnerability does not require administrative privileges; it primarily abuses the login redirect step.

The most robust fix is to treat redirect destinations as server-controlled rather than user-controlled: only allow relative, application-internal paths or a small, hardcoded set of safe endpoints, and discard or normalize any user-supplied next values that do not match those constraints.

Design authentication and navigation flows so that redirect targets are chosen from a trusted list, avoid reflecting arbitrary URLs back to the browser, and enforce strict validation of any redirect-like parameters. Incorporate automated checks and code review practices that explicitly look for open redirect risks, particularly around login, logout, and error-handling routes.

Find out what's already
exploitable in your codebase.