Both were precise TODOs in docs/THREAT-MODEL.md, not speculative hardening:
- Elevation of privilege: VerifySignature now rejects any Airwallex
webhook delivery whose x-timestamp is more than 5 minutes from the
verifier's clock (ErrStaleTimestamp), closing an unbounded replay
window down to Airwallex's own documented delivery tolerance.
- Denial of service: webhook-ingestion gets its own internal/ratelimit
(token-bucket HTTP middleware, source-IP keyed, mirroring gateway's
gRPC-side design per docs/adr/0004) in front of the plain HTTP
webhook listener, tunable via WEBHOOK_INGESTION_RATELIMIT_* env vars.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>