Skip to content

Add executable integrity verification#88

Open
pau101 wants to merge 1 commit intoPlompi:masterfrom
pau101:feature/executable-verification
Open

Add executable integrity verification#88
pau101 wants to merge 1 commit intoPlompi:masterfrom
pau101:feature/executable-verification

Conversation

@pau101
Copy link

@pau101 pau101 commented Mar 8, 2026

In addition to my work from #87 I have some considerations for how external dependencies are handled. The executables downloaded from GitHub releases at runtime are currently not verified after download.

This PR adds integrity verification by computing the SHA256 digest while downloading the asset and comparing it with the digest returned by the GitHub API. If verification fails, the download is rejected. GitHub exposed these digests no long ago:
Releases now expose digests for release assets - GitHub Changelog

This verifies integrity rather than authenticity. Some upstream projects provide stronger authenticity mechanisms (for example yt-dlp publishes GPG-signed checksums), while others rely on signed commits or tags (deno, ffmpeg-static). I will mention the official ffmpeg releases also publish GPG-signed checksum files on their download page, if that were to become relevant.

I've also been experimenting with adding optional GPG verification support, which would require BouncyCastle. A functional prototype implementation is available here: pau101/VinURL@feature/gpg-verification

The prototype currently depends on my local me.paulf:bouncycastle-mc:1.0.0, a library mod that packages BouncyCastle. The intention would be to publish this as a reusable dependency so other mods can make use of it as well. Before introducing that integration here, I was wanting to check out interest from other mods that might benefit from such a shared library.

The current implementation has auto-updates require GPG verification when available, while still allowing initial install and manual updates to fallback to the GitHub digest.

This PR also cleans up the GitHub integration by parsing the releases API response as JSON, adding API version headers, sending a bit more descriptive user agent (more than just default java version), and respecting Minecraft's proxy configuration.

Even without the GPG verification work, this PR still improves security by ensuring downloaded assets are verified against their digests.

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