Skip to content

feat: detect weak role hierarchies in Soroban contracts#452

Open
Joeloo1 wants to merge 1 commit into
MDTechLabs:mainfrom
drips-projects:Detect-Weak-Role-Hierarchies
Open

feat: detect weak role hierarchies in Soroban contracts#452
Joeloo1 wants to merge 1 commit into
MDTechLabs:mainfrom
drips-projects:Detect-Weak-Role-Hierarchies

Conversation

@Joeloo1
Copy link
Copy Markdown

@Joeloo1 Joeloo1 commented Jun 2, 2026

Summary

  • Adds detectWeakRoleHierarchies() detector in rules/stellar/access-control/
  • Flags role-assignment functions (grant_role, add_admin, set_role, etc.) that lack a superior-authority guard, allowing any authenticated caller to escalate privileges
  • Uses brace-counting to scope each function's analysis precisely, avoiding false positives from adjacent functions

Test plan

  • Weak functions (only require_auth, no role-tier check) are flagged
  • Functions guarded with assert_admin, only_admin, or admin.require_auth are not flagged
  • Contracts with no role-assignment functions return detected: false
  • Fixture stellar-weak-role-hierarchy.json matches detector output

Closes #358

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 2, 2026

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

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.

Detect Weak Role Hierarchies

1 participant