Execution After Redirect (EAR) occurs when a web application sends a redirect response to a user's browser but continues to run server-side code, potentially performing unintended actions.
This vulnerability happens because the server-side logic doesn't properly halt execution after issuing a redirect command (like an HTTP 302 or 303 status). Instead of stopping, the application proceeds to execute the remaining code in the script or function. This leftover code can perform dangerous operations like updating databases, processing payments, or changing user sessions, even though the user is already being sent to a new page. From a security perspective, EAR is dangerous because an attacker can often interrupt or ignore the redirect. By using tools or crafting requests, they can let the redirect happen in the browser while still receiving and acting upon the results of the unauthorized server-side execution. To prevent this, developers must ensure the application flow terminates immediately after sending a redirect, typically by using explicit return or exit statements in the code.
Impact: Alter Execution LogicExecute Unauthorized Code or Commands
This weakness could affect the control flow of the application and allow execution of untrusted code.
php
...*