#16877: fix: Authentication Rate Limiting is Opt-In Only - Disabled by Default
gateway
size: S
trusted-contributor
## Fix Summary
The OpenClaw gateway does not enable authentication rate limiting by default. The rate limiter is only created when explicitly configured in the configuration file (`gateway.auth.rateLimit`). This leaves the authentication endpoints vulnerable to brute-force attacks.
## Issue Linkage
Fixes #16876
## Security Snapshot
- CVSS v3.1: 8.8 (High)
- CVSS v4.0: 8.7 (High)
## Implementation Details
### Files Changed
- `src/gateway/openai-http.e2e.test.ts` (+53/-0)
- `src/gateway/server.impl.ts` (+2/-4)
### Technical Analysis
Root cause: insufficient control in the documented code path allows unsafe behavior under attacker-influenced conditions.
Reachability: Start OpenClaw gateway without explicit rate limit configuration
Code path: **File:** `src/gateway/server.impl.ts:301-305`
Observed effect: The OpenClaw gateway does not enable authentication rate limiting by default. The rate limiter is only created when explicitly configured in the configuration file (`gateway.auth.rateLimit`). This leaves the authentication endpoints vulnerable to brute-force attacks.
## Validation Evidence
- Command: `pnpm build && pnpm check && pnpm test`
- Status: failed
## Risk and Compatibility
non-breaking; no known regression impact
## AI-Assisted Disclosure
- AI-assisted: yes
- Model: GPT-5.3-Codex
Most Similar PRs
#22766: fix(security): enable gateway auth rate limiting by default (CWE-307)
by brandonwise · 2026-02-21
69.8%
#16963: fix: enable auth rate limiting by default
by StressTestor · 2026-02-15
69.3%
#16881: fix(gateway): enable auth rate limiting by default
by Limitless2023 · 2026-02-15
68.5%
#19937: fix(gateway): validate token/password auth modes and isolate gatewa...
by NewdlDewdl · 2026-02-18
66.6%
#19885: test(gateway,browser): isolate tests from ambient OPENCLAW_GATEWAY_...
by NewdlDewdl · 2026-02-18
66.3%
#11435: fix(security): validate OPENCLAW_BROWSER_CONTROL_MODULE before dyna...
by coygeek · 2026-02-07
66.2%
#23364: Gateway: add risk-ack interlock for dangerous Control UI flags
by bmendonca3 · 2026-02-22
66.1%
#23780: Gateway: fail closed on insecure state directory permissions
by bmendonca3 · 2026-02-22
65.6%
#23814: Gateway: block unauthenticated tool-invocation HTTP surfaces
by bmendonca3 · 2026-02-22
64.9%
#18273: fix: extract token from URL query string for Control UI websocket auth
by MisterGuy420 · 2026-02-16
64.8%