Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1359 CNY

100%

CWE-197 (数值截断错误) — Vulnerability Class 83

83 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.

MITRE CWE Description
Truncation errors occur when a primitive is cast to a primitive of a smaller size and data is lost in the conversion. When a primitive is cast to a smaller primitive, the high order bits of the large value are lost in the conversion, potentially resulting in an unexpected value that is not equal to the original value. This value may be required as an index into a buffer, a loop iterator, or simply necessary state data. In any case, the value cannot be trusted and the system will be in an undefined state. While this method may be employed viably to isolate the low bits of a value, this usage is rare, and truncation usually implies that an implementation error has occurred.
Common Consequences (1)
Integrity Modify Memory
The true value of the data is lost and corrupted data is used.
Mitigations (1)
Implementation Ensure that no casts, implicit or explicit, take place that move from a larger size primitive or a smaller size primitive.
Examples (2)
This example, while not exploitable, shows the possible mangling of values associated with truncation errors:
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);
Bad · C
Int MAXINT: 2147483647 Short MAXINT: -1
Result
In the following Java example, the method updateSalesForProduct is part of a business application class that updates the sales information for a particular product. The method receives as arguments the product ID and the integer amount sold. The product ID is used to retrieve the total product count from an inventory object which returns the count as an integer. Before calling the method of the sa…
... // 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); } ...
Bad · Java
... // 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 = 
Good · Java
CVE ID Title CVSS Severity Published
CVE-2026-107479 Integer truncation vulnerability in QTextCodec conversion functions impacts Qt Framework — Qt 1.7 Low 2026-11-04
CVE-2026-116742 HTSlib through 1.24 Heap Out-of-Bounds Write via Truncated .gzi Index Count — htslib 4.4 Medium 2026-10-26
CVE-2026-116012 Ghidra before 12.2 Integer Truncation in PackedDecode::skipAttribute Decompiler Parser — ghidra 3.6 Low 2026-10-24
CVE-2026-115889 Wasmtime: Bit-packing in Cranelift compiler causes silent overflow and miscompilation — wasmtime 9.9 Critical 2026-10-23
CVE-2026-109588 Numeric truncation in the MPU buffer authorization check in FreeRTOS-Kernel — FreeRTOS-Kernel 8.8 High 2026-10-16
CVE-2026-108451 Microsoft Office Word Remote Code Execution Vulnerability — Microsoft 365 Apps for Enterprise 8.8 High 2026-10-15
CVE-2026-111105 Telegram rlottie Numeric Truncation Remote Code Execution Vulnerability — Telegram - - 2026-10-15
CVE-2026-33795 Junos OS and Junos OS Evolved: An attacker causes a routing-daemon crash when BGP Prefix-SID routes are re-advertised — Junos OS 7.5 High 2026-10-14
CVE-2026-102043 Junos OS and Junos OS Evolved: An attacker causes a routing-process crash when MPLS-TE fast reroute is enabled — Junos OS 6.5 Medium 2026-10-14
CVE-2026-85796 Windows Installer Elevation of Privilege Vulnerability — Windows 10 Version 1607 7.8 High 2026-10-13
CVE-2026-70177 Microsoft Windows Search Component Elevation of Privilege Vulnerability — Windows 10 Version 1607 7.8 High 2026-10-13
CVE-2026-70123 Microsoft Graphics Component Elevation of Privilege Vulnerability — Windows 10 Version 1607 7.8 High 2026-10-13
CVE-2026-105768 apko /etc/passwd and /etc/group UID/GID truncation writes package-supplied entries as root — apko 6.3 Medium 2026-10-05
CVE-2026-101085 Nezha before 2.3.8 Denial of Service via Alert Rule — nezha 6.5 Medium 2026-09-27
CVE-2026-96280 Flatpak: flatpak: buffer overflow in oci delta stream path names on 32-bit systems — Red Hat Enterprise Linux 10 7.5 High 2026-09-27
CVE-2026-63449 Suricata sip: large SIP message bodies can evade detection with frame keyword — suricata 3.7 Low 2026-09-18
CVE-2026-19667 Remote assertion failure via 16-bit length truncation in `dns_ncache_add()` — BIND 9 7.5 High 2026-09-16
CVE-2026-87529 Google Chrome 数字错误漏洞 — Chrome - - 2026-09-09
CVE-2026-78512 Microsoft Office Word Remote Code Execution Vulnerability — Microsoft 365 Apps for Enterprise 8.8 High 2026-09-08
CVE-2026-69535 Windows Spaceport.sys Elevation of Privilege Vulnerability — Windows 10 Version 21H2 7.8 High 2026-09-08
CVE-2026-69578 Windows Kernel Elevation of Privilege Vulnerability — Windows 10 Version 1607 7.0 High 2026-09-08
CVE-2026-68895 Internet Storage Name Service Information Disclosure Vulnerability — Windows 10 Version 1607 5.5 Medium 2026-09-08
CVE-2026-69822 Windows Kerberos Elevation of Privilege Vulnerability — Windows 10 Version 1809 7.8 High 2026-09-08
CVE-2026-86315 SAMSUNG Escargot 数字错误漏洞 — Escargot 6.2 Medium 2026-09-07
CVE-2026-80213 Ruby Resolv 数字错误漏洞 — resolv 4.0 Medium 2026-08-27
CVE-2026-77014 Libsoup: libsoup: integer truncation in sort_ranges() comparator causes silent omission of http range responses — Red Hat Enterprise Linux 10 5.3 Medium 2026-08-20
CVE-2026-65610 Numeric Truncation Error in nnn — nnn 2.4 Low 2026-08-19
CVE-2026-73523 COVESA Open1722 0.9.2 Stack Memory Disclosure via acf-can-listener.c Integer Truncation — Open1722 7.5 High 2026-08-17
CVE-2026-49263 Capstone WASM `br_table` instruction-size truncation can cause no-progress disassembly and parser desynchronization — capstone 2.0 Low 2026-08-14
CVE-2026-68804 Microsoft Excel Remote Code Execution Vulnerability — Microsoft 365 Apps for Enterprise 7.8 High 2026-08-11

Vulnerabilities classified as CWE-197 (数值截断错误) represent 83 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.