This weakness occurs when a function is called with arguments that are incorrectly specified, causing the function to behave in an unintended and consistently wrong manner.
This bug happens when the arguments passed to a function don't match what the function expects. Common mistakes include passing the wrong variable, providing too many or too few arguments, mixing up the argument order, using an incompatible data type, or supplying an incorrect literal value. Any of these errors will cause the function to process the wrong data, leading to unpredictable results, crashes, or security vulnerabilities. For developers, preventing this issue requires careful attention to function signatures and API documentation. Always double-check the number, type, and order of arguments when calling functions, especially when working with external libraries or complex internal APIs. Using modern IDE features like type hints and auto-completion can help catch these mismatches early in the development cycle.
Impact: Quality DegradationGain Privileges or Assume Identity
This weakness can cause unintended behavior and can lead to additional weaknesses such as allowing an attacker to gain unintended access to system resources.
php
// authenticate user* ...}
phpperljava
// grant or deny access based on user roles* ...}