DashboardopencodePTY workdir approval TOCTOU

PTY workdir approval TOCTOU

Category: gotcha
Confidence: 1.00
ID: 01a08278-5905-7110-b3df-8a60a951ba6f
Project ID: c0425955-02bc-4c17-9af2-b114c00077e7
Cross-project: No
Recalled in other projects: 1
Source session: 07PmcXIbo6QNZwYRV
Created: 2026-09-08 02:32:47
Updated: 2026-09-08 19:22:00

Cross-Project Recalls

ProjectHitsLast recalled
craft 1 8d ago

Content

Trap: resolving or opening cwd after permission approval looks sufficient because spawn still uses the approved pathname, but replacement during approval can change the executed object. Fix: open with O_DIRECTORY|O_NOFOLLOW before approval, retain the descriptor, verify /proc/self/fd/<fd> before and after approval, spawn from that descriptor path, and close it after startup.

Move to: