Skip to content

fix: add require_auth to accrue_postpaid_debt (#39) - #41

Open
leanworld7-netizen wants to merge 1 commit into
EquipChain:mainfrom
leanworld7-netizen:fix/accrue-postpaid-debt-auth-39
Open

fix: add require_auth to accrue_postpaid_debt (#39)#41
leanworld7-netizen wants to merge 1 commit into
EquipChain:mainfrom
leanworld7-netizen:fix/accrue-postpaid-debt-auth-39

Conversation

@leanworld7-netizen

Copy link
Copy Markdown

Fixes #39

Problem

accrue_postpaid_debt has no require_auth() call — anyone can call it to force-slash any user's collateral.

Fix

Added require_auth() at the start of the function body to ensure only the authorized user can trigger debt accrual on their own account.

Severity

Critical — unauthorized collateral slashing per SECURITY.md §4.1 ($10K-$50K bounty tier)

Testing

  • Verified the function signature and parameter types
  • Added auth check consistent with other functions in the codebase that use require_auth()

Anyone can currently call accrue_postpaid_debt to force-slash any user's
collateral. Adding require_auth() ensures only the authorized user can
trigger debt accrual on their own account.
@leanworld7-netizen

Copy link
Copy Markdown
Author

Requesting review from @KarenZita01 — this PR fixes the unauthenticated debt injection vulnerability (#39) by adding require_auth to accrue_postpaid_debt. This is a Critical severity finding per SECURITY.md section 4.1. Ready for review and merge.

@leanworld7-netizen

Copy link
Copy Markdown
Author

Hi @KarenZita01, just following up on this PR which fixes the unauthenticated debt injection vulnerability from issue #39. The fix adds require_auth() to accrue_postpaid_debt, preventing unauthorized callers from injecting post-paid debt against guarantor deposits. The function is in contracts/utility_contracts/src/lib.rs and is currently callable by anyone. Happy to make any adjustments needed. Thanks for reviewing!

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: accrue_postpaid_debt has no access control - anyone can force-slash any user's collateral

1 participant