COMMON WEAKNESS ENUMERATIONIncomplete

CWE-698

Execution After Redirect (EAR)

The web application sends a redirect to another location, but instead of exiting, it executes additional code.

Abstraction

Base

Structure

Simple

Likelihood of Exploit

Medium

Understand the problem

What is the problem?

The web application sends a redirect to another location, but instead of exiting, it executes additional code.

Terminology

Alternate terms and usages

Redirect Without Exit

Root cause

How and when does the problem arise?

Lifecycle phase

Implementation

Risk

What does successful exploitation lead to?

Alter Execution LogicExecute Unauthorized Code or Commands

Affected security scopes: Other, Confidentiality, Integrity, Availability

This weakness could affect the control flow of the application and allow execution of untrusted code.

Defence

How is it prevented and fixed?

  • Follow secure coding guidelines for input handling and boundary checking.
  • Enforce strict security reviews and automated static analysis (SAST) checks.

Verification

How is it detected?

Black Box

This issue might not be detected if testing is performed using a web browser, because the browser might obey the redirect and move the user to a different page before the application has produced outputs that indicate something is amiss.