# GHSA-4rmq-mc2c-r495: Babylon Incorrect FP inactive accounting in costaking creates “phantom stake” that earns rewards after BTC unbond

> A state consistency bug allows attackers to earn costaking rewards without backing BTC by exploiting a race condition during unbonding.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 9 Dec 2025
- **Also known as:** GO-2025-4214

## What is GHSA-4rmq-mc2c-r495?

GHSA-4rmq-mc2c-r495 is a vulnerability in github.com/babylonlabs-io/babylon, published on 9 Dec 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

### Summary

A state consistency bug in `x/costaking` can leave a BTC delegator with non-zero `ActiveSatoshis` (Phatom Stake) even after they have fully unbonded their BTC delegation, if their Finality Provider (FP) drops out of the active set in the exact same babylon block height. This creates a “phantom stake”: the delegator’s BTC capital is withdrawn, the FP is inactive, but costaking continues to treat the delegation as active BTC stake allowing ongoing rewards accrual without backing BTC.

### Impact

An address can keep earning costaking rewards with zero BTC staked.

Reported by @BottyBott.

## Which versions are affected by GHSA-4rmq-mc2c-r495?

12 open source packages ship an affected version, including github.com/babylonlabs-io/babylon, github.com/babylonlabs-io/babylon/v2 and github.com/babylonlabs-io/babylon/v3.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/babylonlabs-io/babylon` | Go | All versions | None |
| `github.com/babylonlabs-io/babylon` | Go | All versions to 1.1.0 | None |
| `github.com/babylonlabs-io/babylon` | Go | All versions to 1.1.0 | None |
| `github.com/babylonlabs-io/babylon/v2` | Go | All versions | None |
| `github.com/babylonlabs-io/babylon/v2` | Go | All versions to 2.3.2 | None |
| `github.com/babylonlabs-io/babylon/v2` | Go | All versions to 2.3.2 | None |
| `github.com/babylonlabs-io/babylon/v3` | Go | All versions | None |
| `github.com/babylonlabs-io/babylon/v3` | Go | All versions to 3.0.0-snapshot.250805a | None |
| `github.com/babylonlabs-io/babylon/v3` | Go | All versions to 3.0.0-snapshot.250805a | None |
| `github.com/babylonlabs-io/babylon/v4` | Go | All versions | 4.2.0 |
| `github.com/babylonlabs-io/babylon/v4` | Go | All versions | 4.2.0 |
| `github.com/babylonlabs-io/babylon/v4` | Go | All versions | 4.2.0 |

## How do I fix GHSA-4rmq-mc2c-r495?

Apply the vendor's patch.

## Is GHSA-4rmq-mc2c-r495 being exploited?

There is no known exploitation of GHSA-4rmq-mc2c-r495 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-4rmq-mc2c-r495 and fix it if it is affected.

What it is: GHSA-4rmq-mc2c-r495 is a vulnerability in github.com/babylonlabs-io/babylon, published on 9 Dec 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-4rmq-mc2c-r495 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/babylonlabs-io/babylon (Go): affected all versions; no fix listed
- github.com/babylonlabs-io/babylon (Go): affected all versions up to 1.1.0; no fix listed
- github.com/babylonlabs-io/babylon (Go): affected all versions up to 1.1.0; no fix listed
- github.com/babylonlabs-io/babylon/v2 (Go): affected all versions; no fix listed
- github.com/babylonlabs-io/babylon/v2 (Go): affected all versions up to 2.3.2; no fix listed
- github.com/babylonlabs-io/babylon/v2 (Go): affected all versions up to 2.3.2; no fix listed
- github.com/babylonlabs-io/babylon/v3 (Go): affected all versions; no fix listed
- github.com/babylonlabs-io/babylon/v3 (Go): affected all versions up to 3.0.0-snapshot.250805a; no fix listed
- github.com/babylonlabs-io/babylon/v3 (Go): affected all versions up to 3.0.0-snapshot.250805a; no fix listed
- github.com/babylonlabs-io/babylon/v4 (Go): affected all versions; fixed in 4.2.0
- github.com/babylonlabs-io/babylon/v4 (Go): affected all versions; fixed in 4.2.0
- github.com/babylonlabs-io/babylon/v4 (Go): affected all versions; fixed in 4.2.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-4rmq-mc2c-r495/ (Markdown: https://insights.sbomify.com/GHSA-4rmq-mc2c-r495/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-4rmq-mc2c-r495

---
From sbomify Insights: https://insights.sbomify.com/GHSA-4rmq-mc2c-r495/
Summaries are generated and may contain mistakes; the official description above is the record.
