This service is designed for internet exposure, but requires correct deployment configuration.
- SSRF protections in browser and outbound fetch paths
- Auth tiers: free/IP limited, API key, x402 pay-per-call
- Stripe webhook signature verification
- x402 replay protection with persistent tx-hash cache
- x402 transaction freshness checks (
X402_MAX_TX_AGE_SECONDS) - Namespaced memory isolation by auth tier
NODE_ENV=productionALLOW_APIKEY_QUERY=false- Correct
TRUST_PROXYvalue for your reverse-proxy topology - Set strict
SSE_ALLOWED_HOSTSandSSE_ALLOWED_ORIGINS - For multi-instance deployments, set
REDIS_URLfor shared rate-limit state - Keep
X402_TEST_MODE=0(test mode is ignored in production) - Use
STRIPE_WEBHOOK_IP_ALLOWLISTwhen your ingress path has stable source IPs - Enforce webhook source filtering at the edge (WAF/reverse proxy), not only app layer
- Persist:
KEYS_FILEMEMORY_DB_PATHX402_TX_CACHE_FILE
Recommended: restrict POST /billing/webhook at your reverse proxy/WAF to known Stripe source ranges and HTTPS only.
Defense in depth order:
- Edge source filtering (IP/rules)
STRIPE_WEBHOOK_IP_ALLOWLISTin app- Stripe signature verification (
STRIPE_WEBHOOK_SECRET)
- Never commit real secrets to git (
.env,.env.*, API keys, private keys). - Keep runtime secrets in deployment secret stores (not in repository files).
- Before release, run:
git grep -nE "(ghp_|gho_|sk_live_|AKIA|xox[baprs]-|BEGIN (RSA|EC|OPENSSH|PRIVATE) KEY)" HEAD- Run
npm auditin CI. - This repo uses an override for
express-rate-limitto avoid a known high-severity advisory in transitive deps.
If you find a vulnerability, open a private report to the maintainers before public disclosure.