Skip to content
OpenAdvisories

Weakness (CWE)

CWE-787: Out-of-bounds Write

Base Draft

The product writes data past the end, or before the beginning, of the intended buffer.

How to prevent it (7 mitigations)
  1. 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.

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

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

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

  5. 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].

  6. 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].

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

6,161 results · Feed

  • High 8.5

    Local Code Execution Vulnerability in Arena®

    A local code execution vulnerability exists in the Rockwell Automation Arena® due to a threat actor being able to write outside of the allocated memory buffer. The flaw is a result of improper validation of user-supplied data.  If exploited a threat actor can…

  • Medium 4.1

    Memory Corruption vulnerability in SAP NetWeaver and ABAP Platform (Application Server ABAP)

    Due to incorrect memory address handling in ABAP SQL of SAP NetWeaver and ABAP Platform (Application Server ABAP), an authenticated attacker with high privileges could execute certain forms of SQL queries leading to manipulation of content in the output varia…

  • High 7.8

    Out-of-bounds Read in Windows WLAN Host

    Memory corruption when IOCTL call is invoked from user-space to write board data to WLAN driver.

  • High 7.8

    Out-of-bounds Read in Windows WLAN Host

    Memory corruption when IOCTL call is invoked from user-space to write board data to WLAN driver.

  • High 7.8

    Out-of-bounds Read in Windows WLAN Host

    Memory corruption may occur while reading board data via IOCTL call when the WLAN driver copies the content to the provided output buffer.

  • Medium 6.6

    Out-of-bounds Write in Audio

    Memory corruption while accessing MSM channel map and mixer functions.

  • Medium 6.0

    In DA, there is a possible permission bypass due to a logic error. This could lead to local escalation of privilege, if…

  • Medium 6.7

    In vdec, there is a possible permission bypass due to improper input validation. This could lead to local escalation of…

  • Medium 6.8

    In DA, there is a possible out of bounds write due to a missing bounds check. This could lead to local escalation of pr…

  • Critical 9.8

    In wlan service, there is a possible out of bounds write due to an incorrect bounds check. This could lead to remote co…

  • Low 3.3

    arkcompiler_ets_runtime has an out-of-bounds write vulnerability

    in OpenHarmony v5.0.2 and prior versions allow a local attacker cause DOS through out-of-bounds write.

  • Low 2.1

    Out-of-bounds array write due to invalid VerticesPerRow in Xpdf 4.05

    Out-of-bounds array write in Xpdf 4.05 and earlier, triggered by an invalid VerticesPerRow value in a PDF shading dictionary.

  • Critical 9.3

    Heap Buffer Overflow via Incomplete Length Check in `Crypto_TC_ApplySecurity`

    CryptoLib provides a software-only solution using the CCSDS Space Data Link Security Protocol - Extended Procedures (SDLS-EP) to secure communications between a spacecraft running the core Flight System (cFS) and a ground station. In 1.3.3 and earlier, a heap…

  • High 7.8

    dm-flakey: Fix memory corruption in optional corrupt_bio_byte feature

    In the Linux kernel, the following vulnerability has been resolved: dm-flakey: Fix memory corruption in optional corrupt_bio_byte feature Fix memory corruption due to incorrect parameter being passed to bio_init

  • Critical 9.8

    nvme-tcp: fix potential memory corruption in nvme_tcp_recv_pdu()

    In the Linux kernel, the following vulnerability has been resolved: nvme-tcp: fix potential memory corruption in nvme_tcp_recv_pdu() nvme_tcp_recv_pdu() doesn't check the validity of the header length. When header digests are enabled, a target might send a pa…

  • High 7.8

    sched/fair: Fix potential memory corruption in child_cfs_rq_on_list

    In the Linux kernel, the following vulnerability has been resolved: sched/fair: Fix potential memory corruption in child_cfs_rq_on_list child_cfs_rq_on_list attempts to convert a 'prev' pointer to a cfs_rq. This 'prev' pointer can originate from struct rq's l…

  • Medium 6.5

    A permissions issue was addressed with additional restrictions. This issue is fixed in macOS Sequoia 15.4, macOS Sonoma…

  • Critical 9.8

    An out-of-bounds write issue was addressed with improved bounds checking. This issue is fixed in macOS Sequoia 15.4, ma…

  • Medium 5.5

    This issue was addressed through improved state management. This issue is fixed in Xcode 16.3. An app may be able to ov…

  • Critical 9.8

    The issue was addressed with improved checks. This issue is fixed in macOS Sequoia 15.4, macOS Sonoma 14.7.5, macOS Ven…

  • High 7.8

    An out-of-bounds write issue was addressed with improved bounds checking. This issue is fixed in macOS Sequoia 15.4, ma…

  • High 7.1
    CVE-2025-24257 Public exploit

    An out-of-bounds write issue was addressed with improved input validation. This issue is fixed in iOS 18.4 and iPadOS 1…

  • Medium 5.3

    TA-Lib ta_regtest test_minmax.c setInputBuffer out-of-bounds write

    A vulnerability, which was classified as critical, has been found in TA-Lib up to 0.6.4. This issue affects the function setInputBuffer of the file src/tools/ta_regtest/ta_test_func/test_minmax.c of the component ta_regtest. The manipulation leads to out-of-b…

  • Critical 9.4

    Out-of-bounds vulnerability in EMF Recode processing of Generic Plus PCL6 Printer Driver / Generic Plus UFR II Printer …

  • Medium 6.3

    Open Asset Import Library Assimp CSM File CSMLoader.cpp InternReadFile out-of-bounds write

    A vulnerability, which was classified as critical, was found in Open Asset Import Library Assimp 5.4.3. This affects the function Assimp::CSMImporter::InternReadFile of the file code/AssetLib/CSM/CSMLoader.cpp of the component CSM File Handler. The manipulati…

  • High 7.5

    NASA cFS (Core Flight System) Aquila is vulnerable to segmentation fault via sending a malicious telecommand to the Mem…

  • High 7.8

    Santesoft Sante DICOM Viewer Pro Out-of-bounds Write

    Santesoft Sante DICOM Viewer Pro is vulnerable to an out-of-bounds write, which requires a user to open a malicious DCM file, resulting in execution of arbitrary code by a local attacker.

  • High 8.9

    CryptoLib's Crypto_TC_ApplySecurity() Has a Heap Buffer Overflow Vulnerability

    CryptoLib provides a software-only solution using the CCSDS Space Data Link Security Protocol - Extended Procedures (SDLS-EP) to secure communications between a spacecraft running the core Flight System (cFS) and a ground station. In versions 1.3.3 and prior,…

  • Medium 5.5

    An out-of-bounds write issue was addressed with improved input validation. This issue is fixed in macOS Sequoia 15.3, m…

  • Critical 9.8

    Tenda AC6 v15.03.05.16 was discovered to contain a buffer overflow via the formSetSpeedWan function.

  • Critical 9.8

    Tenda AC6 v15.03.05.16 was discovered to contain a buffer overflow via the formWifiWpsOOB function.

  • Critical 9.8
    CVE-2025-29384 Public exploit

    In Tenda AC9 v1.0 V15.03.05.14_multi, the wanMTU parameter of /goform/AdvSetMacMtuWan has a stack overflow vulnerabilit…

  • Critical 9.8

    Tenda AC6 v15.03.05.16 was discovered to contain a buffer overflow via the fromAddressNat function.

  • Critical 9.8

    In Tenda AC9 v1.0 V15.03.05.14_multi, the mac parameter of /goform/AdvSetMacMtuWan has a stack overflow vulnerability, …

  • Critical 9.8

    In Tenda AC9 v1.0 V15.03.05.14_multi, the cloneType parameter of /goform/AdvSetMacMtuWan has a stack overflow vulnerabi…

  • Medium 5.5

    gtp: Suppress list corruption splat in gtp_net_exit_batch_rtnl().

    In the Linux kernel, the following vulnerability has been resolved: gtp: Suppress list corruption splat in gtp_net_exit_batch_rtnl(). Brad Spengler reported the list_del() corruption splat in gtp_net_exit_batch_rtnl(). [0] Commit eb28fd76c0a0 ("gtp: Destroy d…

  • High 7.8

    Ashlar-Vellum Cobalt VC6 File Parsing Out-Of-Bounds Write Remote Code Execution Vulnerability

    Ashlar-Vellum Cobalt VC6 File Parsing Out-Of-Bounds Write Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of Ashlar-Vellum Cobalt. User interaction is required to exploit this…

  • Critical 10.0
    CVE-2025-24201 Exploited Public exploit

    An out-of-bounds write issue was addressed with improved checks to prevent unauthorized actions. This issue is fixed in…

    KEV Mar 13, 2025
  • High 7.8

    Illustrator | Out-of-bounds Write (CWE-787)

    Illustrator versions 29.2.1, 28.7.4 and earlier are affected by an out-of-bounds write vulnerability that could result in arbitrary code execution in the context of the current user. Exploitation of this issue requires user interaction in that a victim must o…

  • High 7.8

    InDesign Desktop | Out-of-bounds Write (CWE-787)

    InDesign Desktop versions ID20.1, ID19.5.2 and earlier are affected by an out-of-bounds write vulnerability that could result in arbitrary code execution in the context of the current user. Exploitation of this issue requires user interaction in that a victim…