Write Once, Shell Everywhere Turning Arbitrary File Writes into RCE
Where
Bug Bounty Village
DEF CON 34
Duration
24 min
Shows how to turn a black-box arbitrary file write into remote code execution by fingerprinting the runtime and overwriting predictable framework files.
Summary
Arbitrary file write bugs are often rated medium because proving real impact is hard when a tester cannot drop a web shell or overwrite an obvious configuration file. The talk targets that gap for black-box testing. It treats the write primitive as fully controlled and asks two questions: where to write, and what to write to reach code execution.
The method starts with the write result itself. Failed writes reveal whether a path exists, whether it is a directory, and whether the writer has permission. Differences in status codes or error handling can expose this even when no error message is returned. Probing paths that are specific to each Linux distribution or language version builds a profile of the target. The speakers recommend benign probes only, since production traffic may be logged or blocked by a WAF. They then covered several concrete routes. A Bash entry point in a containerized job can be overwritten through a file descriptor that points at the running script, padded with no-op bytes so the shell reaches the injected command. In Ruby on Rails, a schema cache file that is loaded with unsafe YAML deserialization leads to a gadget chain that ends in code execution. In Node.js, worker modules in libraries such as Piscina read their worker file from disk each time a worker spawns, so overwriting that predictable path runs attacker code.
The practical takeaway is to identify the execution context before rating a file write, since the runtime often determines which targets exist. Testers should check framework-known and deterministic paths, watch for files that are loaded as code or cache, and use quiet probes on live systems.
Materials
Related talks
Bug Bounty Village·23 min
Samantha Pearlstein
Shows how a team building AI agents to test API business logic learned from its early failures, covering harness design and how to validate flaws.
Bug Bounty Village·21 min
Glendon Chong
Walks through three TikTok bug bounty reports where web cache poisoning on an OAuth login endpoint led to account takeovers.
Bug Bounty Village·24 min
Alex Brumen
Explains how attacker-influenced cache key components cause collisions that poison responses in Nginx-based caching setups.


