Weakness · Medium

CWE-622: Improper Validation of Function Hook Arguments

What it is

The product adds hooks to user-accessible API functions, but it does not properly validate the arguments. This could lead to resultant vulnerabilities.

MITRE CWE 4.19.1

Severity (our rating)
Medium
Likelihood of exploit
Not rated by MITRE
Introduced during
Implementation
Exploited in the wild
No CVE in CISA's catalog

In more detail

Such hooks can be used in defensive software that runs with privileges, such as anti-virus or firewall, which hooks kernel calls. When the arguments are not validated, they could be used to bypass the protection scheme or attack the product itself.

What an attacker can do

  • Unexpected State (Integrity)

How to prevent it

Architecture and Design

  • Ensure that all arguments are verified, as defined by the API you are protecting.
  • Drop privileges before invoking such functions, if possible.

CWE-622 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.