Skip to content

Fix gosec lint failures (G703, G117, G704) #1984

Closed

Description

@TerryHowe

The gosec linter reports 4 issues:

  1. G703 - cmd/oras/internal/display/metadata/tree/discover_test.go:58 - Path traversal via taint analysis on os.Remove(tmp.Name()). The file is created in t.TempDir() which auto-cleans, so the os.Remove call is unnecessary.

  2. G117 - cmd/oras/internal/option/remote.go:70 - Exported struct field Secret matches secret pattern. This is a false positive — it's a CLI option field, not a hardcoded secret.

  3. G704 (x2) - internal/crypto/certificate_test.go:40,56 - SSRF via taint analysis on client.Do(req). False positive — the URL comes from a local httptest.Server in tests.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions