Skip to content

fix: add access control to record_payment (CRITICAL)#375

Open
Kandexa wants to merge 1 commit into
bridgelet-org:mainfrom
Kandexa:fix/issue-220-record-payment-access-control
Open

fix: add access control to record_payment (CRITICAL)#375
Kandexa wants to merge 1 commit into
bridgelet-org:mainfrom
Kandexa:fix/issue-220-record-payment-access-control

Conversation

@Kandexa

@Kandexa Kandexa commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

CRITICALrecord_payment previously had zero access control. Any address could call it to record arbitrary payments on any ephemeral account, enabling payment spoofing attacks.

Fix

Added authorized_controller.require_auth() check in record_payment(), restricting the function to only the designated sweep controller.

Changes

  • contracts/ephemeral_account/src/lib.rs: Add controller.require_auth() before payment recording
  • contracts/ephemeral_account/src/test.rs:
    • test_record_payment_rejects_unauthorized_caller — verifies non-controller calls are rejected
    • test_record_payment_accepts_authorized_controller — verifies controller calls succeed

Test Results

cargo test --workspace    -> 65 passed, 0 failed
cargo clippy --workspace  -> clean, no warnings

Closes #220

CRITICAL: record_payment previously had zero access control — any address
could call it to record arbitrary payments on any ephemeral account.

Now requires authorized_controller.require_auth() so only the designated
sweep controller can record payments.

Changes:
- Add authorized_controller auth check in record_payment()
- Add test verifying unauthorized callers are rejected
- Add test verifying authorized controller is accepted

Closes bridgelet-org#220
@drips-wave

drips-wave Bot commented Jul 24, 2026

Copy link
Copy Markdown

@Kandexa 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

@phertyameen

Copy link
Copy Markdown
Contributor

@Kandexa resolve conflict please

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.

[CRITICAL] record_payment has zero access control and zero status check

2 participants