Audit: missing user warnings for anomalous conditions #19
Labels
No Label
merge-ready
merge-ready
needs-checks
needs-checks
needs-rebase
needs-rebase
needs-review
needs-review
needs-rework
needs-rework
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sneak/secret#19
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Following the addition of
secret.Warn()in PR #17, this audit identifies all places where anomalous conditions are silently swallowed or only logged viaDebug()when the user should be warned.Findings
1.
internal/secret/helpers.go:DetermineStateDir()— silent config dir fallbackWhen
os.UserConfigDir()fails, the code silently falls back to~/.config. The user has no idea their config dir resolution failed.2.
internal/cli/info_helper.go:gatherVaultStats()— silent skips on read errorsLines 30, 45: errors reading secrets dir and versions dir are silently
continued. If vault data is corrupt or unreadable, the user gets incomplete stats with no indication.3.
internal/cli/unlockers.go:UnlockersList()— silent skips with FIXME commentsLines 273, 280, 295, 301: Multiple
continuestatements skip unlockers when vault dir, file listing, metadata read, or metadata parse fails. Two are marked// FIXME this error needs to be handled. User sees incomplete unlocker list with no warning.4.
internal/cli/unlockers.go:checkUnlockerExists()— silent skipsLines 607, 621, 626: errors reading/parsing unlocker metadata are silently
continued during duplicate checking.5.
internal/cli/completions.go:getUnlockerIDsCompletionFunc()— silent skipsLines 73, 87, 92: errors reading unlocker dirs and metadata silently
continued during tab completion.6.
internal/cli/version.go:ListVersions()— Debug instead of Warn on metadata load failureLine 167: When version metadata fails to load, only
Debug()is called. The user sees an "error" status in the table but no explanation of what went wrong.7.
internal/cli/secrets.go— Debug instead of Warn on file close errorLine 510:
Failed to close fileonly logged viaDebug(). File close errors can indicate data loss.8.
internal/secret/version.go:GenerateVersionName()— silent skip on malformed version dirLine 104: When a version directory name cannot be parsed (malformed serial), it is silently skipped. This could mask filesystem corruption.
9.
internal/cli/unlockers.go:UnlockersList()— fallback ID generation without warningLine 325: When an unlocker instance cannot be created, a fallback ID is generated silently. User sees a potentially wrong ID.
All of these should use
secret.Warn()to inform the user something unexpected happened.