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

761 results · Clear filters · Feed

  • Critical 9.6

    Heap buffer overflow in Blink in Google Chrome prior to 101.0.4951.41 allowed a remote attacker who convinced a user to…

  • Critical 9.8

    Open Babel has out-of-bounds write in ORCA nAtoms parser (second variant)

    Multiple out-of-bounds write vulnerabilities exist in the ORCA format nAtoms functionality of Open Babel 3.1.1 and master commit 530dbfa3. A specially-crafted malformed file can lead to arbitrary code execution. An attacker can provide a malicious file to tri…

  • Critical 9.8

    Open Babel has out-of-bounds write in Gaussian translationVectors[]

    Multiple out-of-bounds write vulnerabilities exist in the translationVectors parsing functionality in multiple supported formats of Open Babel 3.1.1 and master commit 530dbfa3. A specially-crafted malformed file can lead to arbitrary code execution. An attack…

  • Critical 9.8

    Open Babel has out-of-bounds write in MSI translationVectors[]

    Multiple out-of-bounds write vulnerabilities exist in the translationVectors parsing functionality in multiple supported formats of Open Babel 3.1.1 and master commit 530dbfa3. A specially-crafted malformed file can lead to arbitrary code execution. An attack…

  • Critical 9.8

    Open Babel has out-of-bounds write in MOPAC IN translationVectors[] (Tv atom)

    Multiple out-of-bounds write vulnerabilities exist in the translationVectors parsing functionality in multiple supported formats of Open Babel 3.1.1 and master commit 530dbfa3. A specially-crafted malformed file can lead to arbitrary code execution. An attack…

  • Critical 9.8

    Open Babel has out-of-bounds write in ORCA nAtoms parser

    Multiple out-of-bounds write vulnerabilities exist in the ORCA format nAtoms functionality of Open Babel 3.1.1 and master commit 530dbfa3. A specially-crafted malformed file can lead to arbitrary code execution. An attacker can provide a malicious file to tri…

  • Critical 9.8

    Open Babel has out-of-bounds write in MOPAC translationVectors[] (UNIT CELL TRANSLATION)

    Multiple out-of-bounds write vulnerabilities exist in the translationVectors parsing functionality in multiple supported formats of Open Babel 3.1.1 and master commit 530dbfa3. A specially-crafted malformed file can lead to arbitrary code execution. An attack…

  • Critical 9.8

    Open Babel has out-of-bounds write in MOPAC translationVectors[] (FINAL POINT)

    Multiple out-of-bounds write vulnerabilities exist in the translationVectors parsing functionality in multiple supported formats of Open Babel 3.1.1 and master commit 530dbfa3. A specially-crafted malformed file can lead to arbitrary code execution. An attack…

  • Critical 9.8

    Open Babel has out-of-bounds write in CSR PadString (title field)

    An out-of-bounds write vulnerability exists in the CSR format title functionality of Open Babel 3.1.1 and master commit 530dbfa3. A specially crafted malformed file can lead to arbitrary code execution. An attacker can provide a malicious file to trigger this…

  • Critical 9.8

    Open Babel has out-of-bounds write in PQS coord_file parser

    An out-of-bounds write vulnerability exists in the PQS format coord_file functionality of Open Babel 3.1.1 and master commit 530dbfa3. A specially crafted malformed file can lead to arbitrary code execution. An attacker can provide a malicious file to trigger…

  • Critical 9.8

    DoS due to heap overflow

    Server or Console Station DoS due to heap overflow occurring during the handling of a specially crafted message for a specific configuration operation.  See Honeywell Security Notification for recommendations on upgrading and versioning.

  • Critical 9.8

    Server DoS due to heap overflow

    Experion server DoS due to heap overflow occurring during the handling of a specially crafted message for a specific configuration operation.  See Honeywell Security Notification for recommendations on upgrading and versioning.

  • Critical 9.8

    Rockwell Automation ControlLogix Communication Modules Vulnerable to Remote Code Execution

    Where this vulnerability exists in the Rockwell Automation 1756 EN2* and 1756 EN3* ControlLogix communication products, it could allow a malicious user to perform remote code execution with persistence on the target system through maliciously crafted CIP mess…

  • Critical 9.8

    Tenda AC1206 V15.03.06.23, F1202 V1.2.0.20(408), and FH1202 V1.2.0.20(408) were discovered to contain a stack overflow …

  • Critical 9.6

    Buffer overflow in S0 Decryption on Unify Gateway

    Description: A vulnerability in SiLabs Unify Gateway 1.3.1 and earlier allows an unauthenticated attacker within Z-Wave range to overflow a stack buffer, leading to arbitrary code execution.

  • Critical 9.6

    Buffer overflow in S0 Decryption on Z/IP Gatweay

    Description: A vulnerability in SiLabs Z/IP Gateway 7.18.01 and earlier allows an unauthenticated attacker within Z-Wave range to overflow a stack buffer, leading to arbitrary code execution.

  • Critical 9.8

    Memory safety bugs present in Firefox 113. Some of these bugs showed evidence of memory corruption and we presume that …

  • Critical 9.8

    An attacker could have caused an out of bounds memory access using WebGL APIs, leading to memory corruption and a poten…

  • Critical 9.8

    Nanopb before 0.3.1 allows size_t overflows in pb_dec_bytes and pb_dec_string.

  • Critical 9.8

    TP-Link TL-WPA7510 (EU)_V2_190125 was discovered to contain a stack overflow via the operation parameter at /admin/loca…

  • Critical 9.8

    Matthias-Wandel/jhead jhead 3.06 is vulnerable to Buffer Overflow via shellescape(), jhead.c, jhead. jhead copies strin…

  • Critical 9.8

    A buffer overflow was discovered in Progress DataDirect Connect for ODBC before 08.02.2770 for Oracle. An overly large …

  • Critical 9.8

    Tenda AC10 v4 US_AC10V4.0si_V16.03.10.13_cn was discovered to contain a stack overflow via parameter time at /goform/sa…

  • Critical 9.8

    Tenda AC8V4.0-V16.03.34.06 was discovered to contain a stack overflow via the time parameter in the get_parentControl_l…

  • Critical 9.8

    Tenda AC8V4.0-V16.03.34.06 was discovered to contain a stack overflow via the time parameter in the sub_4a79ec function.

  • Critical 9.8

    Tenda AC8V4.0-V16.03.34.06 was discovered to contain a stack overflow via the deviceId parameter in the saveParentContr…

  • Critical 9.8

    Tenda AC8V4.0-V16.03.34.06 was discovered to contain a stack overflow via the firewallEn parameter in the formSetFirewa…

  • Critical 9.8
    CVE-2023-33669 Public exploit

    Tenda AC8V4.0-V16.03.34.06 was discovered to contain a stack overflow via the timeZone parameter in the sub_44db3c func…

  • Critical 9.8
    CVE-2023-33476 Public exploit

    ReadyMedia (MiniDLNA) versions from 1.1.15 up to 1.3.2 is vulnerable to Buffer Overflow. The vulnerability is caused by…

  • Critical 9.8

    RIOT-OS vulnerable to Out of Bounds Write in _rbuf_add

    RIOT-OS, an operating system for Internet of Things (IoT) devices, contains a network stack with the ability to process 6LoWPAN frames. In version 2023.01 and prior, an attacker can send a crafted frame to the device resulting in an out of bounds write in the…

  • Critical 9.8

    The `Toybox.Ant.BurstPayload.add` API method in CIQ API version 2.2.0 through 4.1.7 suffers from a type confusion vulnr…

  • Critical 9.8
    CVE-2023-28753 Public exploit

    netconsd prior to v0.2 was vulnerable to an integer overflow in its parse_packet function. A malicious individual could…

  • Critical 9.8

    A stack-based buffer overflow in the ChangeFriendlyName() function of Belkin Smart Outlet V2 F7c063 firmware_2.00.11420…

  • Critical 9.8

    D-Link DIR-605L firmware version 1.17B01 BETA is vulnerable to stack overflow via /goform/formTcpipSetup,

  • Critical 9.8

    Improper access control settings in ASP Bootloader may allow an attacker to corrupt the return address causing a stack-…

  • Critical 9.8

    H3C GR-1200W MiniGRW1A0V100R006 was discovered to contain a stack overflow via the function version_set.

  • Critical 9.8

    H3C GR-1200W MiniGRW1A0V100R006 was discovered to contain a stack overflow via the function set_tftp_upgrad.

  • Critical 9.8

    The issue was addressed with improved memory handling. This issue is fixed in macOS Ventura 13.3, macOS Monterey 12.6.4…

  • Critical 9.8

    Certain HP LaserJet Pro print products are potentially vulnerable to Heap Overflow and/or Remote Code Execution.

  • Critical 9.8

    SmartDNS through 41 before 56d0332 allows an out-of-bounds write because of a stack-based buffer overflow in the _dns_e…