What is CWE-120?
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.
CWE-120 is a base-level weakness in MITRE’s Common Weakness Enumeration, with a MITRE likelihood of exploit of High. Applicable platforms: Language: Memory-Unsafe; Language: C; Language: C++; Language: Assembly.
Source: MITRE CWE (CWE-120 definition, reproduced verbatim). Counts and linkage below are Threadlinqs data.
Consequences
- Integrity, Confidentiality, Availability — Modify 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.
- Availability — Modify 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.
Source: MITRE CWE, common consequences.
How CWE-120 is exploited in the wild
Threadlinqs maps 47 CVEs to CWE-120, published between 2017-03-27 and 2026-11-10. 5 are listed in CISA’s Known Exploited Vulnerabilities catalog, the authoritative record of exploitation in the wild. By CVSS v3 severity the set splits into 13 critical, 25 high, 5 medium. The highest EPSS score in the set is 99.8% (CVE-2017-7269), the modelled probability of exploitation in the next 30 days. 55 tracked threats reference CWE-120 directly or through a CVE it covers; the most recent is “Chrome 158 Fixes 204 Vulnerabilities Including Six Critical Code Execution Flaws (CVE-2026-130963, CVE-2026-131031, CVE-2026-131060, CVE-2026-131008, CVE-2026-131054, CVE-2026-130975)” (2026-11-18). Affected products concentrate in Mozilla (13), Notepad-plus-plus (4), TOTOLINK (4), among 19 vendors in total.
Vulnerabilities (CVEs)
Showing 40 of 47 CVEs mapped to CWE-120, CISA KEV first, then by CVSS score.
- CVE-2025-20333 — CISA KEV · CVSS 9.9 critical · EPSS 70.6% · published 2025-09-25
- CVE-2017-7269 — CISA KEV · CVSS 9.8 critical · EPSS 99.8% · published 2017-03-27
- CVE-2022-37055 — CISA KEV · CVSS 9.8 critical · EPSS 55.5% · published 2022-08-28
- CVE-2023-41064 — CISA KEV · CVSS 7.8 high · EPSS 53.4% · published 2023-09-07
- CVE-2025-43520 — CISA KEV · CVSS 5.5 medium · EPSS 0.4% · published 2025-12-12
- CVE-2017-16740 — CVSS 10 critical · EPSS 7.2% · published 2018-01-09
- CVE-2026-19961 — CVSS 9.9 critical · EPSS 0.4% · published 2026-08-16
- CVE-2026-32746 — CVSS 9.8 critical · EPSS 23.6% · published 2026-03-13
- CVE-2026-51808 — CVSS 9.8 critical · EPSS 0.2% · published 2026-07-14
- CVE-2026-124859 — CVSS 9.6 critical · EPSS 0.4% · published 2026-11-10
- CVE-2026-124057 — CVSS 9.1 critical · EPSS 0.6% · published 2026-11-07
- CVE-2026-124060 — CVSS 9.1 critical · EPSS 0.5% · published 2026-11-07
- CVE-2026-124058 — CVSS 9.1 critical · EPSS 0.4% · published 2026-11-07
- CVE-2026-124059 — CVSS 9.1 critical · EPSS 0.4% · published 2026-11-07
- CVE-2026-45537 — CVSS 9.1 critical · EPSS 0.3% · published 2026-08-04
- CVE-2025-15467 — CVSS 8.8 high · EPSS 52.4% · published 2026-01-27
- CVE-2023-43010 — CVSS 8.8 high · EPSS 0.9% · published 2026-03-12
- CVE-2026-124868 — CVSS 8.8 high · EPSS 0.3% · published 2026-11-10
- CVE-2026-124870 — CVSS 8.8 high · EPSS 0.3% · published 2026-11-10
- CVE-2026-124887 — CVSS 8.8 high · EPSS 0.3% · published 2026-11-10
- CVE-2026-124888 — CVSS 8.8 high · EPSS 0.3% · published 2026-11-10
- CVE-2026-124891 — CVSS 8.8 high · EPSS 0.3% · published 2026-11-10
- CVE-2026-124852 — CVSS 8.8 high · EPSS 0.3% · published 2026-11-10
- CVE-2026-124915 — CVSS 8.8 high · EPSS 0.3% · published 2026-11-10
- CVE-2026-124924 — CVSS 8.8 high · EPSS 0.3% · published 2026-11-10
- CVE-2026-124926 — CVSS 8.8 high · EPSS 0.3% · published 2026-11-10
- CVE-2026-124918 — CVSS 8.8 high · EPSS 0.3% · published 2026-11-10
- CVE-2026-124947 — CVSS 8.8 high · EPSS 0.3% · published 2026-11-10
- CVE-2023-47610 — CVSS 8.1 high · EPSS 1.6% · published 2023-11-09
- CVE-2026-12328 — CVSS 8.1 high · EPSS 0.4% · published 2026-06-16
- CVE-2026-82895 — CVSS 8.1 high · EPSS 0.3% · published 2026-10-08
- CVE-2026-84198 — CVSS 8.1 high · EPSS 0.3% · published 2026-10-08
- CVE-2026-84246 — CVSS 8.1 high · EPSS 0.3% · published 2026-10-08
- CVE-2023-40031 — CVSS 7.8 high · EPSS 0.5% · published 2023-08-25
- CVE-2026-71399 — CVSS 7.8 high · EPSS 0.3% · published 2026-08-25
- CVE-2026-67858 — CVSS 7.5 high · EPSS 0.4% · published 2026-08-04
- CVE-2026-67859 — CVSS 7.5 high · EPSS 0.4% · published 2026-08-04
- CVE-2026-24184 — CVSS 7.5 high · EPSS 0.3% · published 2026-08-18
- CVE-2026-44436 — CVSS 7.5 high · EPSS 0.2% · published 2026-07-16
- CVE-2026-102296 — CVSS 6.5 medium · EPSS 0.3% · published 2026-09-28
Affected vendors
Threat activity
55 tracked threats cite CWE-120; the 25 most recent are listed.
- Chrome 158 Fixes 204 Vulnerabilities Including Six Critical Code Execution Flaws (CVE-2026-130963, CVE-2026-131031, CVE-2026-131060, CVE-2026-131008, CVE-2026-131054, CVE-2026-130975)CRITICAL
- OPTIMJACK: Optimizely Web Experimentation Compromise Injects Crypto Clipper, Card Skimmer and iOS Exploit-Kit Loaders (Coruna, DarkSword) into Customer SitesCRITICAL
- Mozilla Firefox 160 Security Update Fixes 99 Vulnerabilities Including 13 Sandbox Escape Flaws (MFSA 2026-125)HIGH
- Six Pre-Auth RCE Zero-Days (Stack Buffer Overflows) in Danfoss AK-SM800A Refrigeration Controllers (No CVEs Assigned)HIGH
- Cron-Based Persistence on Network Appliances: Evooo1Bot and SSHStalker Linux BotnetsHIGH
- Six Pre-Auth RCE Zero-Days in Danfoss AK-SM800A Refrigeration Controllers (Remote Root); Related Iran-Attributed Attacks on Exposed Danfoss/Copeland Controllers in France and EuropeCRITICAL
- Kaspersky Q3 2026 Mobile Threat Statistics: Mamont/Creduz banker droppers, Triada/Vo1d preinstalled malware, AI-assisted Android fraud, DarkSword iOS exploit kitHIGH
- CTO at NCSC Weekly Summary (week ending July 26, 2026): Cl0p PTC Windchill/FlexPLM exploitation (CVE-2026-12569), SonicWall SMA 1000 zero-days (CVE-2026-15409/CVE-2026-15410), and multi-actor state-linked activityHIGH
- Critical Citrix XenServer Vulnerability (CVE-2026-98432, CVE-2026-102703) Could Let Attackers Take Over Virtualization Hosts Without AuthenticationCRITICAL
- APT29 (Midnight Blizzard) watering holes target iOS and Android devices with n-day exploit chains (DarkSword, AndroSnitch)HIGH
- Cloudflare Q3 2026 DDoS Threat Report: 18.2 Million Network-Layer Attacks (+38% QoQ) Driven by Dysphoria, Evooo1Bot and Booter ServicesMEDIUM
- lz1 LZ77 Decompression Stack Buffer Overflow — Public Exploit PoC with Full ROP Chain to Reverse Shell (STAR Labs Summer Pwnables 2025)MEDIUM
- WatchGuard Fireware OS: 7 Critical Vulnerabilities Allowing Remote Code Execution (CVE-2026-103594, CVE-2026-112710, CVE-2026-112709, CVE-2026-93865, CVE-2026-93857, CVE-2026-93866, CVE-2026-103593)CRITICAL
- Coruna and DarkSword iOS Spyware Delivered via Instagram Ads, Hijacked Expired Ad/Analytics Domains and Compromised PrestaShop Stores (DeadTag)HIGH
- DeadTag campaign: Coruna and DarkSword iPhone exploit kits delivered via expired ad/analytics tags, compromised websites and malicious adsHIGH
- CVE-2026-97631: Code-Execution Flaw in TianoCore EDK II UEFI Firmware (PXE ICMP Error Handlers) Affects Most ServersCRITICAL
- Energy & Utilities Cyber Exposure: Ransomware Loss Concentration (Resilience Report) and July 2026 Internet-Exposed PLC Attacks on US Water Utilities (Rockwell MicroLogix)HIGH
- HPE ArubaOS (AOS-8/AOS-10) Eight Max-Severity RCE and Authentication Bypass Flaws (CVE-2026-79844 to CVE-2026-79851)CRITICAL
- Rapid7 Q3 2026 Threat Landscape: High-Severity Flaws Exploited in 3 Days as The Gentlemen and Qilin Ransomware DominateHIGH
- PHP pre-announces two critical RCE flaws in PHP core (CVE-2026-109618, CVE-2026-109619); emergency patches due 2026-10-21 after embargo leakCRITICAL
- Threats to Vehicle Over-the-Air (OTA) Update Infrastructure, Telematics and Aftermarket Devices (Kaspersky ICS CERT Report)MEDIUM
- Multiple vulnerabilities fixed in IBM Guardium Data Protection 12.0-12.2 (CVE-2026-75875, CVE-2026-80381, +9)CRITICAL
- Coruna and DarkSword iOS Exploit Kits Compromise iPhones via Single Malicious Website (UNC6353, UNC6691, UNC6748, PARS Defense)HIGH
- Evooo1Bot: Multi-Functional Mirai-Based Linux Botnet Exploiting 18 Known CVEs in Internet-Facing DevicesHIGH
- ClingSTUN Linux Backdoor Turns Unpatched IoT Devices Into Proxy Nodes via Public STUN InfrastructureHIGH
Mitigations
- Requirements / Language Selection: 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 / Libraries or Frameworks: 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 / Environment Hardening: 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 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 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.
- Implementation / Input Validation: Assume 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 of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected…
- Architecture and Design: For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.
- Operation, Build and Compilation / Environment Hardening: 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…
- Operation / Environment Hardening: 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].
- Build and Compilation, Operation: Most mitigating technologies at the compiler or OS level to date address only a subset of buffer overflow problems and rarely provide complete protection against even that subset. It is good practice to implement strategies to increase the workload of an attacker, such as leaving the attacker to guess an unknown value that changes every program execution.
- 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, potential mitigations.
Detection methods (MITRE CWE)
- Automated Static Analysis (effectiveness: High): This weakness can often be detected using automated static analysis tools. Many modern tools use data flow analysis or constraint-based techniques to minimize the number of false positives. Automated static analysis generally does not account for environmental considerations when reporting out-of-bounds memory operations. This can make it difficult for users to determine which warnings should be investigated first. For example, an analysis tool might report buffer overflows that originate from…
- Automated Dynamic Analysis: This weakness can be detected using dynamic tools and techniques that interact with the software using large test suites with many diverse inputs, such as fuzz testing (fuzzing), robustness testing, and fault injection. The software's operation may slow down, but it should not become unstable, crash, or generate incorrect results.
- Manual Analysis: Manual analysis can be useful for finding this weakness, but it might not achieve desired code coverage within limited time constraints. This becomes difficult for weaknesses that must be considered for all inputs, since the attack surface can be too large.
- Automated Dynamic Analysis (effectiveness: Moderate): 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].
- Automated Static Analysis - Binary or Bytecode (effectiveness: High): According to SOAR [REF-1479], the following detection techniques may be useful: Highly cost effective: Bytecode Weakness Analysis - including disassembler + source code weakness analysis Binary Weakness Analysis - including disassembler + source code weakness analysis
- Manual Static Analysis - Binary or Bytecode (effectiveness: SOAR Partial): According to SOAR [REF-1479], the following detection techniques may be useful: Cost effective for partial coverage: Binary / Bytecode disassembler - then use manual analysis for vulnerabilities & anomalies
- Dynamic Analysis with Automated Results Interpretation (effectiveness: SOAR Partial): According to SOAR [REF-1479], the following detection techniques may be useful: Cost effective for partial coverage: Web Application Scanner Web Services Scanner Database Scanners
- Dynamic Analysis with Manual Results Interpretation (effectiveness: SOAR Partial): According to SOAR [REF-1479], the following detection techniques may be useful: Cost effective for partial coverage: Fuzz Tester Framework-based Fuzzer
Source: MITRE CWE, detection methods. Threadlinqs detection rules for the threats above are Blue tier and higher.