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

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CWE-120 (未进行输入大小检查的缓冲区拷贝(传统缓冲区溢出)) — Vulnerability Class 1767

1767 vulnerabilities classified as CWE-120 (未进行输入大小检查的缓冲区拷贝(传统缓冲区溢出)). AI Chinese analysis included.

CWE-120 represents a critical memory safety vulnerability where software copies data into a fixed-size buffer without validating the input’s length against the destination’s capacity. This classic buffer overflow occurs when an attacker supplies input exceeding the allocated memory space, causing data to spill into adjacent memory regions. Exploitation typically involves injecting malicious code or altering program control flow, such as overwriting return addresses to execute arbitrary commands. Developers prevent this weakness by implementing rigorous bounds checking before any copy operation, ensuring the input size never exceeds the buffer’s limits. Utilizing safer, language-specific functions that automatically handle size verification, or adopting modern programming languages with built-in memory safety features, effectively mitigates this risk and preserves application integrity against memory corruption attacks.

MITRE CWE Description
The product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer.
Common Consequences (2)
Integrity, Confidentiality, AvailabilityModify Memory, Execute Unauthorized Code or Commands
Buffer overflows often can be used to execute arbitrary code, which is usually outside the scope of the product's implicit security policy. This can often be used to subvert any other security service.
AvailabilityModify Memory, DoS: Crash, Exit, or Restart, DoS: Resource Consumption (CPU)
Buffer overflows generally lead to crashes. Other attacks leading to lack of availability are possible, including putting the product into an infinite loop.
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 your buffer is as large as you specify. 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 i…
ImplementationAssume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range…
Examples (2)
The following code asks the user to enter their last name and then attempts to store the value entered in the last_name array.
char last_name[20]; printf ("Enter your last name: "); scanf ("%s", last_name);
Bad · C
The following code attempts to create a local copy of a buffer to perform some manipulations to the data.
void manipulate_string(char * string){ char buf[24]; strcpy(buf, string); ... }
Bad · C
CVE IDTitleCVSSSeverityPublished
CVE-2022-41028 Siretta QUARTZ-GOLD 缓冲区错误漏洞 — QUARTZ-GOLD 7.2 -2023-01-26
CVE-2022-41029 Siretta QUARTZ-GOLD 缓冲区错误漏洞 — QUARTZ-GOLD 7.2 -2023-01-26
CVE-2022-41014 Siretta QUARTZ-GOLD 安全漏洞 — QUARTZ-GOLD 9.8 -2023-01-26
CVE-2022-41015 Siretta QUARTZ-GOLD 安全漏洞 — QUARTZ-GOLD 9.8 -2023-01-26
CVE-2022-41016 Siretta QUARTZ-GOLD 安全漏洞 — QUARTZ-GOLD 9.8 -2023-01-26
CVE-2022-41017 Siretta QUARTZ-GOLD 安全漏洞 — QUARTZ-GOLD 9.8 -2023-01-26
CVE-2022-41018 Siretta QUARTZ-GOLD 安全漏洞 — QUARTZ-GOLD 9.8 -2023-01-26
CVE-2022-41019 Siretta QUARTZ-GOLD 缓冲区错误漏洞 — QUARTZ-GOLD 7.2 -2023-01-26
CVE-2022-41020 Siretta QUARTZ-GOLD 缓冲区错误漏洞 — QUARTZ-GOLD 7.2 -2023-01-26
CVE-2022-41021 Siretta QUARTZ-GOLD 缓冲区错误漏洞 — QUARTZ-GOLD 7.2 -2023-01-26
CVE-2022-41022 Siretta QUARTZ-GOLD 缓冲区错误漏洞 — QUARTZ-GOLD 7.2 -2023-01-26
CVE-2022-41023 Siretta QUARTZ-GOLD 缓冲区错误漏洞 — QUARTZ-GOLD 7.2 -2023-01-26
CVE-2022-41024 Siretta QUARTZ-GOLD 缓冲区错误漏洞 — QUARTZ-GOLD 7.2 -2023-01-26
CVE-2022-41005 Siretta QUARTZ-GOLD 安全漏洞 — QUARTZ-GOLD 9.8 -2023-01-26
CVE-2022-41006 Siretta QUARTZ-GOLD 安全漏洞 — QUARTZ-GOLD 9.8 -2023-01-26
CVE-2022-41007 Siretta QUARTZ-GOLD 安全漏洞 — QUARTZ-GOLD 9.8 -2023-01-26
CVE-2022-41008 Siretta QUARTZ-GOLD 安全漏洞 — QUARTZ-GOLD 9.8 -2023-01-26
CVE-2022-41009 Siretta QUARTZ-GOLD 安全漏洞 — QUARTZ-GOLD 9.8 -2023-01-26
CVE-2022-41010 Siretta QUARTZ-GOLD 安全漏洞 — QUARTZ-GOLD 9.8 -2023-01-26
CVE-2022-41011 Siretta QUARTZ-GOLD 安全漏洞 — QUARTZ-GOLD 7.2 -2023-01-26
CVE-2022-41012 Siretta QUARTZ-GOLD 安全漏洞 — QUARTZ-GOLD 9.8 -2023-01-26
CVE-2022-41013 Siretta QUARTZ-GOLD 安全漏洞 — QUARTZ-GOLD 9.8 -2023-01-26
CVE-2022-40996 Siretta QUARTZ-GOLD 安全漏洞 — QUARTZ-GOLD 9.8 -2023-01-26
CVE-2022-40997 Siretta QUARTZ-GOLD 安全漏洞 — QUARTZ-GOLD 9.8 -2023-01-26
CVE-2022-40998 Siretta QUARTZ-GOLD 安全漏洞 — QUARTZ-GOLD 9.8 -2023-01-26
CVE-2022-40999 Siretta QUARTZ-GOLD 安全漏洞 — QUARTZ-GOLD 9.8 -2023-01-26
CVE-2022-41000 Siretta QUARTZ-GOLD 安全漏洞 — QUARTZ-GOLD 9.8 -2023-01-26
CVE-2022-41001 Siretta QUARTZ-GOLD 安全漏洞 — QUARTZ-GOLD 9.8 -2023-01-26
CVE-2022-41002 Siretta QUARTZ-GOLD 安全漏洞 — QUARTZ-GOLD 9.8 -2023-01-26
CVE-2022-41003 Siretta QUARTZ-GOLD 安全漏洞 — QUARTZ-GOLD 9.8 -2023-01-26

Vulnerabilities classified as CWE-120 (未进行输入大小检查的缓冲区拷贝(传统缓冲区溢出)) represent 1767 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.