taliawedged117/census-mcp-server/security-pass
Claude Code and agent skill by taliawedged117/census-mcp-server
- community
Checking that the SKILL.md file is still in the repository.
Review an MCP server for common security gaps: LLM-facing surfaces as injection vector (tools, resources, prompts, descriptions), scope blast radius, destructive ops without consent, upstream auth shape, input sinks (URL / path / roots / shell / sampling / schema strictness / ReDoS), tenant isolation, leakage through errors and telemetry, unbounded resources, and HTTP-mode deployment surface. Use before a release, after a batch of handler changes, or when the user asks for a security review, audit, or hardening pass. Produces grouped findings and a numbered options list.
Install
npx vskill@latest install taliawedged117/census-mcp-server/security-passSKILL.md
The same SKILL.md was published earlier as taliawedged117/census-mcp-server/security-pass.
Context
An MCP server is a new attack surface with unique properties — tool output feeds back into the LLM's context, scopes gate what the model can do on the user's behalf, and per-request state must stay tenant-scoped. This skill walks a server through eight axes shaped around what the server builder actually controls. Framework-level concerns (transport, JSON-RPC parsing, auto-correlation, error classification) are out of scope — mcp-ts-core handles those.
Read the code. Don't trust patterns from memory.
When to Use
- Before a release
- After adding or modifying a batch of handlers or services
- Periodically (quarterly-ish)
- User asks for a "security review", "audit", "hardening pass", or similar
Inputs
Gather before starting. Ask if unclear:
- Scope — whole server, specific module, or recent diff?
- Known concerns — anything the user already suspects?
- Deployment context — multi-tenant? public network? auth mode? (stdio / local-http / public-http behave differently)
- Severity floor — report all findings, or skip medium/low?
Steps
1. Build the map
Surface what you're auditing before diving in. Paths below assume the mcp-ts-core layout — adjust to your repo.
Note: tool / resource / prompt counts, auth mode, storage provider, upstream APIs, which tools have destructiveHint, which handlers use ctx.sample or ctx.elicit, which services hold module-scope state, whether the server reads roots.
If transport is streamable HTTP or SSE, also capture:
- Bind address (
127.0.0.1for local, or0.0.0.0/ public interface?) - Origin allowlist (DNS rebinding mitigation) — configured, or wildcard / missing?
- Session ID source (framework CSPRNG, or builder-supplied?) and binding to auth identity
- Any unauthenticated routes (
/healthz,/sse, metadata endpoints) — do they leak tool lists or tenant hints? - MCP Authorization spec: if implemented, PKCE enforced, token audience (
aud) checked, resource indicators used
If `CANVAS_PROVIDER_TYPE=duckdb` is set, also capture:
- Auth mode — canvas in
MCP_AUTH_MODE=nonecollapses the composite(tenantId, canvasId)scope to('default', canvasId), where the ID is the only differentiator CANVAS_MAX_CANVASES_PER_TENANT,CANVAS_TTL_MS,CANVAS_ABSOLUTE_CAP_MS,CANVAS_EXPORT_PATHvalues- Whether external rate limiting (CDN, reverse proxy, WAF) fronts the deployment — required to keep the ~10¹⁸ canvasId keyspace operationally infeasible to brute-force
Use TaskCreate — one task per axis. Mark complete as you go.
Run `fuzzTool` in parallel. @cyanheads/mcp-ts-core/testing/fuzz catches crashes, memory leaks, and prototype pollution automatically on each tool — start it now so results are ready when you reach Axis 5.
2. Walk the eight axes
Axis 1 — LLM-facing surfaces as injection vector
Anything the server sends to the client that reaches the LLM's context is a potential injection surface: tool output, resource content, prompt text, and the metadata the LLM reads to decide what to call. Relayed upstream content (tickets, scraped text, emails, DB rows) can carry adversarial instructions even when your code is honest.
Look in:
- Every
*.tool.ts—outputschema +format() - Every
*.resource.ts— content returned fromresources/read - Every
*.prompt.ts— templated message content - Every definition file —
description,title,annotations, andinputSchemafield descriptions (templated from untrusted data?)
Check:
- Handlers that return raw upstream text / DB rows without structural framing?
- Does
format()wrap untrusted content in delimiters (blockquote, fenced code,<data>tags)? - Output schema distinguishes "data" fields from free-form text?
- Resource content (
resources/read) framed the same way tool output is? - Prompt templates interpolate untrusted data without escaping — treating tenant-controlled strings as trusted instructions?
- Tool / resource / prompt descriptions templated from runtime data? Static strings are safer; templated descriptions enable "tool poisoning" (adversarial metadata steering the LLM toward a dangerous tool).
- Descriptions mutated mid-session? Rug-pull surface: client approved the v1 description, server now advertises v2 behavior.
Smell: return { body: await fetch(url).then(r => r.text()) } rendered directly in format(). Or: description: \Look up ${tenant.customLabel}\` where customLabel` is tenant-supplied.
Axis 2 — Scope granularity
Every auth: [...] entry is a blast-radius dial.
Look in: every *.tool.ts — auth: array.
Check:
- Tools with
['admin'],['*'], or[]? - A single scope covering two capabilities that should be separated (read vs write)?
- Read-only tools never require write scopes?
MCP_AUTH_DISABLE_SCOPE_CHECKS=trueset in production? When on, bothwithRequiredScopesandcheckScopesearly-return — every authenticated user gets every tool, and runtime tenant patterns liketeam:${input.teamId}:writeno longer guard. Acceptable only when paired with a real server-side ACL (path filter, allowlist, upstream API enforcement).
Smell: every tool shares the same scope string. Or: MCP_AUTH_DISABLE_SCOPE_CHECKS=true set without a documented compensating ACL — confirm the deployment relies on a meaningful access control layer below the framework before approving.
Axis 3 — Destructive ops without elicit
ctx.elicit moves consent off the LLM and onto the user. Destructive tools without it trust the LLM not to be tricked.
Look in: handlers with destructiveHint: true or side-effecting verbs in names (delete_*, send_*, pay_*, publish_*, drop_*).
Check:
- Each destructive handler calls
ctx.elicitbefore the side effect? - Fallback when client doesn't support elicit — refuses, not silently proceeds?
- Elicit response validated against a Zod schema before use? The returned payload is LLM-mediated, not user-direct — "user confirmed" does not mean "user authored these exact fields."
- Consent is scoped to the specific target (e.g., record ID rendered in the prompt), not a generic "proceed?"
Smell: destructiveHint: true file with no ctx.elicit?.(...) in it. Or: const { confirmed } = await ctx.elicit(...) without a schema — confirmed could be anything.
Axis 4 — Upstream auth shape
What credentials the server holds, and the blast radius if one leaks.
Look in: src/services/*, src/config/server-config.ts.
Check:
- Each upstream API key scoped to minimum required? (No admin keys for read workflows.)
- Services re-mint downstream tokens with correct
aud, or passthrough the caller's? - Server holds OAuth for N services × M tenants — what does one-tenant compromise expose?
- Per-tenant rate limits on upstream calls?
Smell: one global API_KEY used across all tenants + retry loop with no upper bound.
Axis 5 — Input sinks
LLM-supplied inputs feel internal but aren't. Classic sinks apply, amplified. Sampling responses and roots-derived paths are MCP-specific sinks that look internal but carry LLM/client trust.
Look in: all handlers.
Check:
- URL-taking tools block private IPs,
file://,ftp://,localhost, DNS rebind? - Path-taking tools canonicalize (
path.resolve+ assertstartsWith(root + sep))? - Roots-derived paths: resolved result stays within one declared root (iterate and assert), not assumed-safe because "the client said so"?
- Shell-using tools use an allowlist (never string-concat)?
- Regex / glob / filter inputs bounded (length cap, complexity limits, execution timeout) — ReDoS-safe?
- User-JSON merges reject
__proto__,constructor,prototypekeys? - Input schemas `.strict()` — unknown fields rejected, not silently passed to downstream code that destructures with
...rest? - Output schemas without `.passthrough()` / `.catchall()` — no accidental exfiltration of fields your schema didn't declare?
- Sampling responses (
ctx.sampleresult) treated as untrusted input — schema-validated before reaching any other sink, never concatenated into prompts, shells, or queries?
Smell: z.string().url() with no allowlist; readFile(input.path) with no canonicalization; await ctx.sample(...) result interpolated into a shell, SQL, or URL.
Axis 6 — Tenant isolation
ctx.state is tenant-scoped. Module-scope state is not.
Look in: src/services/*.
Check:
- Module-scope
Map/Set/ cache near tenant-handling code? - Upstream connections pooled per-tenant or shared?
- Any code path uses the global
loggerwhile carrying per-tenant data (bypassing auto-correlatedctx.log)? - Could tenant B, served after tenant A, read tenant A's cached data?
Smell: service file with top-level const cache = new Map().
Axis 7 — Leakage back
What accidentally reaches the LLM, user, or observability sinks.
Look in: throw new McpError(...) and ctx.fail(reason, msg, data) sites, error factory calls (notFound, httpErrorFromResponse, …), McpError.data fields (the data arg flows through both paths), output schemas, and every logging / telemetry surface — not just ctx.log.
Check:
- Error
datafields (whether passed viactx.fail(reason, msg, data),new McpError(code, msg, data), or factory calls) carry upstream response bodies, auth headers, stack traces? httpErrorFromResponsebody capture sweeping in too much (default 500-byte cap is fine for most APIs but considercaptureBody: falsewhen the upstream returns auth-bearing payloads)?- Output schemas include token prefixes, internal IDs, session identifiers?
format()renders fields that shouldn't leave the server?ctx.log.info(msg, body)wherebodyis the raw request (may contain secrets)?console.*calls near auth / token / request-body handling — bypasses structured redaction?- OpenTelemetry span attributes / Sentry breadcrumbs carry tokens, PII, or full request bodies?
- Secret / token / HMAC comparisons use
===or==instead of constant-time (timingSafeEqual/crypto.timingSafeEqual) — leaks length and prefix via timing?
Smell: throw new McpError(code, upstream.message, { raw: upstream.body }) or throw ctx.fail('upstream_failed', e.message, { raw: e.response.body }). Or: if (apiKey === expected) on a request-auth path.
Axis 8 — Resource bounds
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/security-pass/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/taliawedged117/census-mcp-server/security-pass)