Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CWE-787 (跨界内存写) — Vulnerability Class 2231

2231 vulnerabilities classified as CWE-787 (跨界内存写). AI Chinese analysis included.

CWE-787 represents a critical memory management weakness where software incorrectly writes data beyond the allocated boundaries of a buffer. This flaw typically arises from insufficient bounds checking, allowing attackers to overwrite adjacent memory locations with malicious payloads. Exploitation often leads to arbitrary code execution, denial of service, or privilege escalation by corrupting critical system structures or control flow data. Developers mitigate this risk by implementing rigorous input validation and utilizing safe programming practices that enforce strict boundary checks before any memory operation. Employing modern languages with automatic memory management, such as Rust or Java, further reduces exposure by preventing direct pointer arithmetic. Additionally, static analysis tools and fuzzing techniques help identify potential out-of-bounds conditions during the development lifecycle, ensuring that buffer operations remain within their intended limits and preserving application integrity against memory corruption attacks.

MITRE CWE Description
The product writes data past the end, or before the beginning, of the intended buffer.
Common Consequences (3)
IntegrityModify Memory, Execute Unauthorized Code or Commands
Write operations could cause memory corruption. In some cases, an adversary can modify control data such as return addresses in order to execute unexpected code.
AvailabilityDoS: Crash, Exit, or Restart
Attempting to access out-of-range, invalid, or unauthorized memory could cause the product to crash.
OtherUnexpected State
Subsequent write operations can produce undefined or unexpected results.
Mitigations (5)
RequirementsUse 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 lan…
Architecture and DesignUse 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 CompilationUse 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…
Effectiveness: Defense in Depth
ImplementationConsider 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…
Operation, Build and CompilationRun 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…
Effectiveness: Defense in Depth
Examples (2)
The following code attempts to save four different identification numbers into an array.
int id_sequence[3]; /* Populate the id array. */ id_sequence[0] = 123; id_sequence[1] = 234; id_sequence[2] = 345; id_sequence[3] = 456;
Bad · C
In the following code, it is possible to request that memcpy move a much larger segment of memory than assumed:
int returnChunkSize(void *) { /* if chunk info is valid, return the size of usable memory, * else, return -1 to indicate an error */ ... } int main() { ... memcpy(destBuf, srcBuf, (returnChunkSize(destBuf)-1)); ... }
Bad · C
CVE IDTitleCVSSSeverityPublished
CVE-2024-30373 Kofax Power PDF JPF File Parsing Out-Of-Bounds Write Remote Code Execution Vulnerability — Power PDF 7.8AIHighAI2024-06-06
CVE-2024-5304 Kofax Power PDF TGA File Parsing Out-Of-Bounds Write Remote Code Execution Vulnerability — Power PDF 7.8AIHighAI2024-06-06
CVE-2024-5303 Kofax Power PDF PSD File Parsing Out-Of-Bounds Write Remote Code Execution Vulnerability — Power PDF 7.8AIHighAI2024-06-06
CVE-2024-5302 Kofax Power PDF PDF File Parsing Out-Of-Bounds Write Remote Code Execution Vulnerability — Power PDF 7.8AIHighAI2024-06-06
CVE-2024-5506 Luxion KeyShot Viewer KSP File Parsing Out-Of-Bounds Write Remote Code Execution Vulnerability — KeyShot Viewer 7.8AIHighAI2024-06-06
CVE-2024-5508 Luxion KeyShot Viewer KSP File Parsing Out-Of-Bounds Write Remote Code Execution Vulnerability — KeyShot Viewer 7.8AIHighAI2024-06-06
CVE-2024-5267 Sonos Era 100 SMB2 Message Handling Out-Of-Bounds Write Remote Code Execution Vulnerability — Era 100 8.8AIHighAI2024-06-06
CVE-2024-30374 Luxion KeyShot Viewer KSP File Parsing Out-Of-Bounds Write Remote Code Execution Vulnerability — KeyShot Viewer 7.8AIHighAI2024-06-06
CVE-2024-20075 MediaTek 芯片 安全漏洞 — MT6833, MT6853, MT6873, MT6877, MT6885, MT6893, MT8185, MT8675, MT8786, MT8789 6.7AIMediumAI2024-06-03
CVE-2024-20074 MediaTek 芯片 安全漏洞 — MT6580, MT6739, MT6761, MT6765, MT6768, MT6779, MT6781, MT6785, MT6789, MT6833, MT6835, MT6853, MT6855, MT6873, MT6877, MT6879, MT6883, MT6885, MT6886, MT6889, MT6893, MT6895, MT6897, MT6983, MT6985, MT6989, MT8666, MT8667, MT8673, MT8676 6.7AIMediumAI2024-06-03
CVE-2024-20073 MediaTek 芯片 安全漏洞 — MT6890, MT7622 6.7AIMediumAI2024-06-03
CVE-2024-20072 MediaTek 芯片 安全漏洞 — MT6890, MT6990, MT7622 6.7AIMediumAI2024-06-03
CVE-2024-20068 MediaTek 芯片 安全漏洞 — MT6298, MT6813, MT6815, MT6835, MT6878, MT6879, MT6895, MT6895T, MT6896, MT6897, MT6899, MT6980, MT6980D, MT6983, MT6986, MT6986D, MT6990, MT6991, MT8673, MT8675, MT8771, MT8791T, MT8792, MT8797, MT8798 7.5AIHighAI2024-06-03
CVE-2024-20067 MediaTek 芯片 安全漏洞 — MT6813, MT6815, MT6835, MT6878, MT6897, MT6899, MT6986, MT6986D, MT6991, MT8792 7.5AIHighAI2024-06-03
CVE-2024-20066 MediaTek 芯片 安全漏洞 — MT6298, MT6813, MT6815, MT6835, MT6878, MT6879, MT6895, MT6895T, MT6896, MT6897, MT6899, MT6980, MT6980D, MT6983, MT6986, MT6986D, MT6990, MT6991, MT8673, MT8792, MT8798 7.5AIHighAI2024-06-03
CVE-2024-32760 NGINX HTTP/3 QUIC vulnerability — NGINX Open Source 6.5 Medium2024-05-29
CVE-2024-24959 AutomationDirect P3-550E 缓冲区错误漏洞 — P3-550E 8.2 High2024-05-28
CVE-2024-24947 AutomationDirect P3-550E 缓冲区错误漏洞 — P3-550E 8.2 High2024-05-28
CVE-2024-24946 AutomationDirect P3-550E 缓冲区错误漏洞 — P3-550E 8.2 High2024-05-28
CVE-2024-24954 AutomationDirect P3-550E 缓冲区错误漏洞 — P3-550E 8.2 High2024-05-28
CVE-2024-24958 AutomationDirect P3-550E 缓冲区错误漏洞 — P3-550E 8.2 High2024-05-28
CVE-2024-24955 AutomationDirect P3-550E 缓冲区错误漏洞 — P3-550E 8.2 High2024-05-28
CVE-2024-24957 AutomationDirect P3-550E 缓冲区错误漏洞 — P3-550E 8.2 High2024-05-28
CVE-2024-24956 AutomationDirect P3-550E 缓冲区错误漏洞 — P3-550E 8.2 High2024-05-28
CVE-2024-23948 libigl 缓冲区错误漏洞 — libigl 8.8 High2024-05-28
CVE-2024-23947 libigl 缓冲区错误漏洞 — libigl 8.8 High2024-05-28
CVE-2024-23949 libigl 缓冲区错误漏洞 — libigl 8.8 High2024-05-28
CVE-2024-23951 libigl 安全漏洞 — libigl 8.8 High2024-05-28
CVE-2024-23950 libigl 缓冲区错误漏洞 — libigl 8.8 High2024-05-28
CVE-2024-30279 ZDI-CAN-22887: Adobe Acrobat Reader DC JPEG2000 File Parsing Out-Of-Bounds Write Remote Code Execution Vulnerability — Acrobat Reader 7.8 High2024-05-23

Vulnerabilities classified as CWE-787 (跨界内存写) represent 2231 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.