matcha
matcha copied to clipboard
BUG: TOCTOU race in config file operations
Describe the bug Config operations at cli/config.go:34 check file exists with Stat() then use path. File could be deleted between check and use.
To reproduce
- Edit config file
- Delete file between Stat() and exec.Command()
- Editor opens non-existent file or wrong file
Expected behavior Open file directly, handle error. Or use atomic operation.
Matcha version master
OS All
Additional context File: cli/config.go line 34 Classic TOCTOU race condition
This has had no activity for 30 days. It will be closed in 14 days unless updated. Comment or remove the stale label to keep it open.
Closing due to inactivity. Reopen if still relevant.