Fix CPI duplicate account privilege escalation (#22752)
* Adds TEST_DUPLICATE_PRIVILEGE_ESCALATION_SIGNER and TEST_DUPLICATE_PRIVILEGE_ESCALATION_WRITABLE. * Moves CPI privilege verification out of deduplication loop.
This commit is contained in:
committed by
GitHub
parent
fa51e5b704
commit
a71f05f86c
@ -1116,6 +1116,18 @@ fn test_program_bpf_invoke_sanity() {
|
||||
&[],
|
||||
);
|
||||
|
||||
do_invoke_failure_test_local(
|
||||
TEST_DUPLICATE_PRIVILEGE_ESCALATION_SIGNER,
|
||||
TransactionError::InstructionError(0, InstructionError::PrivilegeEscalation),
|
||||
&[invoked_program_id.clone()],
|
||||
);
|
||||
|
||||
do_invoke_failure_test_local(
|
||||
TEST_DUPLICATE_PRIVILEGE_ESCALATION_WRITABLE,
|
||||
TransactionError::InstructionError(0, InstructionError::PrivilegeEscalation),
|
||||
&[invoked_program_id.clone()],
|
||||
);
|
||||
|
||||
// Check resulting state
|
||||
|
||||
assert_eq!(43, bank.get_balance(&derived_key1));
|
||||
|
Reference in New Issue
Block a user