Replace unsigned signed_metadata with metadata + SHA-256 asset binding#39
Draft
Replace unsigned signed_metadata with metadata + SHA-256 asset binding#39
signed_metadata with metadata + SHA-256 asset binding#39Conversation
… asset hash Co-authored-by: numbers-official <181934381+numbers-official@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [Security][High] Fix unsigned provenance metadata issue
Replace unsigned Mar 15, 2026
signed_metadata with metadata + SHA-256 asset binding
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.
createSignedMetadataproduced plain JSON with no cryptographic operations, yet named the FormData fieldsigned_metadata— a false integrity signal to API consumers and blockchain indexers.Changes
createSignedMetadata→createMetadataand FormData fieldsigned_metadata→metadatato eliminate the misleading "signed" labelcomputeSha256(blob)usingcrypto.subtle.digest('SHA-256', ...)(Web Crypto API, no new dependencies)asset_sha256in the metadata JSON, enabling the server to verify image↔metadata correspondence{ "asset_sha256": "e3b0c44298fc1c149afb....", "created_at": 1741827758707, "recorder": "ProofSnap Browser Extension", "spec_version": "2.0.0", "web_source_title": "Example Domain", "web_source_url": "https://example.com" }The blob is already materialized in
prepareUploadFormData(forasset_file), so the hash computation reuses it with no extra I/O.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.