BF Specification of CWE-468 Example 1

../../../../BF/images/BFVUL/BFVUL-CWE-468-Example-1(simple)-0.png
Wrong Code to Cast ((char *)(p + 1) instead of (char *)p + 1) of Pointer data of Primitive type using Pass In mechanism in Codebase source code (CWE-468-Example-1) in Local execution space leads to Wrong Type (int instead of char) error, which propagates to Wrong Argument Type to Call (+ operator) of Object name of Primitive type using Ad-hoc Bind mechanism in Codebase source code (CWE-468-Example-1) in Local execution space that results in Wrong Overloaded Function Bound (+(int*,int) instead of +(char*,int)) error, which propagates to Wrong Overloaded Function Bound to Calculate of Bound name of Pointer data using Operator mechanism in Codebase source code (CWE-468-Example-1) in Local execution space that results in Wrong Result (Pointer position) error, which propagates to Wrong Index to Reposition on Stack with Actual size using Direct mechanism in Codebase source code (CWE-468-Example-1) in Userland execution space that results in Overbound Pointer error, which propagates to Overbound Pointer to Read on Stack with Actual size using Direct mechanism in Codebase source code (CWE-468-Example-1) in Userland execution space that results in Buffer Over-Read final error, which can be exploited toward Information Exposure (IEX) (confidentiality loss) security failure.



vendor:product:


Bug Report


Code with Fix


Code with Bug

ClassDefinition
TCVType Conversion (TCV) class – Data are converted or coerced into other type improperly.
NRSName Resolution (NRS) class – The name of an object, a function, or a type is resolved improperly or bound to an improper type or implementation.
TCMType Computation (TCM) class – An arithmetic expression (over numbers, strings, or pointers) is calculated improperly, or a boolean condition is evaluated improperly.
MADMemory Addressing (MAD) class – The pointer to an object is initialized, dereferenced, repositioned, or reassigned to an improper memory address.
MUSMemory Use (MUS) class – An object is initialized, read, written, or cleared improperly.
OperationDefinition
CastCast operation – Explicitly convert the value of an object to another data type.
CallCall operation – Invoke a function implementation. The Type System binds a function implementation to the resolved function name. A polymorphic function implementation is first resolved and then bound.
CalculateCalculate operation – Find the result of a numeric, pointer, or string operation.
RepositionReposition operation – Change the pointer to another position inside its object.
ReadRead operation – Retrieve the data value of an object from memory.
Cause/ConsequenceDefinition
Code BugCode Bug type – An error in the implementation of an operation – proper operands over an improper operation. It is the roor cause of a security vulnerability. Must be fixed to resolve the vulnerability.
   Wrong CodeWrong Code bug - An incorrect operator or function is used, or an incorrect data type is specified.
TypeType error (or fault) type – The set or range of allowed values of an entity is wrong or the operations allowed on them are wrong.
   Wrong TypeWrong Type error (or fault) – A data type range or structure is not correct.
   Wrong Argument TypeWrong Argument Type error (or fault) – An argument to an overloaded function is of incorrect data type.
Name Error/FaultName error (or fault) type – The fully resolved name of an entity is wrong.
   Wrong Overloaded Function BoundWrong Overloaded Function Bound error (or fault) – Wrong overloaded implementation is bound due to wrong function arguments.
Data Error/FaultData error (or fault) type – The data of an object has harmed semantics or inconsistent or wrong value.
   Wrong ResultWrong Result error (or fault) – Incorrect value – from type conversion or computation.
   Wrong IndexWrong Index error (or fault) – Incorrect index position – hardcoded or from computation.
Address Error/FaultAddress error (or fault) type – The address of an object is wrong.
   Overbound PointerOverbound Pointer error (or fault) – Holds an address that is above the upper boundary of its object.
Memory Corruption/Disclosure Final ErrorMemory Corruption/Disclosure final error/exploit vector type – An exploitable or undefined system behavior caused by memory addressing, allocation, use, or deallocation bugs.
   Buffer Over-ReadBuffer Over-Read final error – Read data above the upper bound of an object.
Operation AttributeDefinition
MechanismMechanism operation attribute type – Shows how the operation with a bug or faulty operand is performed.
   Pass InPass In operation attribute – The operation is via in arguments' values to a function/ operator.
   Ad-hoc BindAd-hoc Bind operation attribute – The operation resolves an overloaded function via signature and sets its implementation.
   OperatorOperator operation attribute – The operation is via a function with a symbolic name that implements a mathematical, relational or logical operation.
   DirectDirect operation attribute – The operation is on a particular object element.
Source CodeSource Code operation attribute type – Shows where the code of the operation with a bug or faulty operand resides within the software, firmware, or hardware.
   CodebaseCodebase operation attribute – The operation is in the programmer's code - in the application itself.
Execution SpaceExecution Space operation attribute type – Shows where the operation with a bug or faulty operand is executed and the privilege level at which it runs.
   LocalLocal operation attribute – The bugged code runs in an environment with access control policy with limited (local user) permission.
   UserlandUserland operation attribute – The bugged code runs in an environment with privilege levels, but in unprivileged mode (e.g., ring 3 in x86 architecture).
Operand AttributeDefinition
Data KindData Kind operand attribute type – Shows what the type or category of data is.
   PointerPointer operand attribute – A holder of the memory address of an object.
Type KindType Kind operand attribute type – Shows what the data type composition is.
   PrimitivePrimitive operand attribute – A scalar data type that mimics the hardware units - e.g., int (long, short, signed), float, double, string, Boolean. A primitive data type is only language defined and is not built from other data types.
Name KindName Kind operand attribute type – Shows what the entity with this name is.
   ObjectObject operand attribute – A memory region used to store data.
Name StateName State operand attribute type – Shows what the stage of the entity name is.
   BoundBound operand attribute – The name is linked to a declared (or inferred) data type, a defined object's data, or a called function implementation.
Address StateAddress State operand attribute type – Shows where the address is (i.e., its location) in the memory layout.
   StackThe object is a non-static local variable (defined in a function, a passed parameter, or a function return address).
Size KindSize Kind operand attribute type – Shows what is used as the size or length (i.e., the number of elements) of an object - e.g., as the limit for traversal over the elements.
   ActualActual operand attribute – The real size or length (i.e., the number of elements) of the allocated memory for an object.
FailureDefinition
IEXInformation Exposure (IEX) – Inadvertent disclosure of information that leads to confidentiality loss.