CWE-192

Integer Coercion Error

Integer coercion refers to a set of flaws pertaining to the type casting, extension, or truncation of primitive data types.

Mitigation

Phase: Requirements

Description:

  • A language which throws exceptions on ambiguous data casts might be chosen.
Mitigation

Phase: Architecture and Design

Description:

  • Design objects and program flow such that multiple or complex casts are unnecessary
Mitigation

Phase: Implementation

Description:

  • Ensure that any data type casting that you must used is entirely understood in order to reduce the plausibility of error in use.

No CAPEC attack patterns related to this CWE.

Back to CWE stats page