CWE-192

Integer Coercion Error

High

Description

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

Potential Impact

How to Fix

Requirements

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

Architecture and Design

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

Implementation

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

Detection Methods

Related Weaknesses

References

View on MITRE CWE Database →

Need Help Fixing This Vulnerability?

Our security experts can help you identify and remediate CWE-192 vulnerabilities in your codebase.

Get Security Assessment