Join our Newsletter — 33% off our NHI Course
Home› Glossary› Cyber Security› Write-what-where Condition
Cyber Security

Write-what-where Condition

← Back to Glossary
By NHI Mgmt Group Updated October 17, 2026 Domain: Cyber Security

Write-what-where Condition is a flaw that lets an attacker choose both the data written and the memory location written to. It can lead to arbitrary memory corruption, privilege escalation, or code execution when exploited in native software. Prevent it with strict bounds checks, pointer validation, and memory-safe coding practices.

What a write-what-where condition is

A write-what-where condition is a memory-corruption flaw that gives an attacker control over both the value being written and the destination address. In native code, that combination can turn a small parsing or pointer bug into a powerful exploitation primitive.

Because the attacker can direct writes into chosen memory, the bug is often more dangerous than a simple out-of-bounds write. It can alter control data, configuration state, function pointers, or security-sensitive variables depending on the program’s layout and protections.

Why this flaw is dangerous in native software

The core danger is precision. Many memory bugs corrupt data accidentally, but a write-what-where condition can be shaped into a deliberate primitive for changing program behavior. That is why it is frequently associated with privilege escalation and code execution in vulnerable native applications.

In practice, the exploitability depends on what memory can be reached and whether the process exposes useful targets. Strong mitigations such as modern memory protections, control-flow defenses, and hardened allocators can raise the bar, but they do not make the underlying flaw safe.

Secure coding guidance from NIST Cybersecurity Framework 2.0 and NIST SP 800-53 Rev 5 Security and Privacy Controls both reinforce the broader need to reduce software flaw exposure, validate inputs, and maintain system integrity.

How organisations identify exposure

Exposure review starts with knowing where native code is deployed, especially software that parses untrusted input, handles pointers, or integrates with C or C++ components. Code review, static analysis, fuzzing, and dependency assessment all help surface the kinds of conditions that can produce a write-what-where primitive.

Security teams should also look for reachable attack surfaces, such as network-facing services, file parsers, IPC interfaces, and plugins. A flaw that exists but is unreachable is still a problem, but one exposed to untrusted input is much more urgent.

For broader validation and hardening practices, OWASP API Security Top 10 is useful where memory-unsafe backends are exposed through service interfaces, and CIS Benchmarks can help reduce surrounding system exposure through hardened platform configuration.

Remediation and defensive engineering

The best fix is to remove the flaw at the source. That usually means eliminating unsafe memory handling, replacing risky code paths with memory-safe alternatives where possible, and tightening validation around every write that depends on user-controlled data.

Where immediate replacement is not realistic, defensive engineering should focus on reducing reachable targets and limiting the impact of a successful write. Defensive layers such as compiler hardening, segmentation, sandboxing, and least-privilege runtime design can narrow the blast radius, but they are compensating controls rather than cures.

For software supply and build integrity, SLSA helps preserve confidence that the patched binary or library actually came from a controlled build path, while OWASP SAMM supports durable secure-development practices that reduce recurrence.

Detection and post-exploitation review

Detection is difficult because a successful write-what-where condition may look like an ordinary crash until it is weaponised. Teams should review crash telemetry, exception patterns, memory corruption symptoms, and anomalous process behavior after a fix lands, especially if the issue was reachable from untrusted input.

If exploitation is suspected, review whether the process might have had its code pointers, privilege state, or in-memory secrets altered. Memory corruption can be transient, but its effects can persist long enough to support follow-on compromise.

For threat-hunting context, MITRE ATT&CK Enterprise Matrix is helpful for mapping the likely downstream techniques, and NIST SP 800-53 Rev 5 Security and Privacy Controls supports logging and integrity review expectations around vulnerable systems.

Risk and Threat Considerations

A write-what-where condition is dangerous because it gives an attacker a directed memory-write primitive, not just random corruption. That makes exploitation much more reliable than many other memory bugs and can turn a parsing mistake into full process compromise.

Failure mechanism: The attacker steers a write to a chosen address, then uses that control to alter execution flow, privilege state, or sensitive in-memory data.

Impact: Depending on the target, the result can be arbitrary code execution, privilege escalation, security control bypass, or persistent corruption that survives the initial trigger.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

MITRE ATT&CK addresses the attack and risk surface, while NIST CSF 2.0, NIST SP 800-53 Rev 5, OWASP ASVS and OWASP SAMM set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
NIST CSF 2.0PR.IR-01 — Platform SecurityNative memory flaws require hardened runtime and platform protections.
Recommendation — Harden affected systems to limit the blast radius of memory-corruption bugs.
NIST SP 800-53 Rev 5SI-10 — Information Input ValidationWrite-what-where flaws are often enabled by insufficient validation of attacker-controlled input.
SI-7 — Software, Firmware, and Information IntegrityPost-exploit review and integrity checks are central when arbitrary writes may alter code or state.
Recommendation — Validate all attacker-controlled inputs before they influence memory writes. Use integrity checks to detect tampering after suspected exploitation.
OWASP ASVSV15 — Secure Coding and ArchitectureSecure coding practices directly address memory corruption and unsafe write patterns in software.
Recommendation — Design out unsafe memory handling and review code for corruption-prone write paths.
OWASP SAMMImplementation — ImplementationSecure implementation practices reduce memory-safety defects throughout the SDLC.
Recommendation — Embed memory-safety review and defensive coding into development workflows.
MITRE ATT&CKT1068 — Exploitation for Privilege EscalationA write-what-where condition can be used to elevate privileges after exploitation.
Recommendation — Map vulnerable code paths to privilege-escalation detections and response steps.

Practitioner Guidance

Why practitioners should care: Treat this as a high-severity memory-safety issue whenever the vulnerable code can be reached with attacker-controlled input. The same flaw can remain latent for years and then become exploitable when surrounding protections weaken or a new target is discovered.

What to watch for: Prioritise native components that manipulate pointers, offsets, lengths, or object fields without strong validation. If the code base still relies on unsafe memory operations, the odds of a write-what-where primitive rise materially.

Practitioner takeaway: Fix the memory-safety bug itself first, then use hardening and monitoring to reduce the chance that a residual flaw becomes a working exploit.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on October 17, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org