[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M797ZPD9YBA88269ZVT31B92":3,"skill-same:01M797ZPD9YBA88269ZVT31B92":51},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":6,"ownerHtmlUrl":35,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":36,"install":37,"resources":50},"01M797ZPD9YBA88269ZVT31B92","contracts-governance-attack",null,"DAO governance attack — flash-loan-backed vote manipulation, delegation hijack, quorum dilution, proposal-spam DoS, time-lock bypass via emergency multisig, snapshot vs. on-chain vote desync, Compound\u002FAave\u002FUniswap-style GovernorBravo abuse.","7ShIkI3\u002FDecepticon-x-DarkTriad","7ShIkI3","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F78133376?v=4","01M797CTK5AHH2161YVG93NJ3B","Raphael Pascaud","01M797CTKRQS64R01J7E6TJSEM",3,"Apache-2.0","https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fcontracts\u002Fgovernance-attack\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: contracts-governance-attack\ndescription: \"DAO governance attack — flash-loan-backed vote manipulation, delegation hijack, quorum dilution, proposal-spam DoS, time-lock bypass via emergency multisig, snapshot vs. on-chain vote desync, Compound\u002FAave\u002FUniswap-style GovernorBravo abuse.\"\nallowed-tools: Bash Read Write\nmetadata:\n  when_to_use: \"dao governance vote proposal governorbravo compound aave uniswap snapshot timelock multisig delegation flash loan quorum\"\n  subdomain: contracts\n  tags: defi, dao, governance, flash-loan\n  mitre_attack: T1565.001, T1190\n---\n\n# DAO Governance Attack\n\n## Attack classes\n\n### 1. Flash-loan-backed vote\nDAOs that grant voting power = current token balance (not snapshot of past balance) are vulnerable:\n\n```solidity\n\u002F\u002F Attack: borrow governance token, vote, return loan, all in one tx\nfunction attack() external {\n    \u002F\u002F 1. Flash-borrow gov tokens\n    IFlashLoan(aave).flashLoan(address(this), govToken, 1_000_000e18, \"\");\n}\nfunction executeOperation(...) external {\n    \u002F\u002F 2. Vote on the malicious proposal\n    governor.castVote(proposalId, 1);   \u002F\u002F 1 = for\n    \u002F\u002F 3. Repay loan + premium (automatic by flash-loan callback)\n}\n```\n\nThis is what happened to Beanstalk (April 2022, $182M loss) — attacker flash-borrowed Beanstalk gov tokens, voted to drain the treasury, repaid the loan. Same block.\n\n**Defense check:** Does `getVotes(address, blockNumber)` reference a past snapshot? If yes (Compound's GovernorBravo pattern, OZ Governor with `ERC20Votes` + `getPastVotes`), flash-loan vote doesn't work.\n\n### 2. Delegation hijack\nERC20Votes lets users delegate. If a contract holds gov tokens and delegates to itself, controlling that contract = controlling the votes.\n\n```solidity\n\u002F\u002F If the target DAO has a contract holding tokens that delegates to itself,\n\u002F\u002F and that contract is upgradeable\u002Fhas an admin function:\nupgradeableContract.upgradeAndCall(newImpl, abi.encodeWithSelector(redelegate.selector, attacker));\n\u002F\u002F Now attacker controls those votes.\n```\n\n### 3. Quorum dilution attack\nIf quorum = % of total supply (not % of currently-active voters), an attacker can mint or stake extra tokens to push quorum out of reach:\n\n```solidity\n\u002F\u002F Some DAOs base quorum on totalSupply()\n\u002F\u002F Attacker mints a bunch of tokens to themselves (via legit minting if they're holder)\n\u002F\u002F Quorum requirement now too high for real voters to meet → all proposals fail\n```\n\n### 4. Proposal spam DoS\nGovernorBravo has a proposalThreshold. If low, attacker spams proposals to:\n- Burn proposers' gas\n- Confuse the UI\n- Push real proposals out of the active window\n\n### 5. Time-lock bypass via emergency multisig\nMost DAOs have a \"Security Council\" or \"Emergency Multisig\" that can execute without time-lock for emergencies. If signers can be socially engineered, phished, or are compromised: instant treasury drain.\n\nCheck: `timelock.executor()` — if it's a multisig and you can compromise N-of-M signers, the time-lock is illusory.\n\n### 6. Snapshot vs. on-chain desync\nOff-chain Snapshot.org votes use signed messages. If the DAO trusts Snapshot results and executes via a relayer:\n- Forge votes by sniping pending signed messages\n- Bribe voters off-chain (cheaper than on-chain)\n- Replay signed messages on a fork\n\n### 7. Proposal-script slippage\nGovernorBravo proposals execute calldata. If the proposal description and the actual calldata don't match, voters approve one thing while approving another:\n\n```solidity\n\u002F\u002F Description: \"Allocate 1000 USDC to grants\"\n\u002F\u002F Actual calldata: transfer(attacker, 1_000_000e6)\n\u002F\u002F Voters who don't decode calldata get rugged.\n```\n\n## Recon\n\n```bash\n# Identify the governance contract\ncast call --rpc-url $RPC $TIMELOCK \"getMinDelay()(uint256)\"\ncast call --rpc-url $RPC $GOVERNOR \"votingPeriod()(uint256)\"\ncast call --rpc-url $RPC $GOVERNOR \"proposalThreshold()(uint256)\"\ncast call --rpc-url $RPC $GOVERNOR \"quorum(uint256)(uint256)\" $BLOCK\n\n# Compound\u002FAave\u002FUniswap-style: Get GovernorBravo state\nforge inspect GovernorBravoDelegate storage-layout\n\n# List active proposals\ncast logs --rpc-url $RPC --address $GOVERNOR \\\n  --from-block latest:-1000 \\\n  \"ProposalCreated(uint256,address,address[],uint256[],string[],bytes[],uint256,uint256,string)\"\n```\n\n## Defender's checklist (the audit you're trying to defeat)\n\n| Defense | Bypass |\n|---|---|\n| `getVotes` uses past-block snapshot | Can't flash-loan-vote — find delegation-hijack instead |\n| Two-step time-lock (queue + execute) | Can't bypass without compromised emergency multisig |\n| `proposalThreshold > 0` | Can't spam — but might still be cheap |\n| Off-chain vote (Snapshot) → on-chain by N-of-M multisig | Replace at the multisig layer |\n\n## Tooling\n\n```bash\n# Tally, Boardroom — DAO dashboards (find target governance contracts)\n# Forge \u002F Foundry — simulate the attack on a fork\nforge test --fork-url $RPC --match-test test_governance_drain\n# Tenderly — live transaction simulation against fork\n```\n\n## References\n\n- \"Beanstalk Governance Attack\" post-mortems (Beanstalk Farms, April 2022)\n- Compound GovernorBravo audit reports (OpenZeppelin)\n- \"Slippage in Governance Proposals\" — Trail of Bits research\n- Devcon Bogota talks on governance security\n","# DAO Governance Attack\n\n## Attack classes\n\n### 1. Flash-loan-backed vote\nDAOs that grant voting power = current token balance (not snapshot of past balance) are vulnerable:\n\n```solidity\n\u002F\u002F Attack: borrow governance token, vote, return loan, all in one tx\nfunction attack() external {\n    \u002F\u002F 1. Flash-borrow gov tokens\n    IFlashLoan(aave).flashLoan(address(this), govToken, 1_000_000e18, \"\");\n}\nfunction executeOperation(...) external {\n    \u002F\u002F 2. Vote on the malicious proposal\n    governor.castVote(proposalId, 1);   \u002F\u002F 1 = for\n    \u002F\u002F 3. Repay loan + premium (automatic by flash-loan callback)\n}\n```\n\nThis is what happened to Beanstalk (April 2022, $182M loss) — attacker flash-borrowed Beanstalk gov tokens, voted to drain the treasury, repaid the loan. Same block.\n\n**Defense check:** Does `getVotes(address, blockNumber)` reference a past snapshot? If yes (Compound's GovernorBravo pattern, OZ Governor with `ERC20Votes` + `getPastVotes`), flash-loan vote doesn't work.\n\n### 2. Delegation hijack\nERC20Votes lets users delegate. If a contract holds gov tokens and delegates to itself, controlling that contract = controlling the votes.\n\n```solidity\n\u002F\u002F If the target DAO has a contract holding tokens that delegates to itself,\n\u002F\u002F and that contract is upgradeable\u002Fhas an admin function:\nupgradeableContract.upgradeAndCall(newImpl, abi.encodeWithSelector(redelegate.selector, attacker));\n\u002F\u002F Now attacker controls those votes.\n```\n\n### 3. Quorum dilution attack\nIf quorum = % of total supply (not % of currently-active voters), an attacker can mint or stake extra tokens to push quorum out of reach:\n\n```solidity\n\u002F\u002F Some DAOs base quorum on totalSupply()\n\u002F\u002F Attacker mints a bunch of tokens to themselves (via legit minting if they're holder)\n\u002F\u002F Quorum requirement now too high for real voters to meet → all proposals fail\n```\n\n### 4. Proposal spam DoS\nGovernorBravo has a proposalThreshold. If low, attacker spams proposals to:\n- Burn proposers' gas\n- Confuse the UI\n- Push real proposals out of the active window\n\n### 5. Time-lock bypass via emergency multisig\nMost DAOs have a \"Security Council\" or \"Emergency Multisig\" that can execute without time-lock for emergencies. If signers can be socially engineered, phished, or are compromised: instant treasury drain.\n\nCheck: `timelock.executor()` — if it's a multisig and you can compromise N-of-M signers, the time-lock is illusory.\n\n### 6. Snapshot vs. on-chain desync\nOff-chain Snapshot.org votes use signed messages. If the DAO trusts Snapshot results and executes via a relayer:\n- Forge votes by sniping pending signed messages\n- Bribe voters off-chain (cheaper than on-chain)\n- Replay signed messages on a fork\n\n### 7. Proposal-script slippage\nGovernorBravo proposals execute calldata. If the proposal description and the actual calldata don't match, voters approve one thing while approving another:\n\n```solidity\n\u002F\u002F Description: \"Allocate 1000 USDC to grants\"\n\u002F\u002F Actual calldata: transfer(attacker, 1_000_000e6)\n\u002F\u002F Voters who don't decode calldata get rugged.\n```\n\n## Recon\n\n```bash\n# Identify the governance contract\ncast call --rpc-url $RPC $TIMELOCK \"getMinDelay()(uint256)\"\ncast call --rpc-url $RPC $GOVERNOR \"votingPeriod()(uint256)\"\ncast call --rpc-url $RPC $GOVERNOR \"proposalThreshold()(uint256)\"\ncast call --rpc-url $RPC $GOVERNOR \"quorum(uint256)(uint256)\" $BLOCK\n\n# Compound\u002FAave\u002FUniswap-style: Get GovernorBravo state\nforge inspect GovernorBravoDelegate storage-layout\n\n# List active proposals\ncast logs --rpc-url $RPC --address $GOVERNOR \\\n  --from-block latest:-1000 \\\n  \"ProposalCreated(uint256,address,address[],uint256[],string[],bytes[],uint256,uint256,string)\"\n```\n\n## Defender's checklist (the audit you're trying to defeat)\n\n| Defense | Bypass |\n|---|---|\n| `getVotes` uses past-block snapshot | Can't flash-loan-vote — find delegation-hijack instead |\n| Two-step time-lock (queue + execute) | Can't bypass without compromised emergency multisig |\n| `proposalThreshold > 0` | Can't spam — but might still be cheap |\n| Off-chain vote (Snapshot) → on-chain by N-of-M multisig | Replace at the multisig layer |\n\n## Tooling\n\n```bash\n# Tally, Boardroom — DAO dashboards (find target governance contracts)\n# Forge \u002F Foundry — simulate the attack on a fork\nforge test --fork-url $RPC --match-test test_governance_drain\n# Tenderly — live transaction simulation against fork\n```\n\n## References\n\n- \"Beanstalk Governance Attack\" post-mortems (Beanstalk Farms, April 2022)\n- Compound GovernorBravo audit reports (OpenZeppelin)\n- \"Slippage in Governance Proposals\" — Trail of Bits research\n- Devcon Bogota talks on governance security\n",{"name":5,"metadata":24,"description":7,"allowed-tools":29},{"tags":25,"subdomain":26,"when_to_use":27,"mitre_attack":28},"defi, dao, governance, flash-loan","contracts","dao governance vote proposal governorbravo compound aave uniswap snapshot timelock multisig delegation flash loan quorum","T1565.001, T1190","Bash Read Write","main","42b918525fb79065e730da3da997bffb33fcd414","packages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fcontracts\u002Fgovernance-attack",0,"https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad","https:\u002F\u002Fgithub.com\u002F7ShIkI3","2026-07-22 19:02:27",{"source":8,"skillName":5,"commands":38,"prompt":48,"zipAvailable":49},[39,42,45],{"tool":40,"command":41},"npx","npx skills add 7ShIkI3\u002FDecepticon-x-DarkTriad --skill contracts-governance-attack",{"tool":43,"command":44},"bunx","bunx skills add 7ShIkI3\u002FDecepticon-x-DarkTriad --skill contracts-governance-attack",{"tool":46,"command":47},"pnpm","pnpm dlx skills add 7ShIkI3\u002FDecepticon-x-DarkTriad --skill contracts-governance-attack","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fcontracts\u002Fgovernance-attack\u002FSKILL.md",true,[],[52,59,66,73,80,87],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M798TNHEBA4Y67TJJ7W0KBDD","wps-pixie-dust","WPS Pixie-Dust offline nonce attack (reaver -K \u002F pixiewps) and fallback online PIN brute (bully) to recover the AP's WPA PSK without capturing a handshake.","https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fwps-pixie-dust\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M798TH79VR8XM7AAMG0ZKSXX","wpa3-sae","WPA3-SAE transition-mode downgrade (DragonShift), SSID Confusion CVE-2023-52424, Dragonblood side-channels, and SAE captive-portal credential recovery against WPA3-Personal networks.","https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fwpa3-sae\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M798TD0E10ZHQN5X362M4HG9","wpa2-psk","WPA\u002FWPA2-PSK handshake capture via targeted deauth + PMKID (no deauth required) + offline hashcat cracking. The most common consumer\u002FSMB encryption mode in 2026.","https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fwpa2-psk\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M798T7HFR3NB9WJTK1FESVF9","wpa-enterprise-eap","WPA\u002FWPA2\u002FWPA3-Enterprise (802.1X\u002FEAP) rogue-RADIUS evil-twin for MSCHAPv2 capture, GTC downgrade, and PEAP relay. MSCHAPv2 capture equals a NetNTLM hash — the primary wireless on-ramp to Active Directory.","https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fwpa-enterprise-eap\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M798T38B4SV0T87VQK56KPHC","krack-fragattacks","KRACK key-reinstallation (CVE-2017-13077..13082) and FragAttacks fragmentation\u002Faggregation flaws (CVE-2020-24586..24588, CVE-2020-26139..26147) against legacy or embedded 802.11 supplicants with poor patch cadence.","https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fkrack-fragattacks\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M798SXTNF0RP1DXKQEWFVQ9H","evil-twin-karma","Evil-twin rogue AP with KARMA\u002FMana PNL-probe response, captive-portal credential capture, and post-association MITM for PSK\u002Fopen networks. Distinct from wpa-enterprise-eap which targets 802.1X.","https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fevil-twin-karma\u002FSKILL.md",[],[]]