What it is
The product checks a value to ensure that it is less than or equal to a maximum, but it does not also verify that the value is greater than or equal to the minimum.
Impact on systems
| Scope | Impact |
|---|---|
| Confidentiality, Integrity | Modify Memory, Read Memory If a negative value is used to access memory, buffers, or other indexable structures, it could access memory outside the bounds of the buffer. |
| Availability | DoS: Resource Consumption (Memory), DoS: Resource Consumption (Other) In some contexts, a negative value could lead to resource consumption, e.g., if the negative value is used for memory allocation. |
| Integrity, Confidentiality, Availability | Modify Application Data, Execute Unauthorized Code or Commands An attacker could modify the structure of the message or data being sent to the downstream component, possibly injecting commands. |
| Integrity | Varies by Context, Unexpected State The use of a negative number in a positive-only context could have security implications for other types of resources. For example, a shopping cart might check that the user is not requesting more than 10 items, but a request for -3 items could cause the application to calculate a negative price and credit the attacker's account. |
How to prevent it
Source: MITRE CWE catalog · Official entry on the MITRE website