Skip to content
OpenAdvisories

Weakness (CWE)

CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer

Class Mapping discouraged

The product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary.

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

3,733 results · Feed

  • High 7.5

    ChakraCore RCE Vulnerability

    ChakraCore and Microsoft Edge in Microsoft Windows 10 1703 allows an attacker to execute arbitrary code in the context of the current user, due to how the scripting engine handles objects in memory, aka "Scripting Engine Memory Corruption Vulnerability". This…

  • High 7.8
    CVE-2017-11774 Exploited Public exploit EPSS 60%

    Microsoft Outlook 2010 SP2, Outlook 2013 SP1 and RT SP1, and Outlook 2016 allow an attacker to execute arbitrary comman…

    KEV Nov 3, 2021
  • High 7.5

    ChakraCore RCE Vulnerability

    ChakraCore and Microsoft Edge in Microsoft Windows 10 1703 allows an attacker to execute arbitrary code in the context of the current user, due to how the scripting engine handles objects in memory, aka "Scripting Engine Memory Corruption Vulnerability". This…

  • High 7.8
    CVE-2017-11826 Exploited Public exploit EPSS 82%

    Microsoft Office 2010, SharePoint Enterprise Server 2010, SharePoint Server 2010, Web Applications, Office Web Apps Ser…

    KEV Mar 3, 2022
  • Unscored —

    A vulnerability in the gRPC code of Cisco IOS XR Software for Cisco Network Convergence System (NCS) 5500 Series Router…

    iOS
  • Unscored —

    A vulnerability in the Independent Computing Architecture (ICA) accelerator feature for the Cisco Wide Area Application…

  • Medium 6.5

    curl supports "globbing" of URLs, in which a user can pass a numerical range to have the tool iterate over those number…

  • High 7.8
    CVE-2017-1000253 Exploited · Ransomware Public exploit EPSS 11%

    Linux distributions that have not patched their long-term kernels with https://git.kernel.org/linus/a87938b2e246b81b4fb…

    KEV Sep 9, 2024
  • High 7.5

    Improper Restriction of Operations within the Bounds of a Memory Buffer in akka-http-core

    Akka HTTP versions <= 10.0.5 Illegal Media Range in Accept Header Causes StackOverflowError Leading to Denial of Service

  • Unscored —

    A vulnerability in the Secure Shell (SSH) subsystem of Cisco Small Business Managed Switches software could allow an au…

  • High 7.5

    Ruby OpenSSL DoS Vulnerability

    The decode method in the OpenSSL::ASN1 module in Ruby before 2.2.8, 2.3.x before 2.3.5, and 2.4.x through 2.4.1 allows attackers to cause a denial of service (interpreter crash) via a crafted string.

  • Unscored —

    A vulnerability in the Trust Verification Service (TVS) of Cisco Unified Communications Manager could allow an unauthen…

  • Unscored —

    An Improper Restriction Of Operations Within The Bounds Of A Memory Buffer issue was discovered in Advantech WebAccess …

  • High 8.8

    Improper Restriction of Operations within the Bounds of a Memory Buffer in OpenCV

    In modules/imgcodecs/src/grfmt_pxm.cpp, the length of buffer AutoBuffer _src is small than expected, which will cause copy buffer overflow later. If the image is from remote, may lead to remote code execution or denial of service. This affects Opencv 3.3 and …

  • Critical 9.8
    CVE-2017-8658 EPSS 20%

    ChakraCore RCE Vulnerability

    A remote code execution vulnerability exists in the way that the Chakra JavaScript engine renders when handling objects in memory, aka "Scripting Engine Memory Corruption Vulnerability".

  • High 7.5

    Improper Restriction of Operations within the Bounds of a Memory Buffer in Apache Tomcat

    The HTTP/2 header parser in Apache Tomcat 9.0.0.M1 to 9.0.0.M11 and 8.5.0 to 8.5.6 entered an infinite loop if a header was received that was larger than the available buffer. This made a denial of service attack possible.

  • High 8.8

    An Improper Restriction of Operations within the Bounds of a Memory Buffer issue was discovered in the Continental AG I…

  • Unscored —

    A vulnerability in the cache server within Cisco Videoscape Distribution Suite (VDS) for Television 3.2(5)ES1 could all…

  • High 8.8

    Improper Restriction of Operations within the Bounds of a Memory Buffer in OpenCV

    OpenCV (Open Source Computer Vision Library) through 3.3 has a buffer overflow in the cv::BmpDecoder::readData function in modules/imgcodecs/src/grfmt_bmp.cpp when reading an image file by using cv::imread, as demonstrated by the 4-buf-overflow-readData-memcp…

  • Unscored —

    A vulnerability in Cisco WebEx browser extensions for Google Chrome and Mozilla Firefox could allow an unauthenticated,…

  • Unscored —

    spice versions though 0.13 are vulnerable to out-of-bounds memory access when processing specially crafted messages fro…

  • High 8.8
    CVE-2017-6740 Exploited EPSS 11%

    The Simple Network Management Protocol (SNMP) subsystem of Cisco IOS and IOS XE Software contains multiple vulnerabilit…

    KEV Mar 3, 2022
  • High 8.8
    CVE-2017-6743 Exploited EPSS 11%

    The Simple Network Management Protocol (SNMP) subsystem of Cisco IOS and IOS XE Software contains multiple vulnerabilit…

    KEV Mar 3, 2022
  • High 8.8
    CVE-2017-6744 Exploited

    The Simple Network Management Protocol (SNMP) subsystem of Cisco IOS and IOS XE Software contains multiple vulnerabilit…

    KEV Mar 3, 2022
  • High 8.8
    CVE-2017-6737 Exploited EPSS 45%

    A vulnerability in the SNMP implementation of could allow an authenticated, remote attacker to cause a reload of the af…

    KEV Mar 3, 2022
  • High 8.8
    CVE-2017-6738 Exploited EPSS 11%

    The Simple Network Management Protocol (SNMP) subsystem of Cisco IOS and IOS XE Software contains multiple vulnerabilit…

    KEV Mar 3, 2022
  • High 8.8
    CVE-2017-6736 Exploited Public exploit EPSS 70%

    The Simple Network Management Protocol (SNMP) subsystem of Cisco IOS and IOS XE Software contains multiple vulnerabilit…

    KEV Mar 3, 2022
  • High 8.8
    CVE-2017-6739 Exploited EPSS 11%

    A vulnerability in the SNMP implementation of could allow an authenticated, remote attacker to cause a reload of the af…

    KEV Mar 3, 2022
  • High 8.8
    CVE-2017-6742 Exploited Public exploit EPSS 21%

    A vulnerability in the SNMP implementation of could allow an authenticated, remote attacker to cause a reload of the af…

    KEV Apr 19, 2023
  • High 8.8

    A vulnerability in the SNMP implementation of could allow an authenticated, remote attacker to cause a reload of the af…

  • Unscored —

    An issue was discovered in Fuji Electric V-Server Version 3.3.22.0 and prior. A memory corruption vulnerability has bee…

  • Unscored —

    Multiple buffer overflow vulnerabilities exist in the Cisco WebEx Network Recording Player for Advanced Recording Forma…

  • High 7.5

    tlslite remote denial of service vulnerability

    The tlslite library before 0.4.9 for Python allows remote attackers to trigger a denial of service (runtime exception and process crash).

  • Unscored —

    A vulnerability in the TCP throttling process of Cisco UCS C-Series Rack Servers 3.0(0.234) could allow an unauthentica…

  • High 7.5

    libxml2 20904-GITv2.9.4-16-g0741801 is vulnerable to a stack-based buffer overflow. The function xmlSnprintfElementCont…

  • Unscored —

    A vulnerability in the Universal Plug-and-Play (UPnP) implementation in the Cisco CVR100W Wireless-N VPN Router could a…

  • Critical 9.8
    CVE-2017-0252 EPSS 13%

    ChakraCore RCE Vulnerability

    A remote code execution vulnerability exists in Microsoft Chakra Core in the way JavaScript engines render when handling objects in memory. aka "Scripting Engine Memory Corruption Vulnerability". This vulnerability is unique from CVE-2017-0223.

  • Critical 9.8
    CVE-2017-0223 EPSS 15%

    ChakraCore RCE Vulnerability

    A remote code execution vulnerability exists in Microsoft Chakra Core in the way JavaScript engines render when handling objects in memory. aka "Scripting Engine Memory Corruption Vulnerability". This vulnerability is unique from CVE-2017-0252.

  • High 7.5
    CVE-2017-0235 EPSS 11%

    ChakraCore RCE Vulnerability

    A remote code execution vulnerability exists in Microsoft Edge in the way that the Chakra JavaScript engine renders when handling objects in memory, aka "Scripting Engine Memory Corruption Vulnerability." This CVE ID is unique from CVE-2017-0224, CVE-2017-022…

  • High 7.5
    CVE-2017-0224 EPSS 11%

    ChakraCore RCE Vulnerability

    A remote code execution vulnerability exists in the way JavaScript engines render when handling objects in memory in Microsoft Edge, aka "Scripting Engine Memory Corruption Vulnerability." This CVE ID is unique from CVE-2017-0228, CVE-2017-0229, CVE-2017-0230…