Breaking the Sandbox Boundary: Writing to Replit’s External Supervisor Config From Unprivileged…
An unprivileged user inside a Replit sandbox could write to a supervisor-owned configuration file located outside the sandbox. The author proved via inotify that the external supervisor actively watched this file, meaning sandboxed code could modify supervisor behaviour in real time.
A sandboxed process could write to a supervisor-owned config file and Linux’s inotify revealed the system was watching it live. Every write triggered a kernel-level notification to a higher-privileged process outside the sandbox.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the supervisor's configuration file under /run/replit/pid1/ was created with permissions that allowed the unprivileged runner user to write to it, instead of being restricted to the supervisor.
Impact
Sandboxed code could modify supervisor configuration, but the exposed flags were dormant and not security-relevant, so no direct exploit was demonstrated.
What the attacker needed
Code execution inside a Replit sandbox
The fix
Writing to files under /run/replit should be restricted inside the sandbox.
How it was found
- Locate the supervisor configuration file under /run/replit/pid1/ and check its permissions.
- Find the supervisor process (pid1) and list its open file descriptors to spot inotify instances.
- Read the fdinfo for each inotify descriptor to decode the watch mask and inode.
- Cross-reference the watched inode with the configuration file's inode to confirm it is being watched.
- Modify a flag in the configuration file and write it back, then verify the change persisted.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A sandbox is a restricted environment where your code runs, kept separate from the system that manages it. Here, a file that controls the manager (the supervisor) was writable from inside the sandbox, so code could change settings it should never reach. The author used a Linux feature called inotify, which lets a process watch files for changes, to show the supervisor was actively monitoring that file.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.