Skip to content

Audit Fixes 3: Concurrent admin_execute calls may lead to unexpected behavior #549

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions framework/contracts/account/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ pub enum AccountError {
#[error("The caller ({caller}) is not the owner account's account ({account}). Only account can create sub-accounts for itself.", )]
SubAccountCreatorNotAccount { caller: String, account: String },

#[error("You can't chain admin calls")]
CantChainAdminCalls {},

#[error("Abstract Account Address don't match to the Contract address")]
AbsAccInvalidAddr {
abstract_account: String,
Expand Down
3 changes: 3 additions & 0 deletions framework/contracts/account/src/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@
) -> AccountResult {
ownership::assert_nested_owner(deps.storage, &deps.querier, &info.sender)?;

if CALLING_TO_AS_ADMIN.exists(deps.storage) {
return Err(AccountError::CantChainAdminCalls {});

Check warning on line 96 in framework/contracts/account/src/execution.rs

View check run for this annotation

Codecov / codecov/patch

framework/contracts/account/src/execution.rs#L96

Added line #L96 was not covered by tests
}
CALLING_TO_AS_ADMIN.save(deps.storage, &addr)?;

let msg = SubMsg::reply_on_success(
Expand Down
Loading