Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-dlppublishes 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.