v2.2: Fix - Invoke non program account owned by a builtin (backport of #5158)#5207
Merged
Conversation
LucasSte
previously approved these changes
Mar 10, 2025
3fcf6fa to
98a759a
Compare
|
hold on figuring out where/how to rekey |
* Adds test_invoke_non_program_account_owned_by_a_builtin(). * Throws InstructionError::UnsupportedProgramId when invoking any non loader owned or non built-in account. (cherry picked from commit 9adbffc)
98a759a to
b7f36c7
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v2.2 #5207 +/- ##
=========================================
- Coverage 83.3% 83.3% -0.1%
=========================================
Files 800 800
Lines 370170 370217 +47
=========================================
+ Hits 308493 308509 +16
- Misses 61677 61708 +31 🚀 New features to boost your workflow:
|
|
Can't land this until we switch over the feature set from |
LucasSte
approved these changes
Mar 28, 2025
t-nelson
approved these changes
Mar 28, 2025
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.
Problem
Currently there is a slight bug once
remove_accounts_executable_flag_checksis active:One can invoke a built-in program by invoking any account owned by it instead. This leads to the built-in running as a different pubkey, thus all ownership checks fail and the built-in has no write access to anything.
This is benign as it only allows invoking built-in programs in a strange nonsensical way. But, it is still a stupid thing to support and would hinder future protocol changes such as these in the account loader.
About rekeying: Well see Discord discussion.
Summary of Changes
Blocks the execution of any non loader owned or non built-in account and adds
test_invoke_non_program_account_owned_by_a_builtin()to demonstrate the change in behavior.Feature Gate Issue: https://github.com/anza-xyz/feature-gate-tracker/issues/69
This is an automatic backport of pull request #5158 done by Mergify.