---
title: "CWE-688: Function Call With Incorrect Variable or Reference as Argument"
url: https://radicalnotion.ai/cwe/cwe-688
type: cwe
description: "The product calls a function, procedure, or routine, but the caller specifies the wrong variable or reference as one of the arguments, which may lead to undefined behavior and resultant weaknesses."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-688: Function Call With Incorrect Variable or Reference as Argument

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

## Description

The product calls a function, procedure, or routine, but the caller specifies the wrong variable or reference as one of the arguments, which may lead to undefined behavior and resultant weaknesses.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | This problem typically occurs when the programmer makes a typo, or copy and paste errors. |

## Applicable platforms

**Languages:** C (Undetermined), Perl (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Other | Quality Degradation | - |

## Potential mitigations

### Testing

Because this function call often produces incorrect behavior it will usually be detected during testing or normal operation of the product. During testing exercise all possible control paths will typically expose this weakness except in rare cases when the incorrect function call accidentally produces the correct results or if the provided argument type is very similar to the expected argument type.

## Detection methods

### Other

While this weakness might be caught by the compiler in some languages, it can occur more frequently in cases in which the called function accepts variable numbers of arguments, such as format strings in C. It also can occur in loosely typed languages or environments. This might require an understanding of intended program behavior or design to determine whether the value is incorrect.

## Demonstrative examples

### Example 1

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-2005-2548 | Kernel code specifies the wrong variable in first argument, leading to resultant NULL pointer dereference. |

## Real CVEs with this weakness

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2026-33549 | - | high | 8.8 | - | No | 2026-03-22 |
| CVE-2026-76878 | aodh: python-watcher: aodh / python-watcher: cross-project alarm enumeration and webhook missing authorization | high | 8.4 | - | No | 2026-08-19 |
| CVE-2026-101959 | Junos OS and Junos OS Evolved: A malformed LSP-ping causes an rpd crash | high | 7.1 | - | No | 2026-10-14 |
| CVE-2021-33713 | Function Call With Incorrect Variable or Reference as Argument in Siemens JT Utilities | medium | 5.5 | - | No | 2021-07-13 |
| CVE-2026-12311 | Information disclosure, sandbox escape in the Security: Process Sandboxing component | medium | 4.7 | - | No | 2026-06-16 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-628](https://radicalnotion.ai/cwe/cwe-628) | Function Call with Incorrectly Specified Arguments |

## Frequently asked questions

### What is CWE-688?

The product calls a function, procedure, or routine, but the caller specifies the wrong variable or reference as one of the arguments, which may lead to undefined behavior and resultant weaknesses.

### What CVEs are caused by CWE-688?

5 recorded CVEs are attributed to CWE-688, including CVE-2026-33549, CVE-2026-76878 and CVE-2026-101959.

### How do you prevent CWE-688?

Because this function call often produces incorrect behavior it will usually be detected during testing or normal operation of the product. During testing exercise all possible control paths will typically expose this weakness except in rare cases when the incorrect function call accidentally produces the correct results or if the provided argument type is very similar to the expected argument type.

### How is CWE-688 detected?

Other: While this weakness might be caught by the compiler in some languages, it can occur more frequently in cases in which the called function accepts variable numbers of arguments, such as format strings in C. It also can occur in loosely typed languages or environments. This might require an understanding of intended program behavior or design to determine whether the value is incorrect.

### What are the consequences of CWE-688?

Exploiting CWE-688 can lead to: Quality Degradation.

### Is CWE-688 actively exploited?

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

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

---

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