H-01 – Retired Gatekeeper signing keys can still execute governance operations

Hi Team,

Just a try out from a noob.. Not intended to waste your precious time…

Playing a bit with AI and run a security audit on the ghost-dao contracts. One of the findings is stated below. Do you appreciate these kind of input (Noob/Monkey testing) or should I leave it to the real coding kings?

Greetz,

Kitsune

H-01 – Retired Gatekeeper signing keys can still execute governance operations

HIGH

Conditional on compromise of a retired signing key

Affected files

  • ghost-dao-contracts/src/Gatekeeper.sol
  • ghost-dao-contracts/src/types/StorageHistory.sol
  • ghost-dao-contracts/src/Staking.sol
  • ghost-dao-contracts/src/GhstERC20.sol

Relevant code

Gatekeeper.sol:

  • Lines 98–106: historical public-key lookup.
  • Lines 128–150: signature verification and dispatch.
  • Lines 216–232: governance execution.
  • Lines 234–244: selection of the public key for a supplied session.

StorageHistory.sol:

- Lines 39–43: one-time session execution tracking.

Staking.sol:

- Lines 194–197: Gatekeeper-only GHOST minting.

What is wrong

The Gatekeeper uses historical key checkpoints to choose the verification key for a supplied Exodus session.

That is understandable for verifying old messages. The problem is that the govern() function does not enforce that the session is still within the active key’s authorization period.

It checks:

StorageHistory(storageHistory).trySetTransactionExecuted(exodusSession);

But it does not check that exodusSession is greater than or equal to the activation session of the current key.

The replay-protection check only establishes that the session has not previously been used. It does not establish that the session is still authorized for new governance operations.

Attack scenario

Suppose the Gatekeeper rotates from key A to key B at session 100.

The historical key lookup can still return key A for sessions below 100.

If session 42 has not been consumed, a holder of key A can potentially sign a new governance operation using session 42.

The Gatekeeper:

  1. Looks up the historical key for session 42.
  2. Verifies the signature using key A.
  3. Checks that session 42 has not been executed.
  4. Marks session 42 as executed.
  5. Executes the supplied target call.

There is no check that the call corresponds to an actual pending Exodus request created by GhostChain.

Why this can mint GHOST without bridge backing

The governance function performs an unrestricted low-level call:

(bool success, bytes memory ret) =
    payload.target.call(call);

The Staking contract exposes:

function recall(address receiver, uint256 amount)
    external
    override
{
    if (gatekeeper != msg.sender) revert NotGatekeeper();
    IGHST(ghst).mint(receiver, amount);
}

The Gatekeeper is the caller, so the authorization check passes.

This call path does not perform the bridge-out accounting performed by Gatekeeper.recall(), which normally updates StorageHistory before calling staking.

The result is that a compromised retired key can potentially authorize direct GHOST issuance without the corresponding bridge backing.

Impact chain

Retired Gatekeeper signing key is compromised

An unused historical session is selected

govern() accepts the historical signature

Gatekeeper calls Staking.recall(receiver, amount)

GHOST is minted without a corresponding bridge-out balance reduction

Conditions and qualification

This is not a permissionless minting vulnerability. It requires compromise of a retired signing key and at least one unused historical session.

The code does not demonstrate that all earlier session numbers are necessarily consumed before a rotation. In particular, govern() does not verify that the chosen session corresponds to an existing request.

The consequence, if the conditions are met, is potentially unlimited unbacked GHOST issuance.

Recommended solution

1. Revoke old keys for new operations.

Do not allow a historical key to authorize a new governance operation merely because its historical session has not been consumed.

Enforce a session boundary based on the currently active key.

2. Tie execution to a real pending request.

Require a cryptographic or on-chain proof that the request was actually created by the GhostChain Exodus system. A replay bitmap alone is not sufficient authorization.

3. Enforce bridge backing at the minting boundary.

The Staking.recall() function should not blindly mint because the caller is Gatekeeper. The bridge-backing invariant must be enforced at the actual mint authorization boundary, rather than relying exclusively on one particular Gatekeeper call path.

4. Add regression tests.

Test that:

  • A retired key cannot execute a new governance operation.
  • A historical session cannot authorize an arbitrary target call.
  • A Gatekeeper governance call cannot invoke unrestricted GHOST minting.
  • No governance execution can increase GHOST supply without satisfying the bridge-backing invariant.
1 Like