CWEweakness
CWE-124 Buffer Underwrite
Medium
Official page ↗
- Alternate terms
- Buffer Underrun, Buffer Underflow
- Abstraction
- Base
- Structure
- Simple
- Status
- Incomplete
- Likelihood of exploit
- Medium
- Languages
- C, C++, Memory-Unsafe
- CWE version
- 5.0
Description
The product writes to a buffer using an index or pointer that references a memory location prior to the beginning of the buffer.
Common consequences
• Integrity, Availability: Modify Memory, DoS: Crash, Exit, or Restart — Out of bounds memory access will very likely result in the corruption of relevant memory, and perhaps instructions, possibly leading to a crash.
• Integrity, Confidentiality, Availability, Access Control, Other: Execute Unauthorized Code or Commands, Modify Memory, Bypass Protection Mechanism, Other — If the corrupted memory can be effectively controlled, it may be possible to execute arbitrary code. If the corrupted memory is data rather than instructions, the system will continue to function with improper changes, possibly in violation of an implicit or explicit policy. The consequences would only be limited by how the affected data is used, such as an adjacent memory location that is used to specify whether the user has special privileges.
• Access Control, Other: Bypass Protection Mechanism, Other — When the consequence is arbitrary code execution, this can often be used to subvert any other security service.
Potential mitigations
• [Requirements] Choose a language that is not susceptible to these issues.
• [Implementation] All calculated values that are used as index or for pointer arithmetic should be validated to ensure that they are within an expected range.
Detection methods
• Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
• Automated Dynamic Analysis: Use tools that are integrated during
compilation to insert runtime error-checking mechanisms
related to memory safety errors, such as AddressSanitizer
(ASan) for C/C++ [REF-1518].
Observed examples
• CVE-2021-24018: buffer underwrite in firmware verification routine allows code execution via a crafted firmware image
• CVE-2002-2227: Unchecked length of SSLv2 challenge value leads to buffer underflow.
• CVE-2007-4580: Buffer underflow from a small size value with a large buffer (length parameter inconsistency, CWE-130)
• CVE-2007-1584: Buffer underflow from an all-whitespace string, which causes a counter to be decremented before the buffer while looking for a non-whitespace character.
• CVE-2007-0886: Buffer underflow resultant from encoded data that triggers an integer overflow.
• CVE-2006-6171: Product sets an incorrect buffer size limit, leading to "off-by-two" buffer underflow.
• CVE-2006-4024: Negative value is used in a memcpy() operation, leading to buffer underflow.
• CVE-2004-2620: Buffer underflow due to mishandled special characters
Related
Observed example · CVE (8)
- CVE-2021-24018 A buffer underwrite vulnerability in the firmware verification routine of FortiOS before 7.0.1 may allow an attacker located in the… vulnerability
- CVE-2007-4580 Buffer underflow in redlight.sys in BufferZone 2.1 and 2.5 allows local users to cause a denial of service (crash) and possibly execute… vulnerability
- CVE-2007-1584 Buffer underflow in the header function in PHP 5.2.0 allows context-dependent attackers to execute arbitrary code by passing an… vulnerability
- CVE-2007-0886 Heap-based buffer underflow in axigen 1.2.6 through 2.0.0b1 allows remote attackers to cause a denial of service (application crash) and… vulnerability
- CVE-2006-6171 ProFTPD 1.3.0a and earlier does not properly set the buffer size limit when CommandBufferSize is specified in the configuration file, which… vulnerability
- CVE-2006-4024 The FESTAHES_Load function in pce/hes.c in Festalon 0.5.0 through 0.5.5 allows user-assisted attackers to cause a denial of service (crash)… vulnerability
- CVE-2004-2620 The MIMEH_read_headers function in ripMIME 1.3.1.0 does not properly handle trailing "\r" and "\n" characters in headers, which leads to a… vulnerability
- CVE-2002-2227 Buffer underflow in ssldump 0.9b2 and earlier allows remote attackers to cause a denial of service (memory corruption) via a crafted SSLv2… vulnerability
Child of · CWE (2)
Referenced by CVE · weakness (45)
- CVE-2026-109964 ImageMagick before 7.1.2-33 and 6.9.13-58 contains a heap buffer underwrite vulnerability in DecodeImage() in coders/pict.c on 32-bit… vulnerability
- CVE-2026-97008 Buffer underwrite ('buffer underflow') in Microsoft Office Excel allows an unauthorized attacker to execute code over a network. vulnerability
- CVE-2026-109448 Integer wraparound in psqlODBC SQLBindParameter allows an application, or an attacker who controls how many parameters the application… vulnerability
- CVE-2026-16179 IBM DataPower Gateway 10.5.0.0 through 10.5.0.22, 10.6.1 through 10.6.6, 10.6.0.0 through 10.6.0.10, and 11.0.0.0 through 11.0.0.2 could… vulnerability
- CVE-2026-40013 An attacker that has valid credentials can submit a Sieve script containing an extreme numeric literal, which causes an out-of-bounds write… vulnerability
- CVE-2026-73075 Vim is an open source, command line text editor. vulnerability
- CVE-2026-71969 OP-TEE OS through 4.10.0, fixed in commit 7b8b494, contains a buffer underwrite vulnerability in the RSA NOPAD encrypt and decrypt… vulnerability
- CVE-2026-16439 In Eclipse OpenJ9 versions up to 0.60, using -Xtrace to trace method arguments can lead to buffer underflow. vulnerability
- CVE-2026-26199 HDF5 is a high-performance library and a file format specification that implements the HDF5 data model. vulnerability
- CVE-2026-44631 Buffer Underwrite vulnerability in Apache HTTP Server on crafted regular expressions in the configuration. vulnerability
- CVE-2024-36343 Improper input validation in the System Management Mode (SMM) communications buffer could allow a privileged attacker to perform an out of… vulnerability
- CVE-2026-34253 A buffer underflow vulnerability has been identified in the ogg123 utility from the vorbis-tools 1.4.3 package in function remotethread in… vulnerability
- CVE-2026-5089 YAML::Syck versions before 1.38 for Perl has an out-of-bounds read. vulnerability
- CVE-2026-26204 Wazuh is a free and open source platform used for threat prevention, detection, and response. vulnerability
- CVE-2026-41499 Wazuh is a free and open source platform used for threat prevention, detection, and response. vulnerability
- CVE-2026-0966 A flaw was found in libssh. vulnerability
- CVE-2026-20104 A vulnerability in the bootloader of Cisco IOS XE Software for Cisco Catalyst 9200 Series Switches, Cisco Catalyst ESS9300 Embedded Series… vulnerability
- CVE-2026-28419 Vim is an open source, command line text editor. vulnerability
- CVE-2024-36310 Improper input validation in the SMM communications buffer could allow a privileged attacker to perform an out of bounds read or write to… vulnerability
- CVE-2026-1485 A flaw was found in Glib's content type parsing logic. vulnerability
- CVE-2025-68114 Capstone is a disassembly framework. vulnerability
- CVE-2025-61915 OpenPrinting CUPS is an open source printing system for Linux and other Unix-like operating systems. vulnerability
- CVE-2025-62786 Wazuh is a free and open source platform used for threat prevention, detection, and response. vulnerability
- CVE-2025-61690 KV STUDIO versions 12.23 and prior contain a buffer underflow vulnerability. vulnerability
- CVE-2025-53101 ImageMagick is free and open-source software used for editing and manipulating digital images. vulnerability
- CVE-2025-20694 In Bluetooth FW, there is a possible system crash due to an uncaught exception. vulnerability
- CVE-2025-20695 In Bluetooth FW, there is a possible system crash due to an uncaught exception. vulnerability
- CVE-2025-4373 A flaw was found in GLib, which is vulnerable to an integer overflow in the g_string_insert_unichar() function. vulnerability
- CVE-2023-25610 A buffer underwrite ('buffer underflow') vulnerability in the administrative interface of Fortinet FortiOS version 7.2.0 through 7.2.3,… vulnerability
- CVE-2025-27439 Buffer underflow in some Zoom Workplace Apps may allow an authenticated user to conduct an escalation of privilege via network access. vulnerability