Skip to content

fix: insecure random in consensus (Batch #60)#4150

Open
BossChaos wants to merge 2 commits intoScottcjn:mainfrom
BossChaos:sec-batch60
Open

fix: insecure random in consensus (Batch #60)#4150
BossChaos wants to merge 2 commits intoScottcjn:mainfrom
BossChaos:sec-batch60

Conversation

@BossChaos
Copy link
Copy Markdown
Contributor

fix: insecure random in consensus (Batch #60)

  • Replace random.choice with secrets.choice in PoA consensus
  • Replace random.uniform with secrets.randbelow for weighted selection
  • Replace random.randint/randrange in deep_entropy challenges with secrets.randbelow
  • Prevent predictable validator selection and challenge replay attacks

Co-Authored-By: Hermes Agent hermes@nous.research

BossChaos and others added 2 commits May 5, 2026 02:52
- Replace random.choice with secrets.choice in PoA consensus
- Replace random.uniform with secrets.randbelow for weighted selection
- Replace random.randint/randrange in deep_entropy challenges with secrets.randbelow
- Prevent predictable validator selection and challenge replay attacks

Co-Authored-By: Hermes Agent <hermes@nous.research>
@BossChaos BossChaos requested a review from Scottcjn as a code owner May 8, 2026 06:36
@github-actions github-actions Bot added BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) ci size/S PR: 11-50 lines labels May 8, 2026
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) ci size/S PR: 11-50 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant