You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] initialize is front-runnable in tholos v1 #158
initialize (contracts/tholos/src/lib.rs:247-299) takes admin as a caller-supplied parameter and guards only against a second call (if env.storage().instance().has(&DataKey::Admin) { return Err(Error::AlreadyInitialized); }). Nothing ties the call to the address that deployed the contract.
On Soroban, deployment and initialization are separate transactions. Anyone observing the deploy transaction can submit their own initialize call, with their own admin address, ahead of the legitimate deployer's intended call. Whoever's initialize transaction lands first becomes the permanent admin of that contract instance, since AlreadyInitialized then blocks every subsequent attempt, including the legitimate deployer's own.
Impact: a contract instance can be permanently taken over by an unrelated party before its intended operator ever gets to configure it, with no recovery path (see the separate admin-rotation issues, #128/#129, for that gap too).
Scope
Add protection against a front-run initialize: options include restricting the caller to the contract's actual deployer, or an atomic constructor pattern that ties initialization to the deploy transaction itself.
Add a test confirming initialize can no longer succeed for a caller distinct from the legitimate deployer.
Proposed approach
Whatever mechanism is chosen here should also be applied to contracts/tholos-v2's equivalent (#154) for consistency between the two contracts.
@odiliflash-ops Second check-in, still no word since the first. If we don't hear back or see a PR within 24 hours, we'll unassign this and open it up to someone else.
Activity
odiliflash-ops commentedon Sep 3, 2026
I would love to work on this issue
aojomo commentedon Sep 3, 2026
Hi Maintainer, Please I would like to work on this issue
grantfox-oss commentedon Sep 4, 2026
🦊 GrantFox — @odiliflash-ops has been assigned to this issue!
Next steps:
Closes #158)Good luck! Track your progress on GrantFox.
collinsezedike commentedon Sep 7, 2026
@odiliflash-ops Checking in, any progress on this? Let us know if you're still working it or need to hand it off.
collinsezedike commentedon Sep 10, 2026
@odiliflash-ops Second check-in, still no word since the first. If we don't hear back or see a PR within 24 hours, we'll unassign this and open it up to someone else.
collinsezedike commentedon Sep 11, 2026
@odiliflash-ops Unassigning after no response past the 24-hour window from the last check-in. Fixed directly in #214.