- What is CWE-681?
- 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.
- What CVEs are caused by CWE-681?
- 51 recorded CVEs are attributed to CWE-681, including CVE-2022-40138, CVE-2019-14842, CVE-2022-36025.
- How do you prevent CWE-681?
- Avoid making conversion between numeric types. Always check for the allowed ranges.
- How is CWE-681 detected?
- Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
- What are the consequences of CWE-681?
- Exploiting CWE-681 can lead to: Unexpected State, Quality Degradation.
- Is CWE-681 actively exploited?
- 51 recorded CVEs are caused by CWE-681; none are currently in CISA's KEV catalog of actively exploited flaws.