#17593: security: fail closed when LINE webhook secret is missing
stale
size: XS
Cluster:
Webhook Security Enhancements
## Problem
LINE webhook startup currently accepts blank `channelSecret` values, which leaves auth validation behavior ambiguous and potentially fail-open.
## What changed
- Added a fail-closed guard in `startLineWebhook` that rejects empty/whitespace channel secrets.
- Reused the trimmed secret in middleware wiring to avoid inconsistent behavior.
- Added regression test coverage for startup failure when secret is missing.
## Validation
- `pnpm vitest src/line/webhook.test.ts`
Refs #17587
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Prevented authentication bypass by failing closed when LINE `channelSecret` is missing or whitespace-only. The guard in `startLineWebhook` now trims and validates the secret at startup, matching the fail-closed pattern already used in `startTelegramWebhook` (src/telegram/webhook.ts:42-48). Test coverage added to verify the startup failure behavior.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The security fix follows established patterns in the codebase (telegram webhook), has comprehensive test coverage including the new fail-closed behavior, and addresses a critical authentication vulnerability. The change is minimal, well-scoped, and doesn't introduce any new risks.
- No files require special attention
<sub>Last reviewed commit: 97d9f5b</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#17182: security(line): fail closed when webhook token/secret are missing
by davidahmann · 2026-02-15
92.7%
#13521: telegram: require webhook secret in runtime webhook mode
by davidahmann · 2026-02-10
78.1%
#8067: fix(telegram): use timing-safe comparison for webhook secret
by yubrew · 2026-02-03
76.4%
#23621: fix(LINE): keep startAccount promise alive to prevent auto-restart ...
by ttakanawa · 2026-02-22
74.2%
#16928: fix(security): OC-07 redact session history credentials and enforce...
by aether-ai-agent · 2026-02-15
71.8%
#18777: fix: LINE webhook acknowledges events before processing and drops f...
by coygeek · 2026-02-17
71.7%
#11110: fix(line): false 'not configured' warnings when tokenSource=file
by lailoo · 2026-02-07
71.6%
#16898: Fix Zalo webhook secret comparison vulnerable to timing attacks
by Clawborn · 2026-02-15
71.1%
#6128: Fail closed when Telnyx webhook public key is missing (voice-call p...
by yueyueL · 2026-02-01
70.6%
#21128: Security/Voice Call: require trusted proxy IPs for forwarded-header...
by bmendonca3 · 2026-02-19
70.2%