Please report security issues responsibly.
- Include steps to reproduce and expected impact
- Avoid public exploit details until a fix is available
Use GitHub Security Advisories for this repository if available.
If not, open an issue with minimal details and mark it security-sensitive so we can move privately.
Affected: servers built from this template before commit c87bc07 (merged 2026-11-18), including the paidmcp/examples servers before their matching fix.
Impact: anyone could call paid tools without paying:
- Free trial never ran out. Trial calls were never counted, so every caller kept getting free calls.
- Batch requests skipped payment. A
tools/callsent inside a JSON-RPC batch ([{...}]) ran without payment. - A disguised
Content-Typeskipped payment and the request size limit. - Callers chose their own trial identity through an
x402-payerheader, so a new value meant new free calls.
The same fix also stops charging callers when a paid tool fails, makes test mode work again (new default facilitator https://x402.org/facilitator, and the correct Base Sepolia USDC token name), and upgrades the MCP SDK and x402 packages, which had security advisories.
Are you affected? Search your src/server.ts for Batch requests are not supported. If it isn't there, your server predates the fix:
grep -q "Batch requests are not supported" src/server.ts && echo "fixed" || echo "AFFECTED: update"How to update:
- Copy these files from this repository into your server, keeping your own
src/tools.ts:src/server.ts,src/config.ts,src/payments.ts,src/log.ts,src/scripts/setup.tspackage.jsondependency versions andpackage-lock.json.env.example, for reference on the new settingstest/andtsconfig.test.json
- Check your settings:
FREE_TRIAL_CALLSnow defaults to 10 in test mode and 0 in live mode. Set it explicitly if you want live trials; they are limited per client IP.- Behind Fly.io or Railway, set
TRUST_PROXY=1so trials are counted per real client IP.deploy/fly.tomlalready does this. BASE_RPC_URL,USDC_ADDRESSandBASE_FACILITATOR_URLcan be left empty to use the defaults forNETWORK_MODE.
- Run
npm installand thennpm run check. The tests start your server against a fake facilitator and confirm each bypass is closed. - Redeploy.