Skip to content

Harden node configuration, prevent secret leakage, and restrict RPC defaults - #1168

Open
magqqgq wants to merge 6 commits into
base:mainfrom
magqqgq:ggttt
Open

Harden node configuration, prevent secret leakage, and restrict RPC defaults#1168
magqqgq wants to merge 6 commits into
base:mainfrom
magqqgq:ggttt

Conversation

@magqqgq

@magqqgq magqqgq commented Aug 18, 2026

Copy link
Copy Markdown

This PR addresses several critical security vulnerabilities and configuration anti-patterns within the node environment, specifically focusing on secret management, engine authentication, and RPC attack surface reduction.

Secrets & Configuration Management:

  • Removed node/.env, node/.env.mainnet, and node/.env.sepolia from the repository to eliminate hardcoded, committed engine JWT secrets.
  • Updated node/.gitignore to strictly exclude local .env files while allowing safe templates (*.example).
  • Added redacted .env.mainnet.example and .env.sepolia.example templates that require operators to generate their own unique 32-byte hexadecimal deployment secrets.
  • Updated README.md with explicit instructions on generating and configuring these unique L2 engine secrets.

Engine Authentication Validation:

  • Updated node/execution-entrypoint to validate the BASE_NODE_L2_ENGINE_AUTH_RAW input before writing the secret file. Node startup will now fail-closed if the value is missing or is not exactly 64 hexadecimal characters, preventing silent deployments with malformed authentication material.

RPC Attack Surface Reduction:

  • Replaced wildcard (*) HTTP CORS and WebSocket origins with restricted defaults (http://localhost) in node/execution-entrypoint, which can be explicitly overridden via RETH_HTTP_CORS_DOMAINS and RETH_WS_ORIGINS.
  • Reduced the default privileged HTTP and WebSocket APIs from web3,eth,net,debug,txpool,miner to a least-privilege default of web3,eth,net.

…efaults

This PR addresses several critical security vulnerabilities and configuration anti-patterns within the node environment, specifically focusing on secret management, engine authentication, and RPC attack surface reduction.

**Secrets & Configuration Management:**
* Removed `node/.env`, `node/.env.mainnet`, and `node/.env.sepolia` from the repository to eliminate hardcoded, committed engine JWT secrets.
* Updated `node/.gitignore` to strictly exclude local `.env` files while allowing safe templates (`*.example`).
* Added redacted `.env.mainnet.example` and `.env.sepolia.example` templates that require operators to generate their own unique 32-byte hexadecimal deployment secrets.
* Updated `README.md` with explicit instructions on generating and configuring these unique L2 engine secrets.

**Engine Authentication Validation:**
* Updated `node/execution-entrypoint` to validate the `BASE_NODE_L2_ENGINE_AUTH_RAW` input before writing the secret file. Node startup will now fail-closed if the value is missing or is not exactly 64 hexadecimal characters, preventing silent deployments with malformed authentication material.

**RPC Attack Surface Reduction:**
* Replaced wildcard (`*`) HTTP CORS and WebSocket origins with restricted defaults (`http://localhost`) in `node/execution-entrypoint`, which can be explicitly overridden via `RETH_HTTP_CORS_DOMAINS` and `RETH_WS_ORIGINS`.
* Reduced the default privileged HTTP and WebSocket APIs from `web3,eth,net,debug,txpool,miner` to a least-privilege default of `web3,eth,net`.
@cb-heimdall

Copy link
Copy Markdown
Collaborator

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants