Weakness · High

CWE-234: Failure to Handle Missing Parameter

What it is

If too few arguments are sent to a function, the function will still pop the expected number of arguments from the stack. Potentially, a variable number of arguments could be exhausted in a function as well.

Likelihood of exploit: HighMITRE CWE 4.19.1

Severity (our rating)
High
Likelihood of exploit
High
Introduced during
Implementation
Exploited in the wild
No CVE in CISA's catalog

What an attacker can do

  • Execute Unauthorized Code or Commands (Integrity, Confidentiality, Availability, Access Control)
  • Gain Privileges or Assume Identity (Integrity, Confidentiality, Availability, Access Control)
  • DoS: Crash, Exit, or Restart (Availability)

How to prevent it

Build and Compilation

  • This issue can be simply combated with the use of proper build process.

Implementation

  • Forward declare all functions. This is the recommended solution. Properly forward declaration of all used functions will result in a compiler error if too few arguments are sent to a function.

CWE-234 on MITRE's CWE site

H2 Security

Found it in your code?

We review where it appears, fix it with your team, and check it was not already used against you.

Talk to our team

T Academy

Stop writing it in the first place

Learn to build software and systems without weaknesses like this one, with practice on real hosts in your browser, every objective checked on the machine.

Start free

Source: MITRE Common Weakness Enumeration, CWE version 4.19.1. CWE is a trademark of The MITRE Corporation.