Skip to content

[hardening]: synchronously handle on-chain events during startup #8166

@morehouse

Description

@morehouse

When LND starts up, it should handle any immediately serviceable on-chain events (breach retribution, sweeping HTLCs, etc.) prior to starting the connection manager. Once the connection manager is running, LND's attack surface widens greatly, so it is best to handle critical on-chain things beforehand.

During startup, we already wait for the wallet to sync with the blockchain before doing anything else. But we don't do the same for ChainArbitrator in server.Start(). This creates a race where it is possible for a peer to connect to our node before on-chain events have been handled.

This could be a problem if an attacker has a fast way to crash our node after connecting (e.g., ping of death). They could crash our node and broadcast a commitment tx while we're offline. Then every time our node tries to restart, the attacker may be able to crash it again before it punishes revoked commitments or sweeps HTLCs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2should be fixed if one has timeadvancedIssues suitable for very experienced developersbrainstormingLong term ideas/discussion/requests for feedbacksecurityGeneral label for issues/PRs related to the security of the softwareserver

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions