Skip to content

Admin tests bypass authorization via mock_all_auths (auth regressions invisible to CI) #73

Description

@0xdevcollins

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions