Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CWE-687 (使用不正确指定参数值的函数调用) — Vulnerability Class 2

2 vulnerabilities classified as CWE-687 (使用不正确指定参数值的函数调用). AI Chinese analysis included.

CWE-687 represents a logic error where a function is invoked with an argument containing an incorrect value, rather than a syntactically invalid one. This weakness typically arises when developers assume default behaviors or fail to validate input parameters before passing them to critical routines. Exploitation often occurs when an attacker manipulates these arguments to bypass security checks, trigger buffer overflows, or cause unintended state changes within the application. For instance, passing a null pointer or an out-of-bounds index can lead to crashes or privilege escalation. To mitigate this risk, developers must implement rigorous input validation and defensive programming practices. Ensuring that all function arguments are explicitly checked against expected ranges and types before execution prevents the propagation of erroneous data, thereby maintaining application integrity and preventing downstream vulnerabilities.

MITRE CWE Description
The product calls a function, procedure, or routine, but the caller specifies an argument that contains the wrong value, which may lead to resultant weaknesses.
Common Consequences (1)
OtherQuality Degradation
Examples (1)
This Perl code intends to record whether a user authenticated successfully or not, and to exit if the user fails to authenticate. However, when it calls ReportAuth(), the third argument is specified as 0 instead of 1, so it does not exit.
sub ReportAuth { my ($username, $result, $fatal) = @_; PrintLog("auth: username=%s, result=%d", $username, $result); if (($result ne "success") && $fatal) { die "Failed!\n"; } } sub PrivilegedFunc { my $result = CheckAuth($username); ReportAuth($username, $result, 0); DoReallyImportantStuff(); }
Bad · Perl

Vulnerabilities classified as CWE-687 (使用不正确指定参数值的函数调用) represent 2 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.