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

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CWE-121 (栈缓冲区溢出) — Vulnerability Class 2516

2516 vulnerabilities classified as CWE-121 (栈缓冲区溢出). AI Chinese analysis included.

CWE-121 represents a critical memory safety weakness where program data exceeds the allocated bounds of a stack-allocated buffer, corrupting adjacent memory structures. Attackers typically exploit this vulnerability by injecting malicious payloads that overwrite the function’s return address or saved frame pointer, thereby hijacking control flow to execute arbitrary code with the privileges of the compromised process. This exploitation is particularly dangerous because stack buffers are local variables, making the attack surface common in low-level languages like C and C++. Developers mitigate this risk by enforcing strict input validation, utilizing safe string handling functions that prevent unbounded writes, and adopting modern programming languages with automatic memory management. Additionally, implementing compiler-level protections such as stack canaries and Address Space Layout Randomization significantly raises the barrier for successful exploitation, ensuring system integrity remains intact against buffer overflow attempts.

MITRE CWE Description
A stack-based buffer overflow condition is a condition where the buffer being overwritten is allocated on the stack (i.e., is a local variable or, rarely, a parameter to a function).
Common Consequences (3)
AvailabilityModify Memory, DoS: Crash, Exit, or Restart, DoS: Resource Consumption (CPU), DoS: Resource Consumption (Memory)
Buffer overflows generally lead to crashes. Other attacks leading to lack of availability are possible, including putting the program into an infinite loop.
Integrity, Confidentiality, Availability, Access ControlModify Memory, Execute Unauthorized Code or Commands, Bypass Protection Mechanism
Buffer overflows often can be used to execute arbitrary code, which is usually outside the scope of a program's implicit security policy.
Integrity, Confidentiality, Availability, Access Control, OtherModify Memory, Execute Unauthorized Code or Commands, Bypass Protection Mechanism, Other
When the consequence is arbitrary code execution, this can often be used to subvert any other security service.
Mitigations (5)
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
Architecture and DesignUse an abstraction library to abstract away risky APIs. Not a complete solution.
ImplementationImplement and perform bounds checking on input.
ImplementationDo not use dangerous functions such as gets. Use safer, equivalent functions which check for boundary errors.
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)
While buffer overflow examples can be rather complex, it is possible to have very simple, yet still exploitable, stack-based buffer overflows:
#define BUFSIZE 256 int main(int argc, char **argv) { char buf[BUFSIZE]; strcpy(buf, argv[1]); }
Bad · C
This example takes an IP address from a user, verifies that it is well formed and then looks up the hostname and copies it into a buffer.
void host_lookup(char *user_supplied_addr){ struct hostent *hp; in_addr_t *addr; char hostname[64]; in_addr_t inet_addr(const char *cp); /*routine that ensures user_supplied_addr is in the right format for conversion */ validate_addr_form(user_supplied_addr); addr = inet_addr(user_supplied_addr); hp = gethostbyaddr( addr, sizeof(struct in_addr), AF_INET); strcpy(hostname, hp->h_name); }
Bad · C
CVE IDTitleCVSSSeverityPublished
CVE-2017-12707 iniNet Solutions SpiderControl SCADA MicroBrowser 缓冲区错误漏洞 — SpiderControl SCADA MicroBrowser 8.8 -2017-08-25
CVE-2017-7936 多款NXP i.MX产品缓冲区错误漏洞 — NXP i.MX Product Family 6.3 -2017-08-07
CVE-2017-9647 Continental AG Infineon S-Gold 2 (PMB 8876) chipset 缓冲区错误漏洞 — Continental AG Infineon S-Gold 2 (PMB 8876) 6.6 -2017-08-07
CVE-2017-9629 Schneider Electric Wonderware ArchestrA Logger 缓冲区错误漏洞 — Schneider Electric Wonderware ArchestrA Logger 9.8 -2017-07-07
CVE-2017-7910 Digital Canal Structural Wind Analysis 缓冲区错误漏洞 — Digital Canal Structural Wind Analysis 7.5 -2017-06-14
CVE-2017-5177 VIPA Controls WinPLC7 缓冲区错误漏洞 — VIPA Controls WinPLC7 9.8 -2017-05-19
CVE-2017-6025 3S-Smart Software Solutions GmbH CODESYS Web Server 缓冲区错误漏洞 — 3S-Smart Software Solutions GmbH CODESYS Web Server 9.8 -2017-05-19
CVE-2017-6035 Wecon Technologies LEVI Studio HMI Editor 缓冲区错误漏洞 — Wecon Technologies LEVI Studio HMI Editor 8.1 -2017-04-27
CVE-2017-6023 多款Fatek Automation PLC产品缓冲区错误漏洞 — Fatek Automation PLC Ethernet Module 9.8 -2017-03-16
CVE-2014-9200 Schneider Electric Device Type Managers (DTMs) Stack-based Buffer Overflow — Unity Pro 7.8 -2015-02-01
CVE-2014-9190 Schneider Electric Wonderware InTouch Access Anywhere Server Buffer Overflow — InTouch Access Anywhere Server 9.8 -2015-01-10
CVE-2014-5407 Schneider Electric VAMPSET Stack-based Buffer Overflow — VAMPSET 5.5 -2014-09-15
CVE-2014-2364 Advantech WebAccess Stack-Based Buffer Overflow — WebAccess 9.8 -2014-07-19
CVE-2014-0782 Yokogawa CENTUM CS 3000 Stack-based Buffer Overflow — CENTUM CS 3000 8.4 -2014-05-16
CVE-2014-0764 Advantech WebAccess Stack-based Buffer Overflow — WebAccess 9.8 -2014-04-12
CVE-2014-0765 Advantech WebAccess Stack-based Buffer Overflow — WebAccess 9.8 -2014-04-12
CVE-2014-0766 Advantech WebAccess Stack-based Buffer Overflow — WebAccess 9.8 -2014-04-12
CVE-2014-0767 Advantech WebAccess Stack-based Buffer Overflow — WebAccess 9.8 -2014-04-12
CVE-2014-0768 Advantech WebAccess Stack-based Buffer Overflow — WebAccess 9.8 -2014-04-12
CVE-2014-0770 Advantech WebAccess Stack-based Buffer Overflow — WebAccess 9.8 -2014-04-12
CVE-2014-0787 WellinTech KingSCADA Stack-based Buffer Overflow — KingSCADA 9.8 -2014-04-12
CVE-2014-0783 Yokogawa CENTUM CS 3000 Stack-based Buffer Overflow — CENTUM CS 3000 9.8 -2014-03-14
CVE-2014-0784 Yokogawa CENTUM CS 3000 Stack-based Buffer Overflow — CENTUM CS 3000 9.8 -2014-03-14
CVE-2014-0774 Schneider Electric OFS Stack Buffer Overflow — TLXCDSUOFS33 7.8 -2014-02-28
CVE-2014-0753 Ecava IntegraXor Stack-based Buffer Overflow — IntegraXor 6.2 -2014-01-21
CVE-2010-3872 Httpd: mod_fcgid: stack-based buffer overflow in fcgid_header_bucket_read() in modules/fcgid/fcgid_bucket.c — mod_fcgid 7.5 High2010-11-20

Vulnerabilities classified as CWE-121 (栈缓冲区溢出) represent 2516 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.