CWE-123: Write-what-where Condition
Any condition where the attacker has the ability to write an arbitrary value to an arbitrary location, often as the result of a buffer overflow.
Last updated
Overview
CWE-123 (Write-what-where Condition) is a base-level software weakness catalogued by MITRE in the Common Weakness Enumeration (CWE). It describes a recurring type of mistake that can lead to exploitable security vulnerabilities.
Real-world CVEs
58 recorded CVEs are caused by CWE-123 (Write-what-where Condition), including 2 in CISA's KEV (Known Exploited Vulnerabilities) catalog. KEVs are shown first. 19 new CWE-123 CVEs have been recorded so far in 2026 (5 in 2025).
- CVE-2025-22225CISA KEVCritical · CVSS 9.3 · EPSS 64th2025-03-04
- CVE-2026-46300CISA KEV
net: skbuff: preserve shared-frag marker during coalescing
High · CVSS 7.8 · EPSS 97th2026-05-23 - CVE-2024-42479
llama.cpp allows write-what-where in rpc_server::set_tensor
Critical · CVSS 10.0 · EPSS 85th2024-08-12 - CVE-2025-69809Critical · CVSS 9.8 · EPSS 47th2026-03-16
- CVE-2022-38143Critical · CVSS 9.8 · EPSS 75th2022-12-23
- CVE-2021-38441
Eclipse CycloneDDS Write-what-where Condition
Critical · CVSS 9.8 · EPSS 82th2022-05-05 - CVE-2021-38449
AUVESY Versiondog
Critical · CVSS 9.8 · EPSS 70th2021-10-22 - CVE-2020-2001
PAN-OS: Panorama External control of file vulnerability leads to privilege escalation
Critical · CVSS 9.8 · EPSS 72th2020-05-13 - CVE-2014-5435Critical · CVSS 9.8 · EPSS 89th2019-04-08
- CVE-2015-8271Critical · CVSS 9.8 · EPSS 93th2017-04-13
- CVE-2026-94146
BioStar BIOS Update Utility IOCTL BSMEM64_W10.sys sub_110BC write-what-where
Critical · CVSS 9.3 · EPSS 8th2026-09-21 - CVE-2026-94142
BioStar Temperature Monitor Utility IOCTL BS_HWMIO64_W10.sys sub_1105C write-what-where
Critical · CVSS 9.3 · EPSS 8th2026-09-21
Showing 12 of 58 recorded CWE-123 CVEs. Get an alert for each new one, with AI-written analysis and fixes.
Monitor these CVEsCommon consequences
What can happen when CWE-123 is exploited.
Modify Memory, Execute Unauthorized Code or Commands, Gain Privileges or Assume Identity, DoS: Crash, Exit, or Restart, Bypass Protection Mechanism
Affects: Integrity, Confidentiality, Availability, Access Control
Clearly, write-what-where conditions can be used to write data to areas of memory outside the scope of a policy. Also, they almost invariably can be used to execute arbitrary code, which is usually outside the scope of a program's implicit security policy. If the attacker can overwrite a pointer's worth of memory (usually 32 or 64 bits), they can redirect a function pointer to their own malicious code. Even when the attacker can only modify a single byte arbitrary code execution can be possible. Sometimes this is because the same problem can be exploited repeatedly to the same effect. Other times it is because the attacker can overwrite security-critical application-specific data -- such as a flag indicating whether the user is an administrator.
DoS: Crash, Exit, or Restart, Modify Memory
Affects: Integrity, Availability
Many memory accesses can lead to program termination, such as when writing to addresses that are invalid for the current process.
Bypass Protection Mechanism, Other
Affects: Access Control, Other
When the consequence is arbitrary code execution, this can often be used to subvert any other security service.
How it happens
When it is introduced
Typically introduced during these phases of the software lifecycle.
Applies to
Languages
How to prevent it
Practical mitigations for CWE-123, grouped by where in the lifecycle they apply.
Use a language that provides appropriate memory abstractions.
Use OS-level preventative functionality integrated after the fact. Not a complete solution.
How to detect it
Automated Static Analysis
Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
Effectiveness: High
Automated Dynamic Analysis
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++ [3].
Effectiveness: Moderate
Code examples
MITRE examples of the weakness in code.
The classic example of a write-what-where condition occurs when the accounting information for memory allocations is overwritten in a particular fashion. Here is an example of potentially vulnerable code:
Vulnerable example
#define BUFSIZE 256
char *buf1 = (char *) malloc(BUFSIZE);Illustrative examples
Real CVEs that MITRE cites as examples of this weakness.
- CVE-2019-19911 — Chain: Python library does not limit the resources used to process images that specify a very large number of bands (CWE-1284), leading to excessive memory consumption (CWE-789) or an integer overflow (CWE-190).
- CVE-2022-0545 — Chain: 3D renderer has an integer overflow (CWE-190) leading to write-what-where condition (CWE-123) using a crafted image.
Terminology & mappings
Mapped taxonomies
- CLASP: Write-what-where condition
- CERT C Secure Coding: Do not form or use out-of-bounds pointers or array subscripts (ARR30-C) — Imprecise fit
- CERT C Secure Coding: Guarantee that library functions do not form invalid pointers (ARR38-C) — Imprecise fit
- CERT C Secure Coding: Guarantee that storage for strings has sufficient space for character data and the null terminator (STR31-C) — Imprecise fit
- CERT C Secure Coding: Do not pass a non-null-terminated character sequence to a library function that expects a string (STR32-C) — Imprecise fit
- Software Fault Patterns: Faulty Buffer Access (SFP8)
Frequently asked questions
Common questions about CWE-123.
- What is CWE-123?
- Any condition where the attacker has the ability to write an arbitrary value to an arbitrary location, often as the result of a buffer overflow.
- What CVEs are caused by CWE-123?
- 58 recorded CVEs are attributed to CWE-123, including CVE-2025-22225, CVE-2026-46300 and CVE-2024-42479. 2 are listed in CISA's Known Exploited Vulnerabilities (KEV) catalog.
- How do you prevent CWE-123?
- Use a language that provides appropriate memory abstractions.
- How is CWE-123 detected?
- Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
- What are the consequences of CWE-123?
- Exploiting CWE-123 can lead to: Modify Memory, Execute Unauthorized Code or Commands, Gain Privileges or Assume Identity, DoS: Crash, Exit, or Restart, Bypass Protection Mechanism, Other.
- Is CWE-123 actively exploited?
- Yes. 2 CWE-123 vulnerabilities are in CISA's KEV catalog of actively exploited flaws, out of 58 recorded CVEs.
Sources
- [1]24 Deadly Sins of Software Security (2010)
- [2]The CLASP Application Security Process (2005)
- [3]AddressSanitizer
References
- MITRE CWE definition (CWE-123) (opens in a new tab)
- CWE-123 vulnerabilities on NVD (opens in a new tab)
- Learn: What is a CWE?
Weakness data is sourced from the MITRE CWE catalog (v4.20). CVE associations are aggregated and kept current by RadicalNotion.AI.
Track CWE-123 CVEs
Get an alert when a new CWE-123 CVE affects your products, with AI-written analysis and remediation steps.