rickub/clipublic Fork
⑂ 89ad491
Commits
⬇ Clone ▾
git clone https://git.rickub.com/rickub/cli.git
git clone ssh://git@rickub.com/rickub/cli.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP

security: annotate the stamp read as CLI-owned, satisfying gosec G304Unverified

The stamp path is config.Path plus a sanitized host key - the same
class as the config-file read in internal/config, which carries the
same annotation for the same reason.
Olivier Girardot committed 2026-10-11T19:21:47+02:00 Browse files
89ad491 parent: b4bb81e
modified cmd/update_check.go +3 -0
@@ -276,6 +276,9 @@ func updateStampPath(host string) (string, error) {
276276 // interval. A missing or unreadable stamp is stale (check again); a future
277277 // stamp (clock moved back) is treated as fresh so it cannot pinball the probe.
278278 func stampIsFresh(path string) bool {
279+ // #nosec G304 -- path is the CLI's own stamp under the config directory
280+ // (config.Path + a sanitized host key), the same class as the config read
281+ // in internal/config; it is never assembled from request or command input.
279282 data, err := os.ReadFile(path)
280283 if err != nil {
281284 return false
@@ -276,6 +276,9 @@ func updateStampPath(host string) (string, error) {
276 // interval. A missing or unreadable stamp is stale (check again); a future276 // interval. A missing or unreadable stamp is stale (check again); a future
277 // stamp (clock moved back) is treated as fresh so it cannot pinball the probe.277 // stamp (clock moved back) is treated as fresh so it cannot pinball the probe.
278 func stampIsFresh(path string) bool {278 func stampIsFresh(path string) bool {
279+ // #nosec G304 -- path is the CLI's own stamp under the config directory
280+ // (config.Path + a sanitized host key), the same class as the config read
281+ // in internal/config; it is never assembled from request or command input.
279 data, err := os.ReadFile(path)282 data, err := os.ReadFile(path)
280 if err != nil {283 if err != nil {
281 return false284 return false