web3-case-study-role-misconfig

Audit role-based access controls in yield-aggregator contracts to detect missing DISTRIBUTOR_ROLE grants.

121|32|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/shuvonsec/web3-bug-bounty-hunting-ai-skills --skill web3-case-study-role-misconfig
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: web3-case-study-role-misconfig
Source: https://github.com/shuvonsec/web3-bug-bounty-hunting-ai-skills/tree/main/web3-case-study-role-misconfig
Command: npx skills add https://github.com/shuvonsec/web3-bug-bounty-hunting-ai-skills --skill web3-case-study-role-misconfig

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Case study demonstrating how a role misconfiguration in a rewards-distributor contract can permanently lock all earned rewards, enabling auditors to reproduce and assess the risk in a controlled setting.

Core Features & Use Cases

  • Architecture walkthrough of a yield-aggregator target with a focus on Access Control patterns.
  • Complete bug class verdicts across 10 classes and two live findings (DISTRIBUTOR_ROLE never granted; dust harvest DoS)
  • Complete PoC templates, remediation guidance, and validation steps to reproduce in a testnet or forked mainnet.

Quick Start

Fork the mainnet and run the RoleNeverGranted PoC to verify that getRoleMemberCount(DISTRIBUTOR_ROLE) is 0 and that claimFor() reverts for any address.

Frequently Asked Questions about web3-case-study-role-misconfig

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit role-based access control in a yield aggregator smart contract?

Auditing role-based access control in a yield aggregator smart contract involves identifying missing role grants, such as a DISTRIBUTOR_ROLE, that permanently lock reward tokens. You must verify OpenZeppelin role usage and cross-contract permission patterns to reproduce the issue.

Why does claimFor() revert when DISTRIBUTOR_ROLE is never granted in a rewards distributor contract?

claimFor() reverts because the DISTRIBUTOR_ROLE is never granted, resulting in a getRoleMemberCount of 0. This role misconfiguration permanently locks earned rewards by blocking any address from executing claim transactions within the distributor contract.

What is the best way to reproduce a role misconfiguration bug using a mainnet fork?

To reproduce a role misconfiguration bug using a mainnet fork, run the provided RoleNeverGranted PoC templates. Validation steps confirm that getRoleMemberCount returns 0 and that claimFor() reverts, allowing you to assess the risk in a controlled testnet environment.

How do I remediate a dust harvest DoS caused by smart contract role misconfiguration?

Remediate a dust harvest DoS caused by role misconfiguration by applying the provided remediation guidance. The case study includes validation steps to correct the OpenZeppelin role usage and restore reward distribution functionality across the affected contracts.

Can I use this case study to verify PoC findings across 10 different bug classes?

Yes, you can use this case study to verify PoC findings across 10 bug classes. It delivers complete bug class verdicts and focuses on two live findings, specifically targeting OpenZeppelin role usage and access control patterns in Solidity projects.

Do I need a forked mainnet environment to audit cross-contract permission patterns in DeFi?

A forked mainnet environment is required to accurately audit cross-contract permission patterns in DeFi. This setup validates PoC templates and confirms that role misconfigurations, such as missing DISTRIBUTOR_ROLE grants, permanently lock reward tokens.