An extraction-time write is a file or directory created while an archive is being unpacked, rather than by a later application action. This distinction matters because it shows the archive handler itself is the abuse point, not a downstream consumer.
What Extraction-Time Write Means
An extraction-time write happens when an archive unpacker creates a file or directory as part of extraction, not because a later application asked for it. That distinction matters because the archive handler itself becomes the abuse point.
Why Extraction-Time Writes Matter
This pattern is important in security review because extraction is a privileged transformation step: it takes attacker-controlled input and turns it into filesystem state. If the unpacker trusts paths, names, metadata, or directory structure too much, the archive can influence where objects are written, what gets overwritten, or which directories are created.
Practitioners care about the timing because a write that occurs during extraction can bypass assumptions that only the application layer creates files. That makes the archive parser, decompressor, or installer logic part of the attack surface, even when the eventual consumer of the files behaves correctly.
How Extraction-Time Writes Become a Security Problem
The core danger is that extraction can convert a seemingly inert archive into filesystem changes before any validation or business logic has a chance to intervene. That is why archive handling defects often show up as path traversal, overwrite, planting of startup files, or unexpected directory creation inside sensitive locations.
In practical terms, the question is not just whether the archive contains malicious content, but whether the extraction process can be steered into writing somewhere unintended. When that happens, the compromise path is the unpacking step itself, not a downstream application bug.
Where to Look for Exposure and Prevention
Exposure review starts with the exact components that unpack archives, including upload handlers, package installers, automation jobs, and container build steps. Review whether extraction happens on attacker-supplied input, whether paths are canonicalized, and whether the unpacker enforces a fixed destination root.
Defensive controls should focus on safe extraction behavior, strict path handling, and filesystem permissions that limit what the extraction process can create or overwrite. The most relevant baseline guidance is in NIST SP 800-190 Container Security for image and runtime handling, and NIST SP 800-53 Rev 5 Security and Privacy Controls for access control, integrity, and configuration discipline around trusted processing.
Risk and Threat Considerations
Extraction-time writes are risky because they let untrusted archive content shape the filesystem before the application has fully validated it. That can lead to overwrite attacks, placement of executable or configuration files, and persistence opportunities if the unpacked content lands in a location the system later trusts.
Failure mechanism: The unpacker accepts attacker-influenced archive paths or metadata and performs a write during extraction without sufficiently constraining the destination or normalizing the path.
Impact: An attacker may create, replace, or stage files in unintended locations, which can enable code execution, configuration tampering, or follow-on compromise.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
NIST SP 800-53 Rev 5 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev 5 | CM-6 — Configuration Settings | Secure extraction depends on controlled system and application configuration. |
| AC-6 — Least Privilege | The unpacker's permissions determine how harmful an extraction-time write can be. | |
| SI-7 — Software, Firmware, and Information Integrity | Unexpected writes during extraction can undermine file integrity expectations. | |
| Recommendation — Restrict archive-handling settings to prevent writes outside approved locations. Run archive extraction with the minimum privileges needed to create files in a bounded workspace. Validate extracted content and detect unauthorized file creation or modification. | ||
| NIST CSF 2.0 | PR.DS-10 — Data in Transit Is Protected | Archive transfer and handling depend on trustworthy delivery before extraction occurs. |
| Recommendation — Protect archive delivery paths so malicious payloads are not introduced before extraction. | ||
Practitioner Guidance
What to watch for: Treat any feature that extracts user-controlled archives as a security-sensitive write path, especially when it runs with elevated permissions or feeds later automation. If the extraction step can create files outside an isolated working directory, it deserves the same scrutiny as a direct write primitive.
Practitioner takeaway: The safest mental model is that archive extraction is not passive parsing, it is a filesystem operation that must be bounded as tightly as any other write.
Related resources from NHI Mgmt Group
- How do security teams know if write-time prevention is working?
- What breaks when you rely on Frida-style TLS key extraction instead of a boot-time shim on Android?
- What happens when an attacker can write files during email attachment extraction?
- How can teams tell whether write-time AI controls are working?
Deepen Your Knowledge
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.
Reviewed and updated by the NHIMG editorial team on October 22, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org