Execution After Redirect is a web attack pattern where a user or process is sent from a trusted location to an attacker-controlled one and then code is run or loaded from the redirected target. It usually exploits trust in redirects, script inclusion or URL handling, leading to unsafe execution in browsers, applications or automation flows.
What Execution After Redirect means in practice
Execution After Redirect is dangerous because the trusted-to-untrusted transition can hide where execution actually begins. A browser, application, or automation flow may appear to be handling a normal redirect, while the redirected destination supplies script, code, or other executable content that the client then loads or runs.
The core problem is trust transfer. If the original source is considered safe, the redirect can inherit that trust even when the target is attacker-controlled. That makes EAR especially useful for bypassing weak allowlists, confusing reviewers, and smuggling execution through flows that only inspect the first URL.
How EAR works as an attack pattern
EAR is not one single vulnerability class, but a pattern that combines redirect handling with unsafe execution. It commonly shows up when an application follows redirects automatically, loads remote script or content from the redirected location, or lets a user agent resolve a URL in a way that was not intended by the original application owner.
The execution step can occur in several ways. A browser may execute redirected JavaScript or HTML in a privileged context, an application may import a remote module or template after following the redirect, or an automation workflow may fetch and run content from the final destination without revalidating trust boundaries.
Because the attack depends on how content is consumed after the redirect, the same redirect behaviour can be harmless in one system and dangerous in another. The security impact grows when the redirected resource is treated as code, configuration, policy, or a dependency rather than as inert data.
Why EAR is risky for browsers and automation flows
EAR is especially damaging when execution happens in a client that has credentials, cookies, tokens, or other ambient authority. A redirected target can leverage that authority to read data, call internal services, or alter state if the consuming application does not separate navigation from execution.
It is also a supply path problem. If a workflow trusts the final location after a redirect, an attacker can use a benign starting point to move execution into a hostile environment. That is why redirect handling, content-type validation, origin checks, and execution policy all matter together rather than as isolated controls.
For broader control context, teams often map the issue to secure execution, integrity, and access controls in NIST SP 800-53 Rev 5 Security and Privacy Controls, while redirect-driven abuse and follow-on exploitation patterns are easier to reason about with MITRE ATT&CK Enterprise Matrix.
How organisations reduce exposure and detect abuse
Exposure checks start with inventory: where redirects are accepted, where remote content is executed, and which browser, API, or automation paths can inherit trust from a redirected URL. Vendor guidance, code review, and testing should focus on whether the final destination is revalidated before any execution step.
Detection is usually about seeing the sequence, not just the destination. Look for unusual redirect chains, unexpected domain changes, script loads that follow redirects, and client activity that downloads then immediately executes content from a remote source. Post-incident review should confirm whether the redirected resource delivered code, configuration, or a dependency that should never have been trusted automatically.
Defensive guidance for software teams is reinforced by OWASP API Security Top 10 where redirected API calls or backend fetches can become unsafe if the final resource is not authorised, and by NIST Cybersecurity Framework 2.0 for governance around identification, protection, detection, response, and recovery.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
MITRE ATT&CK addresses the attack and risk surface, while NIST SP 800-53 Rev 5, OWASP ASVS and CIS Controls v8 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev 5 | SC-18 — Mobile Code | EAR is a remote code-loading pattern that fits controls governing executable content from external sources. |
| SI-10 — Information Input Validation | Redirect targets must be revalidated before content is consumed or executed. | |
| Recommendation — Restrict and validate externally sourced executable content before allowing it to run. Validate redirected inputs and reject untrusted execution paths. | ||
| MITRE ATT&CK | T1204 — User Execution | EAR often relies on a user or process causing redirected content to run. |
| Recommendation — Map redirect-triggered execution paths to T1204 and hunt for suspicious user-driven launches. | ||
| OWASP ASVS | V15 — Secure Coding and Architecture | EAR is prevented by designs that separate untrusted navigation from executable content handling. |
| Recommendation — Design application flows so redirects cannot become execution sinks. | ||
| CIS Controls v8 | CIS-16 — Application Software Security | Secure software development practices should address redirect-to-execution flaws. |
| Recommendation — Review application logic for unsafe redirect and remote-execution patterns. | ||
Practitioner Guidance
What to watch for: Treat any design that both follows redirects and executes the response as a higher-risk pattern. The key judgement is whether the final URL is merely navigated to, or whether its content becomes executable without a fresh trust decision.
Governance implication: Security review should explicitly separate redirect handling from code-loading or automation execution. That distinction belongs in secure design reviews, dependency approval, and application testing so a “safe origin” does not become a blanket approval for the redirected target.
Practitioner takeaway: The safest rule is simple, only execute content after redirect when the final source has been independently validated as trustworthy for that exact execution context.
Related resources from NHI Mgmt Group
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on November 25, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org