Join our Newsletter — 33% off our NHI Course
Home FAQ Cyber Security What breaks when a site lets users control…
Cyber Security

What breaks when a site lets users control the redirect URL after login?

← Back to all FAQ
By NHI Mgmt Group Editorial Team Updated September 15, 2026 Domain: Cyber Security

The trust boundary breaks at the moment the application accepts an unvalidated redirect target. Instead of returning the user to a safe internal page, the app can send them to an external site under attacker control. That turns a normal authentication flow into a delivery mechanism for phishing, credential capture, and brand impersonation, all while the original URL still appears legitimate.

Why This Matters for Security Teams

An open redirect after login is not just a minor application bug. It weakens the assurance that users are returning to a trusted application flow and gives attackers a clean way to move people from a legitimate sign-in page to a convincing lookalike destination. That matters because phishing is most effective when the first step looks routine, and redirects that preserve the original login context can make the handoff feel safe.

Security teams should treat this as a trust-boundary failure with user-impacting consequences. Even when the target site is not directly compromising the application, the redirect can be used to collect credentials, session tokens, or secondary approvals through social engineering. In practice, many teams discover the issue only after a phishing campaign has already reused their login flow as the delivery path.

How It Works in Practice

The core problem is that the application accepts a destination supplied by the browser, query string, or hidden parameter without validating that it stays within an approved set of internal locations. After authentication, the app performs the redirect and the user assumes the next page is still part of the original service. Attackers exploit that assumption by crafting a login link that ends in a malicious destination but begins with a real, trusted domain.

That pattern commonly shows up in several forms:

  • A redirect parameter such as OWASP API Security Top 10 style validation failures, where input is accepted without an allowlist.
  • Encoded or nested redirect values that hide the final destination from casual review.
  • Login success pages that forward users to partner portals, mobile deep links, or help pages without checking whether the destination is same-origin.

From a defensive standpoint, the fix is usually to stop treating the redirect target as arbitrary user input. Use a small allowlist of approved post-login destinations, or map short tokens to server-side destinations instead of accepting full URLs. If cross-domain forwarding is truly required, make the transition explicit so users can see they are leaving the trusted application context. The login flow should also preserve state safely so the redirect cannot be abused to overwrite intended navigation or disguise an attacker-selected path.

Good validation is not just string matching. It needs to account for scheme changes, subdomain tricks, path traversal in redirect wrappers, and encoded values that resolve after decoding. These controls tend to break down when teams allow arbitrary third-party return URLs for convenience, because that turns a simple navigation feature into an externally controlled trust decision.

Common Variations and Edge Cases

Tighter redirect control often increases implementation friction, especially when product teams want deep links, partner handoffs, or mobile app return paths. The tradeoff is that convenience features can quietly expand the attack surface if the application treats every destination as equally safe.

Some edge cases matter more than others. Relative redirects are usually safer than full external URLs, but they still need canonicalisation checks. Signed redirect tokens can reduce abuse, but only if the signing scope is narrow and the token cannot be replayed across contexts. In single sign-on flows, the risk is higher when the application mixes its own redirect logic with identity provider callbacks, because users may not notice which system is issuing the final navigation request.

If a site must support external return destinations, the user experience should clearly indicate the domain change and avoid passing sensitive state in the redirect itself. When the redirect is used for login completion, any ambiguity about the target is enough to create a practical phishing path.

Risk and Threat Considerations

This issue creates both exposure and attacker opportunity. The main risk is not that the redirect itself authenticates the attacker, but that it turns a trusted login step into a vehicle for deception, credential theft, and brand abuse. If the application can send users to an attacker-controlled site after sign-in, the attacker inherits some of the trust associated with the original service.

Failure mechanism: The attacker supplies a crafted redirect target, the application accepts it without strict validation, and the browser follows the redirect after login. That enables phishing pages, token harvesting, malicious MFA prompts, and fake support flows that appear to be part of the legitimate service path.

Impact: Users lose confidence in the login journey, support teams face harder fraud triage, and the organisation may suffer account compromise or reputational damage even when the core authentication system remains intact.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 and OWASP Agentic AI Top 10 address the attack and risk surface, while CIS Controls v8 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-04 — Trust Boundaries and Redirect AbuseOpen redirects abuse trusted navigation after login.
Recommendation — Validate post-login destinations with a strict server-side allowlist.
OWASP Agentic AI Top 10A2 — Tool Misuse and Unauthorized ActionsRedirect abuse exploits trusted action flow and user intent.
Recommendation — Constrain externally influenced transitions to approved destinations only.
CIS Controls v816 — Application Software SecurityApplication flows need secure input handling and validation.
Recommendation — Harden application navigation logic and block arbitrary redirect targets.
NIST CSF 2.0PR.AC — Identity Management, Authentication and Access ControlLogin redirects affect trusted access flows and user assurance.
Recommendation — Enforce controlled post-authentication navigation as part of access design.

Practitioner Guidance

What to prioritise: Treat every post-login redirect as an access-control decision, not a UX detail. Validate destinations against a server-side allowlist and remove any feature that accepts an arbitrary external URL unless the business case is explicit and reviewed.

What to verify: Test the flow with encoded values, alternate schemes, subdomains, and callback wrappers. Confirm that the application rejects destinations outside the approved set before the browser is instructed to navigate.

Decision rule: If the redirect can influence where a user lands immediately after authentication, it deserves the same scrutiny as any other trust boundary that can shape user intent or expose a branded login journey to abuse.

Practitioner takeaway: The safest redirect is the one the server chooses, because once users can steer post-login navigation, the application is helping attackers borrow its legitimacy.

Deepen Your Knowledge

Sign up to our weekly newsletter — get 33% off our NHI Foundation Level Course

    NHIMG Editorial Note
    Reviewed and updated by the NHIMG editorial team on September 15, 2026.
    NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org