Skip to content

fix: remove hardcoded Engine API JWT secret and require explicit configuration#1087

Open
erhnysr wants to merge 2 commits into
base:mainfrom
erhnysr:fix/hardcoded-jwt-secret
Open

fix: remove hardcoded Engine API JWT secret and require explicit configuration#1087
erhnysr wants to merge 2 commits into
base:mainfrom
erhnysr:fix/hardcoded-jwt-secret

Conversation

@erhnysr
Copy link
Copy Markdown

@erhnysr erhnysr commented May 20, 2026

Summary

Fixes #1086.

The default BASE_NODE_L2_ENGINE_AUTH_RAW value (688f5d737bad920b...) was a well-known public hex string committed in the repository. Since authrpc binds to 0.0.0.0:8551, any operator using host networking, Kubernetes, custom port mappings, or shared Docker networks was exposed to unauthenticated Engine API access.

Changes

  • .env.mainnet / .env.sepolia: Replace the hardcoded secret with a <your-secret-jwt> placeholder and a comment instructing operators to generate their own value with openssl rand -hex 32.
  • reth/reth-entrypoint, base-consensus-entrypoint, op-node-entrypoint: Add a validation block before writing the JWT file. If BASE_NODE_L2_ENGINE_AUTH_RAW is unset or still holds the placeholder, the script exits with a clear error message and the openssl command to generate a valid secret.
  • README.md: Document BASE_NODE_L2_ENGINE_AUTH_RAW as a required field under Configuration → Required Settings, explaining that both containers must share the same value.

Test plan

  • Start the node without setting BASE_NODE_L2_ENGINE_AUTH_RAW — confirm all three entrypoints exit with the error message and generation hint.
  • Set BASE_NODE_L2_ENGINE_AUTH_RAW=$(openssl rand -hex 32) in .env.mainnet — confirm the node starts and execution/consensus containers authenticate successfully.
  • Verify no regressions in existing node startup with a valid secret set.

🤖 Generated with Claude Code

…iguration

The default BASE_NODE_L2_ENGINE_AUTH_RAW value was a well-known public hex
string committed in the repository. Because authrpc binds to 0.0.0.0, any
operator using host networking, Kubernetes, custom port mappings, or shared
Docker networks was exposed to unauthenticated Engine API access.

- Remove the hardcoded secret from .env.mainnet and .env.sepolia; replace
  with a placeholder that instructs operators to generate their own value
  using `openssl rand -hex 32`
- Add validation in all three entrypoint scripts (reth-entrypoint,
  base-consensus-entrypoint, op-node-entrypoint) that exits with a clear
  error message if BASE_NODE_L2_ENGINE_AUTH_RAW is unset or still holds
  the placeholder value
- Document BASE_NODE_L2_ENGINE_AUTH_RAW as a required field in README.md

Fixes base#1086

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cb-heimdall
Copy link
Copy Markdown
Collaborator

cb-heimdall commented May 20, 2026

🟡 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

geth/geth-entrypoint was missing the same BASE_NODE_L2_ENGINE_AUTH_RAW
validation added to reth-entrypoint, base-consensus-entrypoint, and
op-node-entrypoint. Without this check, geth nodes using the default
or placeholder secret would silently start with a public JWT.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

Bug: default Engine API JWT secret is hardcoded while authrpc binds to 0.0.0.0

2 participants