CWE-628: Function Call with Incorrectly Specified Arguments
The product calls a function, procedure, or routine with arguments that are not correctly specified, leading to always-incorrect behavior and resultant weaknesses.
Last updated
Overview
There are multiple ways in which this weakness can be introduced, including: the wrong variable or reference; an incorrect number of arguments; incorrect order of arguments; wrong type of arguments; or wrong value.
Real-world CVEs
5 recorded CVEs are caused by CWE-628 (Function Call with Incorrectly Specified Arguments). The highest-severity and most recent are shown first. 3 new CWE-628 CVEs have been recorded so far in 2026.
- CVE-2026-104430
Zebra 4.5.0 Consensus Split via P2SH Sigop Overcount
High · CVSS 8.7 · EPSS 35th2026-10-02 - CVE-2026-43133
KVM: nSVM: Always use vmcb01 in VMLOAD/VMSAVE emulation
High · CVSS 7.9 · EPSS 3th2026-05-06 - CVE-2019-14844High · CVSS 7.5 · EPSS 91th2019-09-26
- CVE-2019-7303
Snapd seccomp filter TIOCSTI ioctl bypass
High · CVSS 7.5 · EPSS 90th2019-04-23 - CVE-2026-116652
Tanium addressed a business logic error in Threat Response.
Medium · CVSS 4.3 · EPSS 10th2026-11-03
Common consequences
What can happen when CWE-628 is exploited.
Quality Degradation, Gain Privileges or Assume Identity
Affects: Other, Access Control
This weakness can cause unintended behavior and can lead to additional weaknesses such as allowing an attacker to gain unintended access to system resources.
How it happens
When it is introduced
Typically introduced during these phases of the software lifecycle.
How to prevent it
Practical mitigations for CWE-628, grouped by where in the lifecycle they apply.
Once found, these issues are easy to fix. Use code inspection tools and relevant compiler features to identify potential violations. Pay special attention to code that is not likely to be exercised heavily during QA.
Make sure your API's are stable before you use them in production code.
How to detect it
Other
Since these bugs typically introduce incorrect behavior that is obvious to users, they are found quickly, unless they occur in rarely-tested code paths. Managing the correct number of arguments can be made more difficult in cases where format strings are used, or when variable numbers of arguments are supported.
Code examples
MITRE examples of the weakness in code.
The following PHP method authenticates a user given a username/password combination but is called with the parameters in reverse order.
Vulnerable example
function authenticate($username, $password) {
// authenticate userThis 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.
Vulnerable example
sub ReportAuth {
my ($username, $result, $fatal) = @_;
die "Failed!\n";
my $result = CheckAuth($username);In the following Java snippet, the accessGranted() method is accidentally called with the static ADMIN_ROLES array rather than the user roles.
Vulnerable example
private static final String[] ADMIN_ROLES = ...;
String[] userRoles = getUserRoles(user);
// grant or deny access based on user rolesIllustrative examples
Real CVEs that MITRE cites as examples of this weakness.
- CVE-2006-7049 — The method calls the functions with the wrong argument order, which allows remote attackers to bypass intended access restrictions.
Terminology & mappings
Mapped taxonomies
- CERT C Secure Coding: Maintain the contract between the writer and caller of variadic functions (DCL10-C)
- CERT C Secure Coding: Call functions with the correct number and type of arguments (EXP37-C) — CWE More Abstract fit
- SEI CERT Perl Coding Standard: Do not use subroutine prototypes (DCL00-PL) — CWE More Abstract fit
- SEI CERT Perl Coding Standard: Do not invoke a function in a context for which it is not defined (EXP33-PL) — Imprecise fit
Frequently asked questions
Common questions about CWE-628.
- What is CWE-628?
- The product calls a function, procedure, or routine with arguments that are not correctly specified, leading to always-incorrect behavior and resultant weaknesses.
- What CVEs are caused by CWE-628?
- 5 recorded CVEs are attributed to CWE-628, including CVE-2026-104430, CVE-2026-43133 and CVE-2019-14844.
- How do you prevent CWE-628?
- Once found, these issues are easy to fix. Use code inspection tools and relevant compiler features to identify potential violations. Pay special attention to code that is not likely to be exercised heavily during QA.
- How is CWE-628 detected?
- Other: Since these bugs typically introduce incorrect behavior that is obvious to users, they are found quickly, unless they occur in rarely-tested code paths. Managing the correct number of arguments can be made more difficult in cases where format strings are used, or when variable numbers of arguments are supported.
- What are the consequences of CWE-628?
- Exploiting CWE-628 can lead to: Quality Degradation, Gain Privileges or Assume Identity.
- Is CWE-628 actively exploited?
- 5 recorded CVEs are caused by CWE-628; none are currently in CISA's KEV catalog of actively exploited flaws.
References
- MITRE CWE definition (CWE-628) (opens in a new tab)
- CWE-628 vulnerabilities on NVD (opens in a new tab)
- Learn: What is a CWE?
Weakness data is sourced from the MITRE CWE catalog (v4.20). CVE associations are aggregated and kept current by RadicalNotion.AI.
Track CWE-628 CVEs
Get an alert when a new CWE-628 CVE affects your products, with AI-written analysis and remediation steps.