Skip to content

sec: implement explicit authorization signatures for admin actions - #35

Merged
Queenode merged 2 commits into
Kolo-Org:mainfrom
Ultra-Tech-code:fix-auth-signatures
Aug 26, 2026
Merged

sec: implement explicit authorization signatures for admin actions #35
Queenode merged 2 commits into
Kolo-Org:mainfrom
Ultra-Tech-code:fix-auth-signatures

Conversation

@Ultra-Tech-code

Copy link
Copy Markdown
Contributor

Resolves #20

Description

This PR addresses critical security requirements by enforcing that all admin authorization payloads strictly cover the exact arguments passed to state-modifying actions. This prevents replay attacks or argument spoofing if the contract is used as a cross-contract sub-call, and prepares the contract to be safely managed by multi-sig accounts or other smart contracts.

Changes

  • add_member & remove_member: Refactored to explicitly use admin.require_auth_for_args(...) so the signature specifically covers the target member being added or removed.
  • payout: Updated the function signature to take an expected_recipient argument. The contract asserts this matches the deterministic queue and mandates that the admin payload authorizes payout to this specific recipient.
  • reset_cycle & reset_rotation: Explicitly enforced an empty tuple argument ().into_val(&env) for their authorization payloads to ensure tight scoping.
  • Tests: Updated all calls to payout() with the new signature. Implemented strict mock_auths() payloads and added test_payout_wrong_recipient_auth_fails which ensures a payout fails with Error(Auth, InvalidAction) if an admin signed it for a different recipient.

Testing

All 20 unit tests pass, and the explicit payload validations have been verified with cargo test.

…ixes Kolo-Org#20)

- Replaced admin.require_auth() with admin.require_auth_for_args() in add_member and remove_member
- Refactored payout() to take expected_recipient and verified authorization for the specific recipient
- Enforced strict empty argument payloads for reset_cycle and reset_rotation
- Added test_payout_wrong_recipient_auth_fails to verify strict mock_auths validation
- Updated tests and test snapshots
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 88068180-a074-43be-bb69-f32aa8ddb232


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Queenode

Copy link
Copy Markdown
Contributor

Thank you for your contribution @Ultra-Tech-code

@Queenode
Queenode merged commit ddfee26 into Kolo-Org:main Aug 26, 2026
3 checks passed
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.

[SEC] Implement Authorization Signatures for Admin Actions

2 participants