Skip to content

Deny unknown/unscorable versions instead of crashing#12

Merged
hammadtq merged 1 commit intomainfrom
fix/deny-unknown-versions
Apr 2, 2026
Merged

Deny unknown/unscorable versions instead of crashing#12
hammadtq merged 1 commit intomainfrom
fix/deny-unknown-versions

Conversation

@hammadtq
Copy link
Copy Markdown
Collaborator

@hammadtq hammadtq commented Apr 2, 2026

Summary

When a pinned version cannot be scored (404 from Socket API — e.g. unpublished malware), the binary crashed with a fatal error instead of denying. Now it returns a deny decision.

Before

npm install axios@0.14.1 -> error: evaluating axios: API returned status 404

After

npm install axios@0.14.1 -> deny: could not score axios@0.14.1

Test plan

  • go vet and go test pass
  • Non-existent version (0.14.1) -> deny
  • Compromised version (1.14.1) -> deny (score 40)
  • Safe version (axios unpinned) -> allow (v1.14.0, score 71)

Generated with Claude Code

When GetPackageScore returns an error (e.g. 404 for a non-existent or
unpublished version), return a deny result instead of propagating the
error as a fatal crash. Fail closed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@hammadtq hammadtq merged commit 880c498 into main Apr 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant