internal/secret/helpers.go:50 falls back to os.UserHomeDir() when os.UserConfigDir() fails, but discards the error with _ =. If both calls fail, homeDir is empty string, producing a path like /.config/berlin.sneak.secret which is a root-level directory.
Impact
On systems where neither config dir nor home dir is available (containers, restricted users), the tool would attempt to write to the root filesystem.
Fix
Return an error when both os.UserConfigDir() and os.UserHomeDir() fail.
Location
internal/secret/helpers.go line 50
## Summary
`internal/secret/helpers.go:50` falls back to `os.UserHomeDir()` when `os.UserConfigDir()` fails, but discards the error with `_ =`. If both calls fail, `homeDir` is empty string, producing a path like `/.config/berlin.sneak.secret` which is a root-level directory.
## Impact
On systems where neither config dir nor home dir is available (containers, restricted users), the tool would attempt to write to the root filesystem.
## Fix
Return an error when both `os.UserConfigDir()` and `os.UserHomeDir()` fail.
## Location
`internal/secret/helpers.go` line 50
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
internal/secret/helpers.go:50falls back toos.UserHomeDir()whenos.UserConfigDir()fails, but discards the error with_ =. If both calls fail,homeDiris empty string, producing a path like/.config/berlin.sneak.secretwhich is a root-level directory.Impact
On systems where neither config dir nor home dir is available (containers, restricted users), the tool would attempt to write to the root filesystem.
Fix
Return an error when both
os.UserConfigDir()andos.UserHomeDir()fail.Location
internal/secret/helpers.goline 50Fix submitted in PR #18.