Weakness (CWE)
CWE-787: Out-of-bounds Write
The product writes data past the end, or before the beginning, of the intended buffer.
How to prevent it (7 mitigations)
-
Requirements
Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid.
For example, many languages that perform their own memory management, such as Java and Perl, are not subject to buffer overflows. Other languages, such as Ada and C#, typically provide overflow protection, but the protection can be disabled by the programmer.
Be wary that a language's interface to native code may still be subject to overflows, even if the language itself is theoretically safe.
-
Architecture and Design
Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid.
Examples include the Safe C String Library (SafeStr) by Messier and Viega [REF-57], and the Strsafe.h library from Microsoft [REF-56]. These libraries provide safer versions of overflow-prone string-handling functions.
-
Operation, Build and Compilation
Use automatic buffer overflow detection mechanisms that are offered by certain compilers or compiler extensions. Examples include: the Microsoft Visual Studio /GS flag, Fedora/Red Hat FORTIFY_SOURCE GCC flag, StackGuard, and ProPolice, which provide various mechanisms including canary-based detection and range/index checking.
D3-SFCV (Stack Frame Canary Validation) from D3FEND [REF-1334] discusses canary-based detection in detail.
-
Implementation
Consider adhering to the following rules when allocating and managing an application's memory:
- Double check that the buffer is as large as specified.
- When using functions that accept a number of bytes to copy, such as strncpy(), be aware that if the destination buffer size is equal to the source buffer size, it may not NULL-terminate the string.
- Check buffer boundaries if accessing the buffer in a loop and make sure there is no danger of writing past the allocated space.
- If necessary, truncate all input strings to a reasonable length before passing them to the copy and concatenation functions.
-
Operation, Build and Compilation
Run or compile the software using features or extensions that randomly arrange the positions of a program's executable and libraries in memory. Because this makes the addresses unpredictable, it can prevent an attacker from reliably jumping to exploitable code.
Examples include Address Space Layout Randomization (ASLR) [REF-58] [REF-60] and Position-Independent Executables (PIE) [REF-64]. Imported modules may be similarly realigned if their default memory addresses conflict with other modules, in a process known as "rebasing" (for Windows) and "prelinking" (for Linux) [REF-1332] using randomly generated addresses. ASLR for libraries cannot be used in conjunction with prelink since it would require relocating the libraries at run-time, defeating the whole purpose of prelinking.
For more information on these techniques see D3-SAOR (Segment Address Offset Randomization) from D3FEND [REF-1335].
-
Operation
Use a CPU and operating system that offers Data Execution Protection (using hardware NX or XD bits) or the equivalent techniques that simulate this feature in software, such as PaX [REF-60] [REF-61]. These techniques ensure that any instruction executed is exclusively at a memory address that is part of the code segment.
For more information on these techniques see D3-PSEP (Process Segment Execution Prevention) from D3FEND [REF-1336].
-
Implementation
Replace unbounded copy functions with analogous functions that support length arguments, such as strcpy with strncpy. Create these if they are not available.
Source: MITRE CWE-787
761 results · Clear filters · Feed
-
Critical 9.8
In the deserialization constructor of NanoAppFilter.java, there is a possible loss of data due to type confusion. This …
-
Critical 9.8
In impeg2d_mc_fullx_fully of impeg2d_mc.c there is a possible out of bound write due to missing bounds check. This coul…
-
Critical 9.8
In filterMask of SkEmbossMaskFilter.cpp, there is a possible out of bounds write due to an integer overflow. This could…
-
Critical 9.8
net: ethernet: mtk_eth_soc: fix memory corruption during fq dma init
In the Linux kernel, the following vulnerability has been resolved: net: ethernet: mtk_eth_soc: fix memory corruption during fq dma init The loop responsible for allocating up to MTK_FQ_DMA_LENGTH buffers must only touch as many descriptors, otherwise it ends…
-
Critical 9.8
Mbed TLS 3.5.x through 3.6.x before 3.6.2 has a buffer underrun in pkwrite when writing an opaque key pair
-
Critical 9.8
HDF5 library through 1.14.3 has memory corruption in H5A__close resulting in the corruption of the instruction pointer …
-
Critical 9.8
In wlan firmware, there is a possible out of bounds write due to improper input validation. This could lead to remote c…
-
Critical 9.8
In wlan driver, there is a possible out of bounds write due to improper input validation. This could lead to remote cod…
-
Critical 9.8
In wlan driver, there is a possible out of bounds write due to improper input validation. This could lead to remote cod…
-
Critical 9.8
DrayTek Vigor310 devices through 4.3.2.6 allow a remote attacker to execute arbitrary code via the function ft_payload_…
-
Critical 9.1
Heap-based Buffer Overflow in sqlite-vec
sqlite-vec v0.1.1 was discovered to contain a heap buffer overflow via the npy_token_next function. This vulnerability allows attackers to cause a Denial of Service (DoS) via a crafted file.
-
Critical 9.8
HTMLDOC before 1.9.19 has an out-of-bounds write in parse_paragraph in ps-pdf.cxx because of an attempt to strip leadin…
-
Critical 9.8
An issue in newlib v.4.3.0 allows an attacker to execute arbitrary code via the time unit scaling in the _gettimeofday …
-
Critical 9.8
In the TP-Link RE365 V1_180213, there is a buffer overflow vulnerability due to the lack of length verification for the…
-
Critical 9.8
In venc, there is a possible out of bounds write due to a missing bounds check. This could lead to local escalation of …
-
Critical 9.8
Tenda FH1201 v1.2.0.14 was discovered to contain a stack-based buffer overflow vulnerability via the list1 parameter at…
-
Critical 9.8
In gnss service, there is a possible out of bounds write due to improper input validation. This could lead to local esc…
-
Critical 9.8
In gnss service, there is a possible out of bounds write due to improper input validation. This could lead to local esc…
-
Critical 9.8
vCenter Server contains a heap-overflow vulnerability in the implementation of the DCERPC protocol. A malicious actor w…
KEV Jan 23, 2026 -
Critical 9.8
Netatalk before 3.2.1 has an off-by-one error and resultant heap-based buffer overflow because of setting ibuf[PASSWDLE…
-
Critical 9.8
In circ_read of link_device_memory_legacy.c, there is a possible out of bounds write due to an incorrect bounds check. …
-
Critical 9.8
In BCMFASTPATH of dhd_msgbuf.c, there is a possible out of bounds write due to a missing bounds check. This could lead …
-
Critical 9.8
CWE-787: Out-of-bounds Write vulnerability exists that could result in an authentication bypass when sending a malforme…
-
Critical 9.8
naga v0.14.0 was discovered to contain a stack overflow via the component /wgsl/parse/mod.rs.
-
Critical 9.8
Memory safety bugs present in Firefox 126. Some of these bugs showed evidence of memory corruption and we presume that …
-
Critical 9.8
If an out-of-memory condition occurs at a specific point using allocations in the probabilistic heap checker, an assert…
-
Critical 9.8
In modem, there is a possible out of bounds write due to improper input invalidation. This could lead to remote denial …
-
Critical 9.8CVE-2023-52755 EPSS 28%
ksmbd: fix slab out of bounds write in smb_inherit_dacl()
In the Linux kernel, the following vulnerability has been resolved: ksmbd: fix slab out of bounds write in smb_inherit_dacl() slab out-of-bounds write is caused by that offsets is bigger than pntsd allocation size. This patch add the check to validate 3 offse…
-
Critical 9.8
HDF5 Library through 1.14.3 contains a heap-based buffer overflow in H5Z__nbit_decompress_one_byte in H5Znbit.c, caused…
-
Critical 9.8
Exim AUTH Out-Of-Bounds Write Remote Code Execution Vulnerability
Exim AUTH Out-Of-Bounds Write Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of Exim. Authentication is not required to exploit this vulnerability. The specific flaw exists w…
-
Critical 9.8
FreeRDP Integer overflow & OutOfBound Write in clear_decompress_residual_data
FreeRDP is a free implementation of the Remote Desktop Protocol. FreeRDP based clients using a version of FreeRDP prior to 3.5.0 or 2.11.6 are vulnerable to integer overflow and out-of-bounds write. Versions 3.5.0 and 2.11.6 patch the issue. As a workaround, …
-
Critical 9.8
Buffer Overflow vulnerability in Bento4 Bento v.1.6.0-641 allows a remote attacker to execute arbitrary code via the AP…
-
Critical 9.8
An attacker was able to perform an out-of-bounds read or write on a JavaScript object by fooling range-based bounds che…
-
Critical 9.8
Memory safety bugs present in Firefox 123. Some of these bugs showed evidence of memory corruption and we presume that …
-
Critical 9.3CVE-2023-42789 Public exploit
A out-of-bounds write vulnerability in Fortinet FortiOS 7.4.0 through 7.4.1, FortiOS 7.2.0 through 7.2.5, FortiOS 7.0.0…
-
Critical 9.8
Tenda AC18 V15.03.05.05 has a stack overflow vulnerability in the entrys parameter fromAddressNat function.
-
Critical 9.8
A malicious DNS response can trigger a number of OOB reads, writes, and other memory issues
-
Critical 9.8
there is a possible out of bounds write due to a heap buffer overflow. This could lead to remote code execution with no…
-
Critical 9.8CVE-2024-0039 Public exploit
In attp_build_value_cmd of att_protocol.cc, there is a possible out of bounds write due to a missing bounds check. This…
-
Critical 9.8
Buffer overflow in identifier field of WSD probe request process of Small Office Multifunction Printers and Laser Print…