Join our Newsletter — 33% off our NHI Course

Can predictable runtime paths turn AFW into RCE?

 

(@nhi-mgmt-group)
Member Moderator
Joined: 2 years ago
Posts: 20842
Topic starter  

TL;DR: Predictable runtime paths make arbitrary file writes much more dangerous when the written file is later read by a runtime, worker, or template engine, according to Ethiack. File handling needs to assume that write access can become execution if storage and code paths are not separated.

Editorial analysis by NHI Mgmt Group, based on content published by Ethiack: “Write Once, Shell Everywhere: Turning Arbitrary File Writes into RCE”.

Key questions

Q: Why do filesystem write errors help attackers profile the target?

A: Because different error codes can reveal whether a path exists, whether a component is a file or directory, and whether the attacker can traverse or write there.

Q: What are the signs that a write primitive is close to RCE?

A: Look for deterministic reload behaviour, writable worker or template directories, and files that are re-read by a service without a restart.

Q: What breaks when arbitrary file writes reach reloadable runtime paths?

A: A file write becomes far more dangerous when the target process later reads the file as code or configuration.

Practitioner guidance

  • Separate writable data from executable paths Keep uploads, caches, and runtime scratch spaces outside any directory that a process, worker, or template engine may later execute or reload.
  • Normalise filesystem failure responses Return a generic error for write failures so attackers cannot use errno differences to infer path existence, directory structure, or permission boundaries.
  • Harden container and process startup Run non-root, avoid shell-based entrypoints, and make the root filesystem read-only so common AFW-to-RCE destinations disappear.

Bottom line: Arbitrary file write findings become materially more severe when the written path is later consumed by a runtime, worker, or template engine.

Glossary terms: Arbitrary File Read, Path Traversal, Predictable Runtime Path, Output Sink

Explore further

View Full Forum →  |  NHI Foundation Course →  |  Our Services →  |  Read the full analysis →


This topic was modified 2 weeks ago by NHI Mgmt Group

   
Quote
(@mr-nhi)
Member Moderator
Joined: 7 months ago
Posts: 21330
 

Path predictability is the real control failure: arbitrary file write becomes materially dangerous when the attacker can map a writable path to a later execution path. The vulnerability is not the write alone, but the combination of predictable runtime layout and a process that re-reads files from disk. Practitioners should treat deterministic path resolution as part of the attack surface, not an implementation detail.

A question worth separating out:

Q: Should teams prioritise filesystem hardening over payload filtering for AFW issues?

A: Yes, because payload filtering does not fix the core problem when a writable path is later executed or reloaded. Read-only roots, non-root runtime users, separated data and code paths, and consistent error handling reduce the exploitability of the primitive itself, which is the real control objective.

👉 Read our full editorial: Arbitrary file writes become RCE when runtime paths are predictable



   
ReplyQuote
Share:

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.