You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cosign CLI wrapper uses temp files and exec without input validation #106
Description: shared/shieldx-common/pkg/policy/cosigncli.go writes digest/sig into temporary files and shells out to cosign. If the cosign binary path is attacker-controlled or PATH manipulated, this can lead to arbitrary command execution or use of a malicious cosign. Temp files are created in default temp dir and removed, but race conditions or broad perms may allow attackers to interfere.
Location: shared/shieldx-common/pkg/policy/cosigncli.go (functions Sign, Verify).
Recommendation: Validate c.Path (absolute path whitelist) or use a bundled cosign binary with fixed path. Use open file descriptors with secure permissions (0600) and avoid exposing predictable temp names. Where possible, replace exec-of-external-binary with in-process verification library (go-containerregistry/cosign). Add CI checks for PATH injection scenarios.
Done when: Cosign invocation uses an audited path or in-process library; temp files are created with secure perms and path collision/test cases are added.
Activity