fix: verify content checksum before trusting pack signature#17
Open
muhamedfazalps wants to merge 1 commit into
Open
fix: verify content checksum before trusting pack signature#17muhamedfazalps wants to merge 1 commit into
muhamedfazalps wants to merge 1 commit into
Conversation
…hay-codes07#9) verify_pack_signature() trusted the manifest's self-reported checksum and never recomputed content_checksum(pack.items). An attacker could swap pack.items for a malicious payload while leaving manifest.checksum untouched, and the signature would still verify. Now verifies that content_checksum(pack.items) matches manifest.checksum before trusting the signature, closing the bypass window.
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.
Fixes #9
Problem
verify_pack_signature()trusted the manifest's self-reportedchecksumfield and never recomputedcontent_checksum(pack.items). An attacker could:pack.itemsfor a malicious payloadmanifest.checksumuntouchedThe
volo pack verifycommand callsverify_pack_signaturewithoutvalidate_pack, so it prints-> VALIDon a swapped-payload pack.Solution
Before verifying the signature, recompute
content_checksum(pack.items)and reject the pack if it doesn't matchmanifest.checksum. This ensures the signature is bound to actual content, not just the self-reported checksum.Changes
packages/volo-packs/src/volo_packs/signing.py: Added content checksum verification inverify_pack_signature()packages/volo-packs/src/volo_packs/signing.py: Importedcontent_checksumfrom pack moduleSecurity Impact
This is a security fix — pack signature verification was bypassable by swapping content while keeping the manifest checksum unchanged.
https://buymeacoffee.com/muhamedfazalps