Skip to content

CWE-681: Incorrect Conversion between Numeric Types

BaseLikelihood of exploit: High

When converting from one data type to another, such as long to integer, data can be omitted or translated in a way that produces unexpected values. If the resulting values are used in a sensitive context, then dangerous behaviors may occur.

Consequences

  • Other, Integrity: Unexpected State, Quality Degradation

How to prevent it

  • Implementation: Avoid making conversion between numeric types. Always check for the allowed ranges.

Recent advisories

All advisories for CWE-681

Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor