Skip to content

Vault: fix set_authorized_caller to authenticate the calling owner, not just require its signature implicitly #355

@greatest0fallt1me

Description

@greatest0fallt1me

Description

CalloraVault::set_authorized_caller reads meta.owner and calls meta.owner.require_auth() but takes no caller parameter and performs no caller == owner check, diverging from every other privileged function which takes an explicit caller. This inconsistent pattern makes auditing harder and the API surface inconsistent. Align it with the rest of the contract.

Requirements and Context

  • Add an explicit caller: Address parameter, caller.require_auth(), and assert caller == meta.owner.
  • Keep emitting set_authorized_caller with (old, new) data.
  • Validate new_caller is not the vault address (consistent with init).
  • Must be secure, tested, and documented
  • Should be efficient and easy to review

Suggested Execution

  1. Fork the repo and create a branch
    git checkout -b bug/vault-set-authorized-caller-auth
  2. Implement changes
    • contracts/vault/src/lib.rs — explicit caller + self-address guard
    • docs/interfaces/vault.json — update signature
  3. Test and commit
    • cargo test -p callora-vault
    • Test non-owner caller reverts; self-address rejected
    • Include test output and notes in the PR

Example commit message

fix: require explicit owner caller in set_authorized_caller

Acceptance Criteria

  • Explicit caller parameter with owner check
  • Self-address new_caller rejected
  • Event payload unchanged
  • Tests cover unauthorized and self-address cases

Guidelines

  • .rs under contracts/vault/src/, cargo test, /// docs, minimum 95% line coverage, no unwrap() in prod paths
  • Clear documentation and inline comments
  • Timeframe: 96 hours

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programauditSecurity audit/reviewsecuritySecurity hardeningsmart-contractSoroban smart-contract work

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions