1986
ParentOf 1280 Access Control Check Implemented After Asset is Accessed 2122
Weakness Ordinalities
Primary :
Common Consequences
Scope Impact Likelihood
Integrity Alter Execution Logic
Demonstrative Examples
Example 1:
The following code attempts to validate a given input path by checking it against an allowlist and
then return the canonical path. In this specific case, the path is considered valid if it starts with the
string "/safe_dir/".
Example Language: Java (Bad)
String path = getInputPath();
if (path.startsWith("/safe_dir/"))
{
File f = new File(path);
CWE Version 4.14
CWE-696: Incorrect Behavior Order
CWE-696: Incorrect Behavior Order