Open
Conversation
Validate AccountType discriminator at byte 165 for accounts larger than 165 bytes to prevent type confusion between Mint and Account types. - Add ACCOUNT_TYPE_OFFSET, ACCOUNT_TYPE_MINT, ACCOUNT_TYPE_TOKEN_ACCOUNT constants - Add ACCOUNT_TYPE const to Transmutable trait - Check byte[165] in load_unchecked and load_mut_unchecked when size > 165 - Account uses ACCOUNT_TYPE = 2, Mint uses ACCOUNT_TYPE = 1
Document signer_is_validated parameter, AccountType validation, library conversion, and note that multisig is not supported.
Return NativeNotSupported error for native account transfers. Lamport transfer logic commented out for reference.
…ctions Fixes vulnerability where Token account (165 bytes) could be loaded as Mint (82 bytes) because AccountType check was only performed for extended accounts (>165 bytes). Now accepts only: - Exact length match (bytes.len() == T::LEN) for standard accounts - Extended accounts (>165 bytes) with matching AccountType discriminator Adds unit tests covering all validation scenarios.
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.
No description provided.