Add Claude Code security review rules for Bor codebase#2110
Merged
Add Claude Code security review rules for Bor codebase#2110
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2110 +/- ##
===========================================
+ Coverage 51.22% 51.39% +0.17%
===========================================
Files 878 881 +3
Lines 152444 152810 +366
===========================================
+ Hits 78084 78535 +451
+ Misses 69264 69170 -94
- Partials 5096 5105 +9 see 49 files with indirect coverage changes 🚀 New features to boost your workflow:
|
marcello33
approved these changes
Mar 5, 2026
adamdossa
approved these changes
Mar 9, 2026
Add path-scoped security review rules for Claude Code covering consensus, crypto, P2P, RPC, EVM, state, txpool, blockchain, contract interactions, and eth backend. Update CLAUDE.md with Bor vs geth differences and security rules reference table.
…s-client parity Incorporate real-world incident lessons and threat modeling improvements: Production feedback: - RLP encoding consistency across tx types and clients (Erigon incident) - Heimdall desync as network-level incident, not just missed checkpoints - PIP-66 early announcement context for block time enforcement - Precompile lifecycle in contracts.go: init(), ActivePrecompiles, HF gating - Cross-client parity requirement for precompile changes (Bor <> Erigon) - BlockSTM serial/parallel not mutually exclusive - RPC batch data limits (hardcoded max or config) Threat source classification: - Add external vs self-inflicted severity multiplier to security-common.md - Add Trigger column (Peer/RPC User/Validator/Self) to pattern tables - Escalate externally-triggerable patterns by one severity level - Mark self-inflicted patterns to avoid over-prioritizing during review
8a327ce to
96b347e
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Add path-scoped security review rules for Claude Code that enable automated security-aware code review across all critical areas of the Bor codebase. Each rule file defines a threat model, critical invariants, patterns to flag with severity levels, and a review checklist — scoped to specific source paths so rules activate only on relevant diffs.
Rules are informed by production incident lessons (e.g. RLP cross-client mismatch with Erigon, Heimdall desync cascading failures) and include a threat source classification system that escalates severity when bugs are externally triggerable (by peers, RPC users, or validators).
Updated
CLAUDE.mdwith Bor vs upstream geth architectural differences and a reference table linking each rule to its covered paths.Changes
Files added/modified
11 new rule files in
.claude/rules/:security-common.mdconsensus-security.mdblockchain-security.mdevm-security.mdstate-security.mdcontract-interaction-security.mdcrypto-security.mdp2p-security.mdrpc-security.mdtxpool-security.mdeth-backend-security.mdUpdated:
CLAUDE.md— added Bor-specific context and rules reference table.Checklist
Cross repository changes
Testing
Manual tests
Tested by running
claude -pagainst recent PRs (#2092, #2094) and verifying that:Additional comments
This PR adds no runtime code — only
.claude/rules/*.mdandCLAUDE.mdchanges. Zero impact on Bor binary or behavior.