Severity: MEDIUM · Tests · boundless-events + boundless-profile
Surfaced by the Almanax scan of e1f17937. Closes Admin tests bypass authorization via mock_all_auths.
Files
contracts/events/src/tests/* admin suites (and the profile equivalents) using env.mock_all_auths() in setup()
Problem
With mock_all_auths(), deleting require_admin() from any privileged entrypoint (apply_upgrade, set_fee_account, pause/unpause, migrate, …) would not fail CI — an access-control regression could ship undetected. This is high leverage: a third-party audit is the P0 blocker in BACKLOG.md, so the auth controls should be proven in the test suite first.
Fix
- For privileged-path tests, use
env.mock_auths(&[...]) with the exact expected (address, fn, args) and/or assert against env.auths().
- Add negative tests: a non-admin caller must receive an auth error for each privileged entrypoint.
Tests
- The new negative tests are the deliverable.
- Existing positive tests stay green under the tighter mocks.
Severity: MEDIUM · Tests ·
boundless-events+boundless-profileSurfaced by the Almanax scan of
e1f17937. ClosesAdmin tests bypass authorization via mock_all_auths.Files
contracts/events/src/tests/*admin suites (and the profile equivalents) usingenv.mock_all_auths()insetup()Problem
With
mock_all_auths(), deletingrequire_admin()from any privileged entrypoint (apply_upgrade,set_fee_account,pause/unpause,migrate, …) would not fail CI — an access-control regression could ship undetected. This is high leverage: a third-party audit is the P0 blocker inBACKLOG.md, so the auth controls should be proven in the test suite first.Fix
env.mock_auths(&[...])with the exact expected(address, fn, args)and/or assert againstenv.auths().Tests