matcha icon indicating copy to clipboard operation
matcha copied to clipboard

BUG: TOCTOU race in config file operations

Open andrinoff opened this issue 7 months ago • 2 comments

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

  1. Edit config file
  2. Delete file between Stat() and exec.Command()
  3. 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

andrinoff avatar Apr 21 '26 14:04 andrinoff

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.

floatpanebot avatar May 22 '26 06:05 floatpanebot

Closing due to inactivity. Reopen if still relevant.

floatpanebot avatar Jun 04 '26 19:06 floatpanebot