Description
The web application sends a redirect to another location, but instead of exiting, it executes additional code.
Potential Impact
Other, Confidentiality, Integrity, Availability
Alter Execution Logic, Execute Unauthorized Code or Commands
Demonstrative Examples
$requestingIP = $_SERVER['REMOTE_ADDR'];if(!in_array($requestingIP,$ipAllowList)){echo "You are not authorized to view this page";http_redirect($errorPageURL);}$status = getServerStatus();echo $status;
...Detection Methods
- 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.
Real-World CVE Examples
| CVE ID | Description |
|---|---|
| CVE-2013-1402 | Execution-after-redirect allows access to application configuration details. |
| CVE-2009-1936 | chain: library file sends a redirect if it is directly requested but continues to execute, allowing remote file inclusion and path traversal. |
| CVE-2007-2713 | Remote attackers can obtain access to administrator functionality through EAR. |
| CVE-2007-4932 | Remote attackers can obtain access to administrator functionality through EAR. |
| CVE-2007-5578 | Bypass of authentication step through EAR. |
| CVE-2007-2713 | Chain: Execution after redirect triggers eval injection. |
| CVE-2007-6652 | chain: execution after redirect allows non-administrator to perform static code injection. |
Related Weaknesses
Frequently Asked Questions
What is CWE-698?
CWE-698 (Execution After Redirect (EAR)) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Base-level weakness. The web application sends a redirect to another location, but instead of exiting, it executes additional code.
How can CWE-698 be exploited?
Attackers can exploit CWE-698 (Execution After Redirect (EAR)) to alter execution logic, execute unauthorized code or commands. This weakness is typically introduced during the Implementation phase of software development.
How do I prevent CWE-698?
Follow secure coding practices, conduct code reviews, and use automated security testing tools (SAST/DAST) to detect this weakness early in the development lifecycle.
What is the severity of CWE-698?
CWE-698 is classified as a Base-level weakness (Medium abstraction). It has been observed in 7 real-world CVEs.