---
title: "CWE-628: Function Call with Incorrectly Specified Arguments"
url: https://radicalnotion.ai/cwe/cwe-628
type: cwe
description: "The product calls a function, procedure, or routine with arguments that are not correctly specified."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-628: Function Call with Incorrectly Specified Arguments

- **Abstraction:** Base
- **Structure:** Simple
- **Status:** Draft
- **CVEs with this as primary weakness:** 32
- **Of those, in CISA KEV:** 0
- **New in 2026:** 16
- **CWE catalog version:** 4.21

## Description

The product calls a function, procedure, or routine with arguments that are not correctly specified.

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.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | - |

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Other, Access Control | Quality Degradation, Gain Privileges or Assume Identity, Unexpected State, Varies by Context | 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. |

## Potential mitigations

### Build and Compilation

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.

### Architecture and Design

Make sure your API's are stable before you use them in production code.

## Detection methods

### 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.

## Demonstrative examples

### Example 1

The following PHP method authenticates a user given a username/password combination but is called with the parameters in reverse order.

Bad code:

```php
function authenticate($username, $password) {

    // authenticate user
    ...
}

authenticate($_POST['password'], $_POST['username']);
```

### Example 2

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.

Bad code:

```perl
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();
}
```

### Example 3

In the following Java snippet, the accessGranted() method is accidentally called with the static ADMIN\_ROLES array rather than the user roles.

Bad code:

```java
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
    ...
}
```

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2006-7049 | The method calls the functions with the wrong argument order, which allows remote attackers to bypass intended access restrictions. |

## Real CVEs with this weakness (sample of 12 of 32)

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2026-68185 | LoongArch: Move jump\_label\_init() before parse\_early\_param() | critical | 9.8 | - | No | 2026-08-10 |
| CVE-2026-43283 | net: ethernet: ec\_bhf: Fix dma\_free\_coherent() dma handle | high | 8.8 | - | No | 2026-05-06 |
| CVE-2025-38216 | iommu/vt-d: Restore context entry setup order for aliased devices | high | 8.8 | - | No | 2025-07-04 |
| CVE-2026-104430 | Zebra 4.5.0 Consensus Split via P2SH Sigop Overcount | high | 8.7 | - | No | 2026-10-02 |
| CVE-2026-43133 | KVM: nSVM: Always use vmcb01 in VMLOAD/VMSAVE emulation | high | 7.9 | - | No | 2026-05-06 |
| CVE-2026-100078 | wifi: iwlwifi: mei: pass correct argument to function | high | 7.8 | - | No | 2026-09-25 |
| CVE-2026-74595 | fscrypt: use the mount idmap for the owner check in fscrypt\_ioctl\_set\_policy() | high | 7.8 | - | No | 2026-08-22 |
| CVE-2025-68234 | io\_uring/cmd\_net: fix wrong argument types for skb\_queue\_splice() | high | 7.8 | - | No | 2025-12-16 |
| CVE-2023-53215 | sched/fair: Don't balance task to its current running CPU | high | 7.8 | - | No | 2025-09-15 |
| CVE-2024-58008 | KEYS: trusted: dcp: fix improper sg use with CONFIG\_VMAP\_STACK=y | high | 7.8 | - | No | 2025-02-27 |
| CVE-2022-48834 | usb: usbtmc: Fix bug in pipe direction for control transfers | high | 7.8 | - | No | 2024-07-16 |
| CVE-2024-35839 | netfilter: bridge: replace physindev with physinif in nf\_bridge\_info | high | 7.8 | - | No | 2024-05-17 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-573](https://radicalnotion.ai/cwe/cwe-573) | Improper Following of Specification by Caller |
| Child | [CWE-683](https://radicalnotion.ai/cwe/cwe-683) | Function Call With Incorrect Order of Arguments |
| Child | [CWE-685](https://radicalnotion.ai/cwe/cwe-685) | Function Call With Incorrect Number of Arguments |
| Child | [CWE-686](https://radicalnotion.ai/cwe/cwe-686) | Function Call With Incorrect Argument Type |
| Child | [CWE-687](https://radicalnotion.ai/cwe/cwe-687) | Function Call With Incorrectly Specified Argument Value |
| Child | [CWE-688](https://radicalnotion.ai/cwe/cwe-688) | Function Call With Incorrect Variable or Reference as Argument |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| 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 |
| SEI CERT Perl Coding Standard | Do not use subroutine prototypes | DCL00-PL | CWE More Abstract |
| SEI CERT Perl Coding Standard | Do not invoke a function in a context for which it is not defined | EXP33-PL | Imprecise |

## Frequently asked questions

### 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?

32 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?

32 recorded CVEs are caused by CWE-628; none are currently in CISA's KEV catalog of actively exploited flaws.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/628.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-628). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
