CWE-191: Integer Underflow (Wrap or Wraparound)
The product subtracts one value from another, such that the result is less than the minimum allowable integer value, which produces a value that is not equal to the correct result.
Browse cwe for c# with official CWE context and Glexia analysis.
Search And Filters
Showing 23 of 23 CWE records.
The product subtracts one value from another, such that the result is less than the minimum allowable integer value, which produces a value that is not equal to the correct result.
Integer coercion refers to a set of flaws pertaining to the type casting, extension, or truncation of primitive data types.
Truncation errors occur when a primitive is cast to a primitive of a smaller size and data is lost in the conversion.
An exception is thrown from a function, but it is not caught.
If two threads of execution use a resource simultaneously, there exists the possibility that resources may be used while invalid, in turn making the state of execution undefined.
The product sends non-cloned mutable data as an argument to a method or function.
Sending non-cloned mutable data as a return value may result in that data being altered or deleted by the calling function.
Catching overly broad exceptions promotes complex error handling code that is more likely to contain security vulnerabilities.
The product throws or raises an overly broad exceptions that can hide important details and produce inappropriate responses to certain conditions.
The product does not clean up its state or incorrectly cleans up its state when an exception is thrown, leading to unexpected state or control flow.
Duplicate keys in associative lists can lead to non-unique keys being mistaken for an error.
The product dereferences a pointer that it expects to be valid but is NULL.
The code does not have a default case in an expression with multiple conditions, such as a switch statement.
The code uses an operator for assignment when the intention was to perform a comparison.
The product omits a break statement within a switch or similar construct, causing code associated with multiple conditions to execute. This can cause problems when the programmer only intended to execute code associated with one condition.
The product has a method that is declared public, but returns a reference to a private data structure, which could then be modified in unexpected ways.
Assigning public data to a private array is equivalent to giving public access to the array.
The code contains a class with sensitive data, but the class is cloneable. The data can then be accessed by cloning the class.
The product sets a pointer to a specific address other than NULL or 0.
The product declares a critical variable, field, or member to be public when intended security policy requires it to be private.
The product defines a public method that reads or modifies a private variable.
The code uses boxed primitives, which may introduce inefficiencies into performance-critical operations.
An integer value is specified to be shifted by a negative amount or an amount greater than or equal to the number of bits contained in the value causing an unexpected or indeterminate result.