Skip to content

Verify checksum and limit decompressed size in grypedb Download#19

Merged
andrew merged 2 commits into
mainfrom
fix/grypedb-checksum-limit
May 2, 2026
Merged

Verify checksum and limit decompressed size in grypedb Download#19
andrew merged 2 commits into
mainfrom
fix/grypedb-checksum-limit

Conversation

@andrew
Copy link
Copy Markdown
Contributor

@andrew andrew commented May 2, 2026

The grype database listing includes a `sha256` checksum for each archive but `Download` was not verifying it. Also caps decompressed output at 2 GB via `io.LimitReader` to prevent unbounded disk writes from a tampered archive.

Extracts `downloadFrom` to accept the listing URL, making the function testable without hitting the real CDN.

andrew added 2 commits May 2, 2026 12:18
The listing provides a sha256 checksum for each database archive but it
was not verified after download. Also wraps the gzip reader in
io.LimitReader (2 GB) to bound decompressed output.
@andrew andrew merged commit 4e46498 into main May 2, 2026
2 checks passed
@andrew andrew deleted the fix/grypedb-checksum-limit branch May 2, 2026 16:26
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