Dashboardinstitutional-transition-labgovernance CLI output TOCTOU

governance CLI output TOCTOU

Category: gotcha
Confidence: 1.00
ID: 01a0843e-bb3b-72d9-9f46-0e7298e166e5
Project ID: 1fa3712f-997f-4884-b7ec-8abb79f9e342
Cross-project: No
Recalled in other projects: 0
Source session: 0yGAnpNlrOvBQqxq2
Created: 2026-09-09 00:46:37
Updated: 2026-09-09 03:38:18

Content

Trap: one-time samefile()/resolved-path checks look sufficient because they reject stable direct, symlink, and hard-link aliases, but a mutable parent symlink can be retargeted before mkstemp() or os.replace(), overwriting an authenticated input or aliasing both outputs. Fix: bind and validate output parent directory descriptors through temporary creation and rename, then reject any changed path/inode identity before publication.

Move to: