Skip to content

Commit cf12f15

Browse files
erhnysrclaude
andcommitted
fix: remove hardcoded Engine API JWT secret and require explicit configuration
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. - Replace hardcoded secret in .env.mainnet and .env.sepolia with a placeholder that instructs operators to generate their own value with `openssl rand -hex 32` - Add validation in execution-entrypoint that exits with a clear error message if BASE_NODE_L2_ENGINE_AUTH_RAW is unset or still holds the placeholder value - Upgrade the existing empty-check in consensus-entrypoint to also catch the placeholder value - Document BASE_NODE_L2_ENGINE_AUTH_RAW as a required field in README.md Fixes #1086 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent cf36041 commit cf12f15

5 files changed

Lines changed: 19 additions & 4 deletions

File tree

.env.mainnet

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ BASE_NODE_L1_TRUST_RPC="false"
2121
# --------------------
2222
BASE_NODE_L2_ENGINE_RPC=ws://execution:8551
2323
BASE_NODE_L2_ENGINE_AUTH=/tmp/engine-auth-jwt
24-
BASE_NODE_L2_ENGINE_AUTH_RAW=688f5d737bad920bdfb2fc2f488d6b6209eebda1dae949a8de91398d932c517a
24+
# [REQUIRED] Generate with: openssl rand -hex 32
25+
BASE_NODE_L2_ENGINE_AUTH_RAW=<your-secret-jwt>
2526

2627
# P2P CONFIGURATION
2728
# -----------------

.env.sepolia

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ BASE_NODE_L1_TRUST_RPC="false"
2121
# --------------------
2222
BASE_NODE_L2_ENGINE_RPC=http://execution:8551
2323
BASE_NODE_L2_ENGINE_AUTH=/tmp/engine-auth-jwt
24-
BASE_NODE_L2_ENGINE_AUTH_RAW=688f5d737bad920bdfb2fc2f488d6b6209eebda1dae949a8de91398d932c517a
24+
# [REQUIRED] Generate with: openssl rand -hex 32
25+
BASE_NODE_L2_ENGINE_AUTH_RAW=<your-secret-jwt>
2526

2627
# P2P CONFIGURATION
2728
# -----------------

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ The following are the hardware specifications we use in production:
6464
- `BASE_NODE_L1_BEACON`: your L1 beacon node endpoint
6565
- `BASE_NODE_NETWORK`: `base` or `base-sepolia`
6666
- `RETH_CHAIN`: `base` or `base-sepolia`
67+
- `BASE_NODE_L2_ENGINE_AUTH_RAW`: a 32-byte hex secret shared between the execution and consensus containers — **never use the placeholder value**. Generate with:
68+
```bash
69+
openssl rand -hex 32
70+
```
6771

6872
### Network Settings
6973

consensus-entrypoint

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ if [[ -z "${BASE_NODE_L2_ENGINE_AUTH:-}" ]]; then
3636
exit 1
3737
fi
3838

39-
if [[ -z "${BASE_NODE_L2_ENGINE_AUTH_RAW:-}" ]]; then
40-
echo "expected BASE_NODE_L2_ENGINE_AUTH_RAW to be set" 1>&2
39+
if [[ -z "${BASE_NODE_L2_ENGINE_AUTH_RAW:-}" || "${BASE_NODE_L2_ENGINE_AUTH_RAW}" == "<your-secret-jwt>" ]]; then
40+
echo "ERROR: BASE_NODE_L2_ENGINE_AUTH_RAW is not set or still uses the placeholder value." >&2
41+
echo "Generate a secret and set it in your .env file:" >&2
42+
echo " BASE_NODE_L2_ENGINE_AUTH_RAW=\$(openssl rand -hex 32)" >&2
4143
exit 1
4244
fi
4345

execution-entrypoint

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,13 @@ fi
129129

130130
mkdir -p "$RETH_DATA_DIR"
131131
echo "Starting reth with additional args: $ADDITIONAL_ARGS"
132+
133+
if [[ -z "${BASE_NODE_L2_ENGINE_AUTH_RAW:-}" || "${BASE_NODE_L2_ENGINE_AUTH_RAW}" == "<your-secret-jwt>" ]]; then
134+
echo "ERROR: BASE_NODE_L2_ENGINE_AUTH_RAW is not set or still uses the placeholder value." >&2
135+
echo "Generate a secret and set it in your .env file:" >&2
136+
echo " BASE_NODE_L2_ENGINE_AUTH_RAW=\$(openssl rand -hex 32)" >&2
137+
exit 1
138+
fi
132139
echo "$BASE_NODE_L2_ENGINE_AUTH_RAW" > "$BASE_NODE_L2_ENGINE_AUTH"
133140

134141
exec "$BINARY" node \

0 commit comments

Comments
 (0)