Skip to content

security: verify BFT PRE-PREPARE messages before accept#2062

Merged
Scottcjn merged 1 commit intoScottcjn:mainfrom
createkr:sec/issue2061-bft-preprepare-auth
Apr 4, 2026
Merged

security: verify BFT PRE-PREPARE messages before accept#2062
Scottcjn merged 1 commit intoScottcjn:mainfrom
createkr:sec/issue2061-bft-preprepare-auth

Conversation

@createkr
Copy link
Copy Markdown
Contributor

@createkr createkr commented Apr 4, 2026

Summary

This change closes an authentication gap in the BFT consensus receive path by verifying PRE-PREPARE message signatures and rejecting stale messages before proposal handling continues.

What changed

  • Added HMAC signature verification in _handle_pre_prepare()
  • Added timestamp freshness enforcement using the existing CONSENSUS_MESSAGE_TTL window
  • Kept PRE-PREPARE validation behavior consistent with the existing PREPARE and COMMIT handlers

Why

PREPARE and COMMIT were already authenticated on receipt, but PRE-PREPARE was not. That left the proposal-carrying message type outside the normal verification path and allowed forged or stale PRE-PREPARE messages to reach downstream consensus logic.

Scope

  • node/rustchain_bft_consensus.py only

Closes #2061

Payout Wallet

RTC1d48d848a5aa5ecf2c5f01aa5fb64837daaf2f35

@github-actions github-actions bot added BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) node Node server related labels Apr 4, 2026
@github-actions github-actions bot added the size/S PR: 11-50 lines label Apr 4, 2026
@Scottcjn
Copy link
Copy Markdown
Owner

Scottcjn commented Apr 4, 2026

Merged. 75 RTC. Real vulnerability — _handle_pre_prepare was skipping signature verification that _handle_prepare had. Nice catch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) node Node server related size/S PR: 11-50 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Security: BFT PRE-PREPARE messages bypass signature and freshness checks

2 participants