CWE-628: Function Call with Incorrectly Specified Arguments
The product calls a function, procedure, or routine with arguments that are not correctly specified.
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
31 recorded CVEs are caused by CWE-628 (Function Call with Incorrectly Specified Arguments). The highest-severity and most recent are shown first. 15 new CWE-628 CVEs have been recorded so far in 2026 (10 in 2025).
- CVE-2026-68185
LoongArch: Move jump_label_init() before parse_early_param()
Critical · CVSS 9.8 · EPSS 7th2026-08-10 - CVE-2026-43283
net: ethernet: ec_bhf: Fix dma_free_coherent() dma handle
High · CVSS 8.8 · EPSS 4th2026-05-06 - CVE-2025-38216
iommu/vt-d: Restore context entry setup order for aliased devices
High · CVSS 8.8 · EPSS 14th2025-07-04 - CVE-2026-104430
Zebra 4.5.0 Consensus Split via P2SH Sigop Overcount
High · CVSS 8.7 · EPSS 42th2026-10-02 - CVE-2026-100078
wifi: iwlwifi: mei: pass correct argument to function
High · CVSS 7.8 · EPSS 3th2026-09-25 - CVE-2026-74595
fscrypt: use the mount idmap for the owner check in fscrypt_ioctl_set_policy()
High · CVSS 7.8 · EPSS 1th2026-08-22 - CVE-2025-68234
io_uring/cmd_net: fix wrong argument types for skb_queue_splice()
High · CVSS 7.8 · EPSS 7th2025-12-16 - CVE-2023-53215
sched/fair: Don't balance task to its current running CPU
High · CVSS 7.8 · EPSS 10th2025-09-15 - CVE-2024-58008
KEYS: trusted: dcp: fix improper sg use with CONFIG_VMAP_STACK=y
High · CVSS 7.8 · EPSS 5th2025-02-27 - CVE-2022-48834
usb: usbtmc: Fix bug in pipe direction for control transfers
High · CVSS 7.8 · EPSS 18th2024-07-16 - CVE-2024-35839
netfilter: bridge: replace physindev with physinif in nf_bridge_info
High · CVSS 7.8 · EPSS 18th2024-05-17 - CVE-2019-14844
krb5: reversed strlcpy() allows client to crash the KDC
High · CVSS 7.5 · EPSS 92th2019-09-26
Showing 12 of 31 recorded CWE-628 CVEs. Get an alert for each new one, with AI-written analysis and fixes.
Monitor these CVEsCommon consequences
What can happen when CWE-628 is exploited.
Quality Degradation, Gain Privileges or Assume Identity, Unexpected State, Varies by Context
Affects: Other, Access Control
This weakness can cause unintended, always-incorrect behavior. It 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 user
...
}
authenticate($_POST['password'], $_POST['username']);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.
Vulnerable example
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();
}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 = ...;
public boolean void accessGranted(String resource, String user) {
String[] userRoles = getUserRoles(user);
return accessGranted(resource, ADMIN_ROLES);
}
private boolean void accessGranted(String resource, String[] userRoles) {
// grant or deny access based on user roles
...
}Illustrative 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.
- What CVEs are caused by CWE-628?
- 31 recorded CVEs are attributed to CWE-628, including CVE-2026-68185, CVE-2026-43283 and CVE-2025-38216.
- 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, Unexpected State, Varies by Context.
- Is CWE-628 actively exploited?
- 31 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.21). 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.