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,177 results · Feed

  • High 7.8

    Adobe Premiere Pro Out-of-bounds Write Arbitrary code execution

    Premiere Pro versions 24.1, 23.6.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 must op…

  • High 7.5

    A stack-based buffer overflow vulnerability in gross 0.9.3 through 1.x before 1.0.4 allows remote attackers to trigger …

  • High 7.8

    ActionScript Byte Code “ABC” Vulnerability in the Autodesk FBX Review software

    A maliciously crafted ABC file, when parsed through Autodesk FBX, may force an Out-of-Bounds Write vulnerability. A malicious actor may leverage this vulnerability to cause a crash, cause data corruption, or execute arbitrary code in the context of the curren…

  • High 7.1

    gpac 2.3-DEV-rev921-g422b78ecf-master was discovered to contain a out of boundary write vulnerability via swf_get_strin…

  • Critical 9.3
    CVE-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…

  • High 7.8

    A vulnerability has been identified in Simcenter Femap (All versions < V2306.0000). The affected application contains a…

  • High 7.4

    PHOENIX CONTACT: Out of bounds write only memory access

    An unauthenticated remote attacker can write memory out of bounds due to improper input validation in the MQTT stack. The brute force attack is not always successful because of memory randomization.

  • 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

  • High 8.4

    In tmu_config_gov_params of , there is a possible out of bounds write due to a missing bounds check. This could lead to…

  • 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…

  • High 8.4

    In tmu_set_pi of tmu.c, there is a possible out of bounds write due to a missing bounds check. This could lead to local…

  • High 7.8

    In update_policy_data of , there is a possible out of bounds write due to a missing bounds check. This could lead to lo…

  • High 7.8

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

  • High 7.7

    In AtiHandleAPOMsgType of ati_Main.c, there is a possible OOB write due to a missing null check. This could lead to loc…

  • High 8.4

    there is a possible out of bounds write due to a missing bounds check. This could lead to local escalation of privilege…

  • High 8.4

    In tmu_set_gov_active of tmu.c, there is a possible out of bounds write due to a missing bounds check. This could lead …

  • High 8.4

    In tmu_reset_tmu_trip_counter of , there is a possible out of bounds write due to a missing bounds check. This could le…

  • High 7.1

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

  • High 8.4

    there is a possible Authentication Bypass due to improperly used crypto. This could lead to local escalation of privile…

  • High 7.8

    Santesoft Sante FFT Imaging Out-of-bounds Write

    In Santesoft Sante FFT Imaging versions 1.4.1 and prior once a user opens a malicious DCM file on affected FFT Imaging installations, a local attacker could perform an out-of-bounds write, which could allow for arbitrary code execution.

  • High 7.1

    In getConfig of SoftVideoDecoderOMXComponent.cpp, there is a possible out of bounds write due to a missing validation c…

  • High 7.8

    In onQueueFilled of SoftMPEG4.cpp, there is a possible out of bounds write due to a heap buffer overflow. This could le…

  • Critical 9.8
    CVE-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…

  • High 7.8

    Out of Bounds Write Due to Missing Bounds Check in LabVIEW

    An out of bounds write due to a missing bounds check in LabVIEW may result in remote code execution. Successful exploitation requires an attacker to provide a user with a specially crafted VI. This vulnerability affects LabVIEW 2024 Q1 and prior versions.

  • High 7.8

    Out of Bounds Write Due to Missing Bounds Check in LabVIEW

    An out of bounds write due to a missing bounds check in LabVIEW may result in remote code execution. Successful exploitation requires an attacker to provide a user with a specially crafted VI. This vulnerability affects LabVIEW 2024 Q1 and prior versions.

  • High 7.8

    Out of Bounds Write Due to Missing Bounds Check in LabVIEW

    An out of bounds write due to a missing bounds check in LabVIEW may result in remote code execution. Successful exploitation requires an attacker to provide a user with a specially crafted VI. This vulnerability affects LabVIEW 2024 Q1 and prior versions.

  • Critical 9.8

    Buffer overflow in identifier field of WSD probe request process of Small Office Multifunction Printers and Laser Print…

  • High 7.3

    Wasmi Out-of-bounds Write for host to Wasm calls with more than 128 Parameters

    Wasmi is an efficient and lightweight WebAssembly interpreter with a focus on constrained and embedded systems. In the WASMI Interpreter, an Out-of-bounds Buffer Write will arise if the host calls or resumes a Wasm function with more parameters than the defau…

  • High 7.8

    An out-of-bounds write issue was addressed with improved input validation. This issue is fixed in macOS Monterey 12.7.4…

  • High 8.8

    The issue was addressed with improved memory handling. This issue is fixed in iOS 17.4 and iPadOS 17.4, macOS Sonoma 14…

  • High 7.8

    The issue was addressed with improved memory handling. This issue is fixed in iOS 17.4 and iPadOS 17.4, macOS Monterey …

  • High 8.8

    Z-Wave S0 Decryption Vulnerability in End Devices

    The vulnerability described by CVE-2023-0972 has been additionally discovered in Silicon Labs Z-Wave end devices. This vulnerability may allow an unauthenticated attacker within Z-Wave range to overflow a stack buffer, leading to arbitrary code execution.

  • Medium 6.8
    CVE-2024-2173 EPSS 14%

    Out of bounds memory access in V8 in Google Chrome prior to 122.0.6261.111 allowed a remote attacker to perform out of …

  • High 7.8
    CVE-2024-23296 Exploited Public exploit

    A memory corruption issue was addressed with improved validation. This issue is fixed in iOS 16.7.8 and iPadOS 16.7.8, …

    KEV Mar 6, 2024
  • High 7.8
    CVE-2024-23225 Exploited

    A memory corruption issue was addressed with improved validation. This issue is fixed in iOS 16.7.6 and iPadOS 16.7.6, …

    KEV Mar 6, 2024
  • High 7.9

    Out-of-bounds write vulnerability

    VMware ESXi contains an out-of-bounds write vulnerability. A malicious actor with privileges within the VMX process may trigger an out-of-bounds write leading to an escape of the sandbox.

  • Medium 4.4
  • High 8.4

    In wlan firmware, there is a possible out of bounds write due to improper input validation. This could lead to local es…

  • Medium 6.7

    In da, there is a possible out of bounds write due to lack of valudation. This could lead to local escalation of privil…