Part of the origin-side abuse protection plan (assuming Akamai Bot Manager removal). Follows the merged PR1 #2263 (shared rate limiter + tiering) and PR2 #2264 (edge-cache Fast-Purge hook + flag-coupled s-maxage).
Scope (plan §6)
WAF-equivalent input validation on the anonymous / agentic write surface. DB-flag gated, fail-open, no new BTP entitlements.
- Anon
POST bodies: body-size caps + JSON depth/shape limits before handlers run.
- GraphQL
/graphql/public: query depth + complexity limit, and introspection off in prod.
- MCP / A2A: reuse the
clampLimit pattern in srv/lib/mcp-arg-validators.js.
- The existing SELECT-only allowlist validator
srv/lib/analytics-sql-validator.cjs stays as its own layer (not replaced).
Notes / constraints
- New
srv/lib/* modules reachable from content-store.js must be added to the .deploy/mta.yaml srv-qa cp list (QA boot crashes otherwise).
- Feature flag must be registered in
srv/lib/feature-flags/registry.js (kind:'db') or it won't surface in the admin Feature Flags UI; update test/unit/feature-flags-registry.test.js.
- Numeric thresholds go in an ImsConfig-backed runtime-config module (~5s cache), env-free (blue-green drops
cf set-env).
- Fail-open everywhere; never throw into a request tx.
Verification
- Unit (
npm test): GraphQL depth rejection, body-size/JSON-depth clamps, config resolution, registry drift test.
- Manual: oversized/deeply-nested POST rejected; GraphQL introspection query blocked on
/graphql/public; deep query rejected; valid queries unaffected.
Default OFF; enable on DEV, observe, then PROD.
Part of the origin-side abuse protection plan (assuming Akamai Bot Manager removal). Follows the merged PR1 #2263 (shared rate limiter + tiering) and PR2 #2264 (edge-cache Fast-Purge hook + flag-coupled s-maxage).
Scope (plan §6)
WAF-equivalent input validation on the anonymous / agentic write surface. DB-flag gated, fail-open, no new BTP entitlements.
POSTbodies: body-size caps + JSON depth/shape limits before handlers run./graphql/public: query depth + complexity limit, and introspection off in prod.clampLimitpattern insrv/lib/mcp-arg-validators.js.srv/lib/analytics-sql-validator.cjsstays as its own layer (not replaced).Notes / constraints
srv/lib/*modules reachable fromcontent-store.jsmust be added to the.deploy/mta.yamlsrv-qacplist (QA boot crashes otherwise).srv/lib/feature-flags/registry.js(kind:'db') or it won't surface in the admin Feature Flags UI; updatetest/unit/feature-flags-registry.test.js.cf set-env).Verification
npm test): GraphQL depth rejection, body-size/JSON-depth clamps, config resolution, registry drift test./graphql/public; deep query rejected; valid queries unaffected.Default OFF; enable on DEV, observe, then PROD.