The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
Input validation is a frequently-used technique for checking potentially dangerous inputs in order to ensure that the inputs are safe for processing within the code, or when communicating with other components. Input can consist of: raw data - strings, numbers, parameters, file contents, etc. metadata - information about the raw data, such as headers or size Data can be simple or structured. Structured data can be composed of many nested layers, composed of combinations of metadata and raw data, with other simple or structured data. Many properties of raw data or metadata may need to be validated upon entry into the code, such as: specified quantities such as size, length, frequency, price, rate, number of operations, time, etc. implied or derived quantities, such as the actual size of a file instead of a specified size indexes, offsets, or positions into more complex data structures symbolic keys or other elements into hash tables, associative arrays, etc. well-formedness, i.e. syntactic correctness - compliance with expected syntax lexical token correctness - compliance with rules for what is treated as a token specified or derived type - the actual type of the input (or what the input appears to be) consistency - between individual data elements, between raw data and metadata, between references, etc. conformance to domain-specific rules, e.g. business logic equivalence - ensuring that equivalent inputs are treated the same authenticity, ownership, or other attestations about the input, e.g. a cryptographic signature to prove the source of the data Implied or derived properties of data must often be calculated or inferred by the code itself. Errors in deriving properties may be considered a contributing factor to improper input validation.
Threat Mapped score: 1.8
Industry: Finiancial
Threat priority: P4 - Informational (Low)
CVE: CVE-2024-37032
Large language model (LLM) management tool does not validate the format of a digest value (CWE-1287) from a private, untrusted model registry, enabling relative path traversal (CWE-23), a.k.a. Probllama
CVE: CVE-2022-45918
Chain: a learning management tool debugger uses external input to locate previous session logs (CWE-73) and does not properly validate the given path (CWE-20), allowing for filesystem path traversal using "../" sequences (CWE-24)
CVE: CVE-2021-30860 — KEV
Chain: improper input validation (CWE-20) leads to integer overflow (CWE-190) in mobile OS, as exploited in the wild per CISA KEV.
CVE: CVE-2021-30663 — KEV
Chain: improper input validation (CWE-20) leads to integer overflow (CWE-190) in mobile OS, as exploited in the wild per CISA KEV.
CVE: CVE-2021-22205 — KEV
Chain: backslash followed by a newline can bypass a validation step (CWE-20), leading to eval injection (CWE-95), as exploited in the wild per CISA KEV.
CVE: CVE-2021-21220 — KEV
Chain: insufficient input validation (CWE-20) in browser allows heap corruption (CWE-787), as exploited in the wild per CISA KEV.
CVE: CVE-2020-9054 — KEV
Chain: improper input validation (CWE-20) in username parameter, leading to OS command injection (CWE-78), as exploited in the wild per CISA KEV.
CVE: CVE-2020-3452 — KEV
Chain: security product has improper input validation (CWE-20) leading to directory traversal (CWE-22), as exploited in the wild per CISA KEV.
CVE: CVE-2020-3161 — KEV
Improper input validation of HTTP requests in IP phone, as exploited in the wild per CISA KEV.
CVE: CVE-2020-3580 — KEV
Chain: improper input validation (CWE-20) in firewall product leads to XSS (CWE-79), as exploited in the wild per CISA KEV.
CVE: CVE-2021-37147
Chain: caching proxy server has improper input validation (CWE-20) of headers, allowing HTTP response smuggling (CWE-444) using an "LF line ending"
CVE: CVE-2008-5305
Eval injection in Perl program using an ID that should only contain hyphens and numbers.
CVE: CVE-2008-2223
SQL injection through an ID that was supposed to be numeric.
CVE: CVE-2008-3477
lack of input validation in spreadsheet program leads to buffer overflows, integer overflows, array index errors, and memory corruption.
CVE: CVE-2008-3843
insufficient validation enables XSS
CVE: CVE-2008-3174
driver in security product allows code execution due to insufficient validation
CVE: CVE-2007-3409
infinite loop from DNS packet with a label that points to itself
CVE: CVE-2006-6870
infinite loop from DNS packet with a label that points to itself
CVE: CVE-2008-1303
missing parameter leads to crash
CVE: CVE-2007-5893
HTTP request with missing protocol version number leads to crash
CVE: CVE-2006-6658
request with missing parameters leads to information exposure
CVE: CVE-2008-4114
system crash with offset value that is inconsistent with packet size
CVE: CVE-2006-3790
size field that is inconsistent with packet size leads to buffer over-read
CVE: CVE-2008-2309
product uses a denylist to identify potentially dangerous content, allowing attacker to bypass a warning
CVE: CVE-2008-3494
security bypass via an extra header
CVE: CVE-2008-3571
empty packet triggers reboot
CVE: CVE-2006-5525
incomplete denylist allows SQL injection
CVE: CVE-2008-1284
NUL byte in theme name causes directory traversal impact to be worse
CVE: CVE-2008-0600
kernel does not validate an incoming pointer before dereferencing it
CVE: CVE-2008-1738
anti-virus product has insufficient input validation of hooked SSDT functions, allowing code execution
CVE: CVE-2008-1737
anti-virus product allows DoS via zero-length field
CVE: CVE-2008-3464
driver does not validate input from userland to the kernel
CVE: CVE-2008-2252
kernel does not validate parameters sent in from userland, allowing code execution
CVE: CVE-2008-2374
lack of validation of string length fields allows memory consumption or buffer over-read
CVE: CVE-2008-1440
lack of validation of length field leads to infinite loop
CVE: CVE-2008-1625
lack of validation of input to an IOCTL allows code execution
CVE: CVE-2008-3177
zero-length attachment causes crash
CVE: CVE-2007-2442
zero-length input causes free of uninitialized pointer
CVE: CVE-2008-5563
crash via a malformed frame structure
CVE: CVE-2008-5285
infinite loop from a long SMTP request
CVE: CVE-2008-3812
router crashes with a malformed packet
CVE: CVE-2008-3680
packet with invalid version number leads to NULL pointer dereference
CVE: CVE-2008-3660
crash via multiple "." characters in file extension
Phase | Note |
---|---|
Architecture and Design | N/A |
Implementation | REALIZATION: This weakness is caused during implementation of an architectural security tactic. If a programmer believes that an attacker cannot modify certain inputs, then the programmer might not perform any input validation at all. For example, in web applications, many programmers believe that cookies and hidden form fields can not be modified from a web browser (CWE-472), although they can be altered using a proxy or a custom program. In a client-server architecture, the programmer might assume that client-side security checks cannot be bypassed, even when a custom client could be written that skips those checks (CWE-602). |
Intro: This example demonstrates a shopping interaction in which the user is free to specify the quantity of items to be purchased and a total is calculated.
Body: The user has no control over the price variable, however the code does not prevent a negative value from being specified for quantity. If an attacker were to provide a negative value, then the user would have their account credited instead of debited.
... public static final double price = 20.00; int quantity = currentUser.getAttribute("quantity"); double total = price * quantity; chargeUser(total); ...
Intro: This example asks the user for a height and width of an m X n game board with a maximum dimension of 100 squares.
Body: While this code checks to make sure the user cannot specify large, positive integers and consume too much memory, it does not check for negative values supplied by the user. As a result, an attacker can perform a resource consumption (CWE-400) attack against this program by specifying two, large negative values that will not overflow, resulting in a very large memory allocation (CWE-789) and possibly a system crash. Alternatively, an attacker can provide very large negative values which will cause an integer overflow (CWE-190) and unexpected behavior will follow depending on how the values are treated in the remainder of the program.
... #define MAX_DIM 100 ... /* board dimensions */ int m,n, error; board_square_t *board; printf("Please specify the board height: \n"); error = scanf("%d", &m); if ( EOF == error ){ die("No integer passed: Die evil hacker!\n"); } printf("Please specify the board width: \n"); error = scanf("%d", &n); if ( EOF == error ){ die("No integer passed: Die evil hacker!\n"); } if ( m > MAX_DIM || n > MAX_DIM ) { die("Value too large: Die evil hacker!\n"); } board = (board_square_t*) malloc( m * n * sizeof(board_square_t)); ...
Intro: The following example shows a PHP application in which the programmer attempts to display a user's birthday and homepage.
Body: The programmer intended for $birthday to be in a date format and $homepage to be a valid URL. However, since the values are derived from an HTTP request, if an attacker can trick a victim into clicking a crafted URL with <script> tags providing the values for birthday and / or homepage, then the script will run on the client's browser when the web server echoes the content. Notice that even if the programmer were to defend the $birthday variable by restricting input to integers and dashes, it would still be possible for an attacker to provide a string of the form:
$birthday = $_GET['birthday']; $homepage = $_GET['homepage']; echo "Birthday: $birthday<br>Homepage: <a href=$homepage>click here</a>"
Intro: The following example takes a user-supplied value to allocate an array of objects and then operates on the array.
Body: This example attempts to build a list from a user-specified value, and even checks to ensure a non-negative value is supplied. If, however, a 0 value is provided, the code will build an array of size 0 and then try to store a new Widget in the first location, causing an exception to be thrown.
private void buildList ( int untrustedListSize ){ if ( 0 > untrustedListSize ){ die("Negative value supplied for list size, die evil hacker!"); } Widget[] list = new Widget [ untrustedListSize ]; list[0] = new Widget(); }
Intro: This Android application has registered to handle a URL when sent an intent:
Body: The application assumes the URL will always be included in the intent. When the URL is not present, the call to getStringExtra() will return null, thus causing a null pointer exception when length() is called.
... IntentFilter filter = new IntentFilter("com.example.URLHandler.openURL"); MyReceiver receiver = new MyReceiver(); registerReceiver(receiver, filter); ... public class UrlHandlerReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if("com.example.URLHandler.openURL".equals(intent.getAction())) { String URL = intent.getStringExtra("URLToOpen"); int length = URL.length(); ... } } }