CWE-681Incorrect Conversion between Numeric Types

PUBLISHEDweakness recordHigh
released 2008-04-11 · last modified 2025-12-11

Metadata

CWE ID:
CWE-681
摘要:
Base
结构:
Simple
状态:
Draft
发布日期:
2008-04-11
更新日期:
2025-12-11

名称

Incorrect Conversion between Numeric Types

描述

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.

常见后果

范围:
Other, Integrity
影响:
Unexpected State, Quality Degradation
注释:
The program could wind up using the wrong number and generate incorrect results. If the number is used to allocate resources or make a security decision, then this could introduce a vulnerability.

相关 CWE