CWE-197
Numeric Truncation Error
Extended description
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 consequences1
- IntegrityModify Memory
The true value of the data is lost and corrupted data is used.
Potential mitigations1
- Implementation
Ensure that no casts, implicit or explicit, take place that move from a larger size primitive or a smaller size primitive.
Relationships7
CVEs referencing this CWE79
| CVE | Description | Severity | EPSS | Flags | Modified |
|---|---|---|---|---|---|
| CVE-2022-42475 | A heap-based buffer overflow vulnerability [CWE-122] in FortiOS SSL-VPN 7.2.0 through 7.2.2, 7.0.0 through 7.0.8, 6.4.0 through 6.4.10, 6.2.0 through 6.2.11, 6.0.15 and earlier and FortiProxy SSL-VPN 7.2.0 through 7.2.1, 7.0.7 and earlier may allow a remote unauthenticated attacker to execute arbitrary code or commands via specifically crafted requests. | CRITICAL9.8 | 99%p100 | KEV+RPoC | 2026-06-17 |
| CVE-2025-6965 | There exists a vulnerability in SQLite versions before 3.50.2 where the number of aggregate terms could exceed the number of columns available. This could lead to a memory corruption issue. We recommend upgrading to version 3.50.2 or above. | HIGH7.7 | 73%p99 | PoC | 2026-10-15 |
| CVE-2024-21310 | Windows Cloud Files Mini Filter Driver Elevation of Privilege Vulnerability | HIGH7.8 | 12%p96 | 2026-06-17 | |
| CVE-2024-43639 | Windows KDC Proxy Remote Code Execution Vulnerability | CRITICAL9.8 | 8.94%p95 | 2026-06-17 | |
| CVE-2024-38125 | Kernel Streaming WOW Thunk Service Driver Elevation of Privilege Vulnerability | HIGH7.8 | 5.94%p93 | 2026-06-17 | |
| CVE-2024-28944 | Microsoft OLE DB Driver for SQL Server Remote Code Execution Vulnerability | HIGH8.8 | 2.35%p84 | 2026-06-17 | |
| CVE-2024-38044 | DHCP Server Service Remote Code Execution Vulnerability | HIGH7.2 | 2.13%p82 | 2026-06-17 | |
| CVE-2024-21440 | Microsoft ODBC Driver Remote Code Execution Vulnerability | HIGH8.8 | 2.03%p81 | 2026-06-17 | |
| CVE-2024-21451 | Microsoft ODBC Driver Remote Code Execution Vulnerability | HIGH8.8 | 1.95%p80 | 2026-06-17 | |
| CVE-2024-30009 | Windows Routing and Remote Access Service (RRAS) Remote Code Execution Vulnerability | HIGH8.8 | 1.72%p77 | 2026-06-17 | |
| CVE-2024-37337 | Microsoft SQL Server Native Scoring Information Disclosure Vulnerability | MEDIUM4.3 | 1.66%p77 | 2026-08-10 | |
| CVE-2024-49018 | SQL Server Native Client Remote Code Execution Vulnerability | HIGH8.8 | 1.63%p76 | 2026-06-17 | |
| CVE-2024-21391 | Microsoft WDAC OLE DB provider for SQL Server Remote Code Execution Vulnerability | HIGH8.8 | 1.63%p76 | 2026-08-10 | |
| CVE-2024-21352 | Microsoft WDAC OLE DB provider for SQL Server Remote Code Execution Vulnerability | HIGH8.8 | 1.63%p76 | 2026-08-10 | |
| CVE-2024-30024 | Windows Routing and Remote Access Service (RRAS) Remote Code Execution Vulnerability | HIGH7.5 | 1.54%p75 | 2026-06-17 | |
| CVE-2024-30023 | Windows Routing and Remote Access Service (RRAS) Remote Code Execution Vulnerability | HIGH7.5 | 1.54%p75 | 2026-06-17 | |
| CVE-2024-30022 | Windows Routing and Remote Access Service (RRAS) Remote Code Execution Vulnerability | HIGH7.5 | 1.54%p75 | 2026-06-17 | |
| CVE-2024-43519 | Microsoft WDAC OLE DB provider for SQL Server Remote Code Execution Vulnerability | HIGH8.8 | 1.50%p74 | 2026-08-19 | |
| CVE-2024-30029 | Windows Routing and Remote Access Service (RRAS) Remote Code Execution Vulnerability | HIGH7.5 | 1.49%p74 | 2026-06-17 | |
| CVE-2024-30015 | Windows Routing and Remote Access Service (RRAS) Remote Code Execution Vulnerability | HIGH7.5 | 1.49%p74 | 2026-06-17 | |
| CVE-2024-30014 | Windows Routing and Remote Access Service (RRAS) Remote Code Execution Vulnerability | HIGH7.5 | 1.49%p74 | 2026-06-17 | |
| CVE-2023-36641 | A numeric truncation error vulnerability in Fortinet FortiOS 7.4.0, FortiOS 7.2.0 through 7.2.5, FortiOS 7.0.0 through 7.0.12, FortiOS 6.4 all versions, FortiOS 6.2 all versions, FortiOS 6.0 all versions, FortiProxy 7.2.0 through 7.2.4, FortiProxy 7.0.0 through 7.0.10, FortiProxy 2.0 all versions, FortiProxy 01.02 all versions, FortiProxy 1.2 all versions, FortiProxy 01.01 all versions, FortiProxy 1.1 all versions, FortiProxy 01.00 all versions allows attacker to denial of service via specifically crafted HTTP requests. | MEDIUM6.5 | 1.36%p72 | 2026-10-22 | |
| CVE-2020-15202 | In Tensorflow before versions 1.15.4, 2.0.3, 2.1.2, 2.2.1 and 2.3.1, the `Shard` API in TensorFlow expects the last argument to be a function taking two `int64` (i.e., `long long`) arguments. However, there are several places in TensorFlow where a lambda taking `int` or `int32` arguments is being used. In these cases, if the amount of work to be parallelized is large enough, integer truncation occurs. Depending on how the two arguments of the lambda are used, this can result in segfaults, read/write outside of heap allocated arrays, stack overflows, or data corruption. The issue is patched in commits 27b417360cbd671ef55915e4bb6bb06af8b8a832 and ca8c013b5e97b1373b3bb1c97ea655e69f31a575, and is released in TensorFlow versions 1.15.4, 2.0.3, 2.1.2, 2.2.1, or 2.3.1. | CRITICAL9.0 | 1.29%p70 | 2026-06-17 | |
| CVE-2024-29050 | Windows Cryptographic Services Remote Code Execution Vulnerability | HIGH7.8 | 1.25%p69 | PoC | 2026-06-17 |
| CVE-2023-32143 | D-Link DAP-1360 webupg UPGCGI_CheckAuth Numeric Truncation Remote Code Execution Vulnerability. This vulnerability allows network-adjacent attackers to execute arbitrary code on affected installations of D-Link DAP-1360 routers. Authentication is not required to exploit this vulnerability. The specific flaw exists within the handling of requests to the /cgi-bin/webupg endpoint. The issue results from the lack of proper validation of user-supplied data, which can result in an integer overflow before allocating a buffer. An attacker can leverage this vulnerability to execute code in the context of root. . Was ZDI-CAN-18423. | HIGH8.8 | 1.13%p66 | 2026-06-17 | |
| CVE-2023-36710 | Windows Media Foundation Core Remote Code Execution Vulnerability | HIGH7.8 | 0.93%p60 | 2026-06-17 | |
| CVE-2026-102225 | Out-of-bounds read in Windows Text Shaping allows an unauthorized attacker to execute code over a network. | HIGH8.8 | 0.90%p60 | 2026-10-26 | |
| CVE-2024-21429 | Windows USB Hub Driver Remote Code Execution Vulnerability | MEDIUM6.8 | 0.90%p60 | 2026-06-17 | |
| CVE-2026-96113 | Heap-based buffer overflow in DNS Server allows an unauthorized attacker to execute code over a network. | CRITICAL9.8 | 0.87%p59 | 2026-10-26 | |
| CVE-2026-42944 | NLnet Labs Unbound 1.14.0 up to and including version 1.25.0 has a vulnerability that results in heap overflow when encoding multiple NSID and/or DNS Cookie EDNS and/or EDNS Padding options in the reply packet. The relevant options ('nsid', 'answer-cookie', 'pad-responses' (default)) need to be enabled for the vulnerability to be exploited. An adversary who can query Unbound can exploit the vulnerability by attaching multiple NSID and/or DNS Cookie EDNS and/or EDNS Padding options to the query. A flaw in the size calculation of the EDNS field truncates the correct value which allows the encoder to overflow the available space when writing. Those two combined lead to a heap overflow write of Unbound controlled data and eventually a crash. Unbound 1.25.1 contains a patch with a fix to de-duplicate the EDNS options and a fix to prevent truncation of the EDNS field size calculation. | HIGH7.5 | 0.84%p58 | 2026-08-26 | |
| CVE-2024-21434 | Microsoft Windows SCSI Class System File Elevation of Privilege Vulnerability | HIGH7.8 | 0.83%p57 | 2026-06-17 | |
| CVE-2026-78512 | Numeric truncation error in Microsoft Office Word allows an unauthorized attacker to execute code over a network. | HIGH8.8 | 0.82%p57 | 2026-10-14 | |
| CVE-2026-69512 | Heap-based buffer overflow in Windows Spaceport.sys allows an authorized attacker to elevate privileges over a network. | HIGH8.8 | 0.77%p55 | 2026-10-14 | |
| CVE-2026-68880 | Heap-based buffer overflow in Windows Win32K allows an authorized attacker to elevate privileges over a network. | HIGH8.0 | 0.77%p55 | 2026-10-14 | |
| CVE-2026-76151 | Out-of-bounds read (buffer over-read) in the HTTP Cache-Control response header parsing in the QtNetwork module in Qt Group Qt 6.0.0 through 6.8.8, and 6.9.0 through 6.11.1, allows remote attackers to cause a denial of service (application crash) via an excessively large Cache-Control header value returned by an untrusted or compromised HTTP server to an application using QNetworkAccessManager. Only the client side of the connection is affected and 32-bit builds are not affected; the out-of-bounds access is read-only, with no information disclosure and no code execution. | NONE | 0.67%p52 | 2026-09-18 | |
| CVE-2024-21377 | Windows DNS Information Disclosure Vulnerability | MEDIUM5.5 | 0.65%p51 | 2026-08-10 | |
| CVE-2026-108451 | Numeric truncation error in Microsoft Office Word allows an unauthorized attacker to execute code over a network. | HIGH8.8 | 0.62%p49 | 2026-10-26 | |
| CVE-2026-108450 | Heap-based buffer overflow in Microsoft Office Word allows an unauthorized attacker to execute code over a network. | HIGH8.8 | 0.62%p49 | 2026-10-26 | |
| CVE-2024-38086 | Azure Kinect SDK Remote Code Execution Vulnerability | MEDIUM6.4 | 0.61%p49 | 2026-06-17 | |
| CVE-2026-55142 | Numeric truncation error in Microsoft Office Word allows an unauthorized attacker to disclose information locally. | MEDIUM5.5 | 0.60%p48 | 2026-10-08 | |
| CVE-2026-19667 | If an attacker-controlled authoritative server can produce a negative answer that is exactly 65536 bytes, then a flaw in `named` results in a negative cache entry of 0 bytes. When this entry is subsequently read, `named` aborts. This issue affects BIND 9 versions 9.11.0 through 9.18.50, 9.20.0 through 9.20.27, 9.21.0 through 9.21.25, 9.11.3-S1 through 9.18.50-S1, and 9.20.9-S1 through 9.20.27-S1. | HIGH7.5 | 0.57%p47 | 2026-10-26 | |
| CVE-2026-73523 | COVESA Open1722 through 0.9.2 contains an integer truncation vulnerability in acf-can-listener.c that allows unauthenticated remote attackers to cause the CAN listener to transmit process stack memory onto the CAN bus by sending a rejected UDP datagram with a matching AVTP stream ID. The num_can_msgs variable declared as uint8_t truncates the -1 error return value from avtp_to_can() to 255, causing a write loop to iterate 255 times over a 15-slot stack array and leak approximately 18 KB of adjacent stack memory as roughly 240 CAN frames to any recipient on the CAN bus. | HIGH7.5 | 0.55%p46 | 2026-10-23 | |
| CVE-2026-6679 | A heap buffer overflow could occur in the DTLS 1.3 ACK serialization path before the connecting peer is authenticated. The buffer overflow was due to an integer truncation when computing the length of the ACK record-number list, causing an undersized buffer to be allocated and then overrun. This affects builds using DTLS 1.3 and wolfSSL version 5.9.0 and earlier. A fix was added to the 5.9.1 release. | HIGH7.5 | 0.51%p43 | 2026-06-27 | |
| CVE-2026-87529 | Numeric truncation error in Media in Google Chrome prior to 153.0.8010.36 allowed a remote attacker to potentially execute arbitrary code outside the sandbox via a crafted HTML page. (Chromium security severity: Medium) | CRITICAL9.6 | 0.50%p43 | 2026-09-10 | |
| CVE-2026-68804 | Numeric truncation error in Microsoft Office Excel allows an unauthorized attacker to execute code locally. | HIGH7.8 | 0.47%p40 | 2026-10-21 | |
| CVE-2026-63525 | Numeric truncation error in Microsoft Office Word allows an unauthorized attacker to execute code locally. | HIGH7.8 | 0.47%p40 | 2026-10-21 | |
| CVE-2026-40380 | Heap-based buffer overflow in Volume Manager Extension Driver allows an authorized attacker to execute code with a physical attack. | MEDIUM6.2 | 0.46%p40 | 2026-08-10 | |
| CVE-2025-53723 | Numeric truncation error in Windows Hyper-V allows an authorized attacker to elevate privileges locally. | HIGH7.8 | 0.46%p40 | 2026-06-17 | |
| CVE-2026-115889 | Wasmtime is a runtime for WebAssembly. Prior to 36.0.19 and 43.0.0, the Cranelift compiler backend bit-packs SSA value indices in a way that can silently overflow in release builds when compiling a sufficiently large or specially crafted Wasm function with many SSA values. The overflow can make Cranelift reference incorrect IR values, causing arbitrary miscompilation, type confusion, and other attacker-controlled effects that may escape the Wasm sandbox on any architecture using the default Cranelift backend. This issue is fixed in versions 36.0.19 and 43.0.0. | CRITICAL9.9 | 0.45%p39 | 2026-10-26 | |
| CVE-2025-49679 | Numeric truncation error in Windows Shell allows an authorized attacker to elevate privileges locally. | HIGH7.8 | 0.43%p37 | 2026-06-17 | |
| CVE-2023-35328 | Windows Transaction Manager Elevation of Privilege Vulnerability | HIGH7.8 | 0.43%p37 | 2026-06-17 | |
| CVE-2026-96280 | The OCI delta stream parser read sizes as guint64 but passed them to GLib I/O and allocation functions expecting gsize (32 bits on 32-bit systems), causing undersized allocations while subsequent operations use the original 64-bit size, leading to heap buffer overflows. An attacker controlling an OCI registry can craft a delta stream that triggers this during flatpak install/update, potentially achieving code execution on 32-bit systems. | HIGH7.5 | 0.40%p34 | 2026-10-27 | |
| CVE-2026-68895 | Numeric truncation error in Internet Storage Name Service allows an authorized attacker to disclose information locally. | MEDIUM5.5 | 0.40%p34 | 2026-10-14 | |
| CVE-2026-33795 | A Numeric Truncation Error vulnerability in the rpd process of Juniper Networks Junos OS and Junos OS Evolved allows an unauthenticated network-based attacker to cause a denial of service via a BGP Prefix-SID route advertisement that is subsequently re-advertised. This issue does not affect versions of Junos OS prior to 20.4R1. This issue does not affect versions of Junos OS Evolved prior to 20.4R1-EVO | HIGH7.5 | 0.37%p31 | 2026-10-15 | |
| CVE-2026-44823 | Numeric truncation error in Microsoft Office Excel allows an unauthorized attacker to execute code locally. | HIGH7.8 | 0.37%p31 | 2026-09-24 | |
| CVE-2026-70177 | Numeric truncation error in Microsoft Windows Search Component allows an authorized attacker to elevate privileges locally. | HIGH7.8 | 0.36%p30 | 2026-10-26 | |
| CVE-2026-70123 | Numeric truncation error in Microsoft Graphics Component allows an authorized attacker to elevate privileges locally. | HIGH7.8 | 0.35%p28 | 2026-10-26 | |
| CVE-2026-80213 | An issue was discovered in the resolv gem before 0.7.2 for Ruby. Resolv::DNS::MessageEncoder wrote a DNS label's length into a single octet without checking its range. A label longer than 255 octets had its length stored modulo 256 but the label data was written unchanged, and thus the bytes on the wire described a different name than the one the application asked to encode. RFC 1035 section 2.3.4 limits a label to 63 octets, and the two high bits of the length octet are reserved for compression pointers. put_string packed the length with put_pack("C", d.length) and put_label used it for labels, and thus any value from 0 to 255 could end up as a label length octet, including the reserved 0x40-0xBF range and the 0xC0-0xFF pointer range. Resolv::DNS::Name.create did not check per-label or total name length either, and thus an attacker-controlled hostname reached the encoder unchanged. An application that resolves an attacker-controlled hostname sends a query whose wire bytes name a domain the attacker chose. A hostname suffix that the application validates against an allowlist becomes padding that never appears on the wire, and thus allowlist and egress checks can be bypassed. The recursive resolver caches the response under the attacker's name, and DNS logs record that name rather than the one the application asked for. A label length whose low octet lands in the 0xC0-0xFF range produces a length octet that conforming parsers read as the start of a compression pointer, with the following attacker-controlled byte as the offset. | MEDIUM4.0 | 0.35%p28 | 2026-09-09 | |
| CVE-2026-65798 | Numeric truncation error in Windows DNS allows an authorized attacker to elevate privileges locally. | MEDIUM6.7 | 0.35%p28 | 2026-10-21 | |
| CVE-2026-65797 | Numeric truncation error in Windows DNS allows an authorized attacker to elevate privileges locally. | MEDIUM6.7 | 0.35%p28 | 2026-10-21 | |
| CVE-2026-65795 | Relative path traversal in Windows DNS allows an authorized attacker to elevate privileges locally. | MEDIUM6.7 | 0.35%p28 | 2026-10-21 | |
| CVE-2026-62883 | Numeric truncation error in Windows DNS allows an authorized attacker to elevate privileges locally. | MEDIUM6.7 | 0.35%p28 | 2026-10-21 | |
| CVE-2026-62881 | Numeric truncation error in Windows DNS allows an authorized attacker to elevate privileges locally. | MEDIUM6.7 | 0.35%p28 | 2026-10-21 | |
| CVE-2026-62769 | Numeric truncation error in Windows DNS allows an authorized attacker to elevate privileges locally. | MEDIUM6.7 | 0.35%p28 | 2026-10-21 | |
| CVE-2026-40404 | Windows Universal Disk Format File System Driver (UDFS) Elevation of Privilege Vulnerability | HIGH7.8 | 0.34%p27 | 2026-09-24 | |
| CVE-2026-69535 | Numeric truncation error in Windows Spaceport.sys allows an authorized attacker to elevate privileges locally. | HIGH7.8 | 0.33%p26 | 2026-10-14 | |
| CVE-2026-69822 | Numeric truncation error in Windows Kerberos allows an authorized attacker to elevate privileges locally. | HIGH7.8 | 0.33%p26 | 2026-10-14 | |
| CVE-2026-62698 | Numeric truncation error in Microsoft Digest Authentication allows an authorized attacker to elevate privileges locally. | HIGH7.8 | 0.33%p26 | 2026-10-21 | |
| CVE-2026-62739 | Heap-based buffer overflow in Windows HTTP.sys allows an authorized attacker to elevate privileges locally. | HIGH7.8 | 0.33%p26 | 2026-10-26 | |
| CVE-2026-56650 | Heap-based buffer overflow in Windows Network File System allows an authorized attacker to elevate privileges locally. | HIGH7.8 | 0.33%p26 | 2026-10-08 | |
| CVE-2026-50357 | Numeric truncation error in Windows Resilient File System (ReFS) allows an authorized attacker to execute code locally. | HIGH7.8 | 0.33%p26 | 2026-10-08 | |
| CVE-2026-50332 | Heap-based buffer overflow in Windows Kernel allows an authorized attacker to elevate privileges locally. | HIGH7.8 | 0.33%p26 | 2026-10-08 | |
| CVE-2026-49792 | Numeric truncation error in Windows Resilient File System (ReFS) allows an authorized attacker to execute code locally. | HIGH7.8 | 0.33%p26 | 2026-10-08 | |
| CVE-2026-100201 | Heap-based buffer overflow in Windows Client License Service allows an authorized attacker to elevate privileges locally. | HIGH7.0 | 0.31%p24 | 2026-10-26 | |
| CVE-2026-96995 | Stack-based buffer overflow in Microsoft Office Word allows an authorized attacker to elevate privileges locally. | HIGH7.8 | 0.31%p23 | 2026-10-26 | |
| CVE-2026-85796 | Numeric truncation error in Windows Installer allows an authorized attacker to elevate privileges locally. | HIGH7.8 | 0.31%p24 | 2026-10-26 | |
| CVE-2026-105768 | apko allows users to build and publish OCI container images built from apk packages. From version 0.2.0 to before version 1.4.5, UserEntry.Parse and GroupEntry.Parse in pkg/passwd read the UID and GID fields of /etc/passwd and /etc/group entries with strconv.Atoi and convert them to uint32 without a range check. On 64-bit platforms an out-of-range value such as 4294967296 (2^32) is truncated to 0, and negative values wrap. Because apko parses the passwd and group entries supplied by the packages it installs and writes them back into the image, an attacker who controls a package installed into the image can ship an entry that appears to declare an unprivileged UID or GID but is written into the built image as UID 0 or GID 0 (root). The truncated UID is also used when resolving the image's run-as user. This issue has been fixed in version 1.4.5. | NONE | 0.30%p23 | 2026-10-06 | |
| CVE-2026-101085 | Nezha before 2.3.8 fails to validate alert rule type and duration bounds, allowing authenticated non-administrator users to create malformed rules that trigger unrecovered panics in the alert evaluator goroutine. Attackers can submit a crafted alert rule via the POST /api/v1/alert-rule endpoint to crash the dashboard process, which persists the rule and causes repeated crashes on restart, disabling all monitoring and control plane functionality. | MEDIUM6.5 | 0.30%p23 | 2026-09-28 | |
| CVE-2026-40409 | Windows Universal Disk Format File System Driver (UDFS) Elevation of Privilege Vulnerability | HIGH7.8 | 0.30%p22 | 2026-09-24 |