This vulnerability occurs when a function is called with the wrong variable or reference passed as an argument. This simple coding mistake can cause the program to behave unpredictably, access incorrect data, or trigger other security flaws.
At its core, this weakness is a straightforward logic error where a developer accidentally passes an unintended variable to a function. Think of it like giving a shipping clerk the wrong address label—the package (data) gets processed, but it goes to the wrong destination (function parameter), leading to corrupted states, incorrect calculations, or exposure of sensitive information. This often happens during code maintenance, when using similar-looking variable names, or when function signatures change. For developers, prevention hinges on code clarity and rigorous review. Use descriptive, distinct variable names to avoid confusion. Implement static analysis tools that can flag potential argument mismatches, especially after refactoring. Always double-check function calls when modifying related code, as this flaw is easy to introduce but can be difficult to trace during debugging when it manifests far from the original error.
Impact: Quality Degradation
java
// grant or deny access based on user roles* ...}