#21531: Security/Webhooks: block signed replay for Nextcloud, Google Chat, and LINE
channel: googlechat
channel: nextcloud-talk
size: M
Cluster:
Security Enhancements and Guardrails
## Summary
- split replay-deduping work out of #21203 into a focused webhook replay PR
- block signed webhook replay for Nextcloud Talk
- dedupe replayed webhook events for Google Chat
- block replayed signed payloads for LINE webhook handlers
## Scope boundaries
- intentionally excludes voice-call webhook changes
- intentionally excludes Control UI containment changes
- intentionally excludes test-runner CI harness changes
## Validation
- pnpm test -- extensions/nextcloud-talk/src/monitor.webhook-security.test.ts extensions/googlechat/src/monitor.webhook-routing.test.ts src/line/webhook-node.test.ts src/line/webhook.test.ts
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Adds replay protection to webhook handlers for Nextcloud Talk, Google Chat, and LINE by deduplicating webhook events within a 5-minute window. Each implementation uses an in-memory cache with cleanup logic to prevent unbounded memory growth (max 5,000 keys). Nextcloud Talk uses `random:signature` pairs, Google Chat uses account-scoped event keys built from message/space metadata, and LINE uses webhook event IDs (falling back to `signature:bodyhash` when IDs are unavailable).
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- Focused security improvement with solid test coverage. The replay protection implementations follow consistent patterns across all three integrations, use proper constant-time signature validation, include appropriate bounds checks for memory management, and are thoroughly tested. The changes are additive (no breaking modifications to existing behavior) and all validation/rejection occurs before event processing.
- No files require special attention
<sub>Last reviewed commit: 04ad8fc</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#21532: Security/Voice Call: block signed webhook replay
by bmendonca3 · 2026-02-20
84.6%
#8584: fix(nextcloud-talk): fix HMAC signing, allowlist matching, and grac...
by teknomage8 · 2026-02-04
73.0%
#23461: Gateway: add hook replay protection with timestamp and nonce
by bmendonca3 · 2026-02-22
72.1%
#17182: security(line): fail closed when webhook token/secret are missing
by davidahmann · 2026-02-15
71.7%
#11804: fix(webhook): return 503 from health endpoints when last processing...
by coygeek · 2026-02-08
70.9%
#16928: fix(security): OC-07 redact session history credentials and enforce...
by aether-ai-agent · 2026-02-15
70.4%
#20395: fix(googlechat): prevent infinite auto-restart and ambiguous-target...
by ggalmeida0 · 2026-02-18
70.3%
#6405: feat(security): Add HTTP API security hooks for plugin scanning
by masterfung · 2026-02-01
69.9%
#5834: fix(line): add timeout and size limit to readRequestBody to prevent...
by hclsys · 2026-02-01
69.8%
#17593: security: fail closed when LINE webhook secret is missing
by davidahmann · 2026-02-15
69.7%