Skip to content

fix: audit all require_auth() call sites vs. require_auth_for_args - #160

Open
blessedDev-xyz wants to merge 1 commit into
stellar-vortex-protocol:mainfrom
blessedDev-xyz:docs/require-auth-audit
Open

fix: audit all require_auth() call sites vs. require_auth_for_args#160
blessedDev-xyz wants to merge 1 commit into
stellar-vortex-protocol:mainfrom
blessedDev-xyz:docs/require-auth-audit

Conversation

@blessedDev-xyz

Copy link
Copy Markdown

Summary

Audited all 12 require_auth() call sites in intent_settlement/src/lib.rs against Soroban SDK docs on require_auth vs require_auth_for_args.

Findings

Conclusion: require_auth() is correct at every current call site. No call sites were changed.

The contract never uses a delegated-invocation pattern — every require_auth() is called on the address that is itself the signing principal (the tx signer). require_auth_for_args is the right tool when an intermediary contract invokes on behalf of a user with scoped argument constraints; that pattern does not exist here.

Call sites reviewed

Function Principal Assessment
initialize admin ✅ correct — proves ownership of the admin address being stored
set_fee_recipient admin ✅ correct — admin-only, no sub-scope meaningful
transfer_admin (current) admin ✅ correct
transfer_admin (new) new_admin ✅ correct — dual-sign prevents typo'd takeover
register_solver solver ✅ correct — solver consents to bond lock
deregister_solver solver ✅ correct
withdraw_bond solver ✅ correct
submit_intent user ✅ correct — noted as future require_auth_for_args candidate if composable submission added
accept_intent solver ✅ correct — noted as future hardening candidate (intent_id scope)
fill_intent solver ✅ correct — strongest future candidate: solver authorises a token transfer; scoping to (solver, intent_id, fill_amount) would tighten delegated execution risk
cancel_intent user ✅ correct — additional ownership check follows
require_admin helper admin ✅ correct — uniform admin authority

Changes

Inline audit comments added at each of the 12 call sites in lib.rs. No logic changes.

Validation

cargo fmt, cargo clippy -- -D warnings, cargo test — 55 tests pass, 0 fail.

Closes #45

…s require_auth_for_args

Reviewed all 12 require_auth() call sites across initialize, set_fee_recipient,
transfer_admin, register_solver, deregister_solver, withdraw_bond, submit_intent,
accept_intent, fill_intent, cancel_intent, and require_admin helper.

Conclusion: plain require_auth() is correct in all current cases. Every call is
made on the address that IS the signing principal (no wrapper-contract delegation
pattern exists today). Added inline audit comments at each call site documenting:
- why require_auth() is sufficient for the current usage
- where require_auth_for_args would reduce risk if delegated invocation is
  introduced in future (accept_intent and fill_intent are the strongest candidates)

No call sites were changed — the audit found no security regression.

Closes stellar-vortex-protocol#45
@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@blessedDev-xyz Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Audit all require_auth() call sites for correctness vs. Soroban's require_auth_for_args

2 participants