fix: preserve NFT token IDs in Blockaid scan previews#8027
Open
clarion-by-cantina[bot] wants to merge 1 commit into
Open
fix: preserve NFT token IDs in Blockaid scan previews#8027clarion-by-cantina[bot] wants to merge 1 commit into
clarion-by-cantina[bot] wants to merge 1 commit into
Conversation
The Blockaid scan parser dropped ERC721/ERC1155 token_id and summary fields when building TransactionAsset objects, causing the approval UI to display only collection-level metadata (e.g. "Bored Ape Yacht Club") instead of specific token identifiers (e.g. "BAYC #8817"). This allowed a malicious dapp to obtain approval for a specific high-value NFT while showing the user only a generic collection label. Changes: - Add tokenId and summary fields to TransactionAsset interface - Populate tokenId/summary from Blockaid amount objects in both parseSendingAssets and parseReceivingAssets for ERC721/ERC1155 types - Update formatAmountWithLocale to render token-specific labels, preferring Blockaid summary, then symbol/name + tokenId - Add test coverage for ERC721 and ERC1155 token ID parsing Co-Authored-By: Clarion <noreply@clarion.sh>
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.
Summary
The Blockaid-backed approval flow for
eth_sendTransactionandwallet_sendCallsdropped ERC721/ERC1155 token-specific identifiers (token_id,summary) from simulated asset transfers before rendering the approval UI. This caused the preview to collapse a specific token like "BAYC #8817" into a generic collection row like "Bored Ape Yacht Club", while the signed calldata still contained the attacker-chosentokenId.A malicious dapp could exploit this to obtain user approval for transferring a specific high-value NFT while showing only collection-level metadata in the approval surface.
Changes
TransactionAssetinterface — added optionaltokenIdandsummaryfieldsparseSendingAssets/parseReceivingAssets— populatetokenId/summaryfrom Blockaid amount objects when asset type isERC721orERC1155formatAmountWithLocale— updated to render token-specific labels, preferring Blockaidsummary, thensymbol/name+#tokenId, with ERC1155 quantity supportAffected paths
eth_sendTransactionscanned previewwallet_sendCallsscanned previewFinding reference
View in Clarion