39 vulnerabilities classified as CWE-197 (数值截断错误). AI Chinese analysis included.
CWE-197, Numeric Truncation Error, is a software weakness occurring when a value is cast from a larger primitive type to a smaller one, causing high-order bits to be discarded and resulting in data loss. This flaw is typically exploited by attackers who manipulate input values to trigger unexpected numeric conversions, potentially leading to buffer overflows, out-of-bounds memory access, or logic errors when the truncated value serves as an array index or loop iterator. Developers can prevent this vulnerability by implementing rigorous input validation to ensure values fit within the target data type’s range before casting. Additionally, using safe conversion functions, enabling compiler warnings for implicit narrowing conversions, and employing static analysis tools to detect potential truncation scenarios during the development lifecycle are essential strategies for mitigating this risk and maintaining application integrity.
int intPrimitive; short shortPrimitive; intPrimitive = (int)(~((int)0) ^ (1 << (sizeof(int)*8-1))); shortPrimitive = intPrimitive; printf("Int MAXINT: %d\nShort MAXINT: %d\n", intPrimitive, shortPrimitive);Int MAXINT: 2147483647 Short MAXINT: -1... // update sales database for number of product sold with product ID public void updateSalesForProduct(String productID, int amountSold) { // get the total number of products in inventory database int productCount = inventory.getProductCount(productID); // convert integer values to short, the method for the // sales object requires the parameters to be of type short short count = (short) productCount; short sold = (short) amountSold; // update sales database for product sales.updateSalesCount(productID, count, sold); } ...... // update sales database for number of product sold with product ID public void updateSalesForProduct(String productID, int amountSold) { // get the total number of products in inventory database int productCount = inventory.getProductCount(productID); // make sure that integer numbers are not greater than // maximum value for type short before converting if ((productCount < Short.MAX_VALUE) && (amountSold < Short.MAX_VALUE)) { // convert integer values to short, the method for the // sales object requires the parameters to be of type short short count = (short) productCount; short sold = | CVE ID | Title | CVSS | Severity | Published |
|---|---|---|---|---|
| CVE-2024-21310 | Windows Cloud Files Mini Filter Driver Elevation of Privilege Vulnerability — Windows 10 Version 1809 | 7.8 | High | 2024-01-09 |
| CVE-2023-36641 | Fortinet FortiProxy 安全漏洞 — FortiProxy | 6.2 | Medium | 2023-11-14 |
| CVE-2023-36710 | Windows Media Foundation Core Remote Code Execution Vulnerability — Windows 10 Version 1809 | 7.8 | High | 2023-10-10 |
| CVE-2023-35328 | Windows Transaction Manager Elevation of Privilege Vulnerability — Windows 10 Version 1809 | 7.8 | High | 2023-07-11 |
| CVE-2022-42475 | Fortinet FortiOS 缓冲区错误漏洞 — FortiProxy | 9.3 | Critical | 2023-01-02 |
| CVE-2022-34680 | NVIDIA GPU Display Driver 安全漏洞 — vGPU software (guest driver) - Linux, vGPU software (Virtual GPU Manager), NVIDIA Cloud Gaming (guest driver), NVIDIA Cloud Gaming (Virtual GPU Manager) | 5.5 | Medium | 2022-12-30 |
| CVE-2022-34676 | NVIDIA GPU Display Driver 缓冲区错误漏洞 — vGPU software (guest driver) - Linux, vGPU software (Virtual GPU Manager), NVIDIA Cloud Gaming (guest driver), NVIDIA Cloud Gaming (Virtual GPU Manager) | 7.1 | High | 2022-12-30 |
| CVE-2022-34670 | NVIDIA GPU Display Driver 安全漏洞 — vGPU software (guest driver) - Linux, vGPU software (Virtual GPU Manager), NVIDIA Cloud Gaming (guest driver), NVIDIA Cloud Gaming (Virtual GPU Manager) | 7.8 | High | 2022-12-30 |
| CVE-2020-15202 | Integer truncation in Shard API usage — tensorflow | 9.0 | Critical | 2020-09-25 |
Vulnerabilities classified as CWE-197 (数值截断错误) represent 39 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.