Weakness (CWE)
CWE-787: Out-of-bounds Write
The product writes data past the end, or before the beginning, of the intended buffer.
How to prevent it (7 mitigations)
-
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.
-
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.
-
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.
-
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.
-
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].
-
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].
-
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
1,418 results · Clear filters · Feed
-
Medium 6.5CVE-2024-0741 Public exploit
An out of bounds write in ANGLE could have allowed an attacker to corrupt memory leading to a potentially exploitable c…
-
Medium 5.3
Nsasoft ShareAlarmPro Registration memory corruption
A vulnerability was found in Nsasoft ShareAlarmPro 2.1.4 and classified as problematic. Affected by this issue is some unknown functionality of the component Registration Handler. The manipulation of the argument Name/Key leads to memory corruption. Local acc…
-
Medium 4.4
In drm driver, there is a possible out of bounds write due to a missing bounds check. This could lead to local denial o…
-
Medium 4.4
In autotest driver, there is a possible out of bounds write due to improper input validation. This could lead to local …
-
Medium 4.4
In jpg driver, there is a possible out of bounds write due to a missing bounds check. This could lead to local denial o…
-
Medium 4.4
In vsp driver, there is a possible out of bounds write due to a missing bounds check. This could lead to local denial o…
-
Medium 4.4
In jpg driver, there is a possible out of bounds write due to a missing bounds check. This could lead to local denial o…
-
Medium 5.5
In video decoder, there is a possible out of bounds write due to a missing bounds check. This could lead to local denia…
-
Medium 5.5
In video decoder, there is a possible out of bounds write due to a missing bounds check. This could lead to local denia…
-
Medium 5.5
In phasecheckserver, there is a possible out of bounds write due to a missing bounds check. This could lead to local de…
-
Medium 5.5
In video decoder, there is a possible out of bounds write due to improper input validation. This could lead to local de…
-
Medium 5.5
In video decoder, there is a possible out of bounds write due to a missing bounds check. This could lead to local denia…
-
Medium 5.5
In video decoder, there is a possible out of bounds write due to improper input validation. This could lead to local de…
-
Medium 4.4
In media service, there is a possible out of bounds write due to a missing bounds check. This could lead to local denia…
-
Medium 5.5
In video decoder, there is a possible out of bounds write due to improper input validation. This could lead to local de…
-
Medium 6.5
Buffer Overflow vulnerability in Skyworth Router
This vulnerability exist in Skyworth Router CM5100, version 4.1.1.24, due to insufficient validation of user supplied input for the Set Upstream Channel ID (UCID) parameter at its web interface. A remote attacker could exploit this vulnerability by supplying …
-
Medium 6.5
Buffer Overflow vulnerability in Skyworth Router
This vulnerability exist in Skyworth Router CM5100, version 4.1.1.24, due to insufficient validation of user supplied input for the Add Downstream Frequency parameter at its web interface. A remote attacker could exploit this vulnerability by supplying specia…
-
Medium 5.5
SWFTools 0.9.2 772e55a allows attackers to trigger a large memory-allocation attempt via a crafted document, as demonst…
-
Medium 5.5
x86/AMD: mismatch in IOMMU quarantine page table levels
The current setup of the quarantine page tables assumes that the quarantine domain (dom_io) has been initialized with an address width of DEFAULT_DOMAIN_ADDRESS_WIDTH (48) and hence 4 page table levels. However dom_io being a PV domain gets the AMD-Vi IOMMU p…
-
Medium 5.7
`serde` deserialization for `FamStructWrapper` lacks bound checks that could potentially lead to out-of-bounds memory access
vmm-sys-util is a collection of modules that provides helpers and utilities used by multiple rust-vmm components. Starting in version 0.5.0 and prior to version 0.12.0, an issue in the `FamStructWrapper::deserialize` implementation provided by the crate for `…
-
Medium 6.7
In bluetooth service, there is a possible out of bounds write due to improper input validation. This could lead to loca…
-
Medium 6.7
In Engineer Mode, there is a possible out of bounds write due to a missing bounds check. This could lead to local escal…
-
Medium 6.7
In battery, there is a possible memory corruption due to a missing bounds check. This could lead to local escalation of…
-
Medium 6.7
In battery, there is a possible out of bounds write due to a missing bounds check. This could lead to local escalation …
-
Medium 6.7
In battery, there is a possible out of bounds write due to a missing bounds check. This could lead to local escalation …
-
Medium 6.7
In keyInstall, there is a possible out of bounds write due to a missing bounds check. This could lead to local escalati…
-
Medium 5.5
JLine vulnerable to out of memory error
An issue in the component GroovyEngine.execute of jline-groovy v3.24.1 allows attackers to cause an OOM (OutofMemory) error.
-
Medium 5.3
json-path Out-of-bounds Write vulnerability
json-path v2.8.0 was discovered to contain a stack overflow via the Criteria.parse() method.
-
Medium 5.5
W3m: out-of-bounds write in function checktype() in etc.c (incomplete fix for cve-2022-38223)
An out-of-bounds write issue has been discovered in the backspace handling of the checkType() function in etc.c within the W3M application. This vulnerability is triggered by supplying a specially crafted HTML file to the w3m binary. Exploitation of this flaw…
-
Medium 6.4
Azure RTOS USBX Remote Code Execution Vulnerability
Azure RTOS USBX is a USB host, device, and on-the-go (OTG) embedded stack, that is fully integrated with Azure RTOS ThreadX. An attacker can cause remote code execution due to memory buffer and pointer vulnerabilities in Azure RTOS USBX. The affected componen…
-
Medium 6.7
In ril, there is a possible out of bounds write due to a missing bounds check. This could lead to local escalation of p…
-
Medium 6.7
In vdec, there is a possible out of bounds write due to type confusion. This could lead to local escalation of privileg…
-
Medium 5.5
ZDI-CAN-21684: Adobe Audition MP4 File Parsing Out-Of-Bounds Write Remote Code Execution Vulnerability
Adobe Audition version 24.0 (and earlier) and 23.6.1 (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 t…
-
Medium 6.0
Out-of-bounds write in firmware for some Intel(R) FPGA products before version 2.8.1 may allow a privileged user to pot…
-
Medium 5.2
Out-of-bounds write in some Intel(R) Arc(TM) & Iris(R) Xe Graphics - WHQL - Windows drivers before version 31.0.101.425…
-
Medium 6.1
Out-of-bounds write in some Intel(R) Arc(TM) Control software before version 1.73.5335.2 may allow an authenticated use…
-
Medium 6.7
In dpe, there is a possible out of bounds write due to a missing valid range checking. This could lead to local escalat…
-
Medium 6.7
In dpe, there is a possible out of bounds write due to a missing valid range checking. This could lead to local escalat…
-
Medium 6.7
In display, there is a possible out of bounds write due to an integer overflow. This could lead to local escalation of …
-
Medium 4.3
A vulnerability in the CDP processing feature of Cisco ISE could allow an unauthenticated, adjacent attacker to cause a…