TMAegis
mcp-server 관련 규칙 더 보기

TMA-MCP-5.1.1

Ensure tool schemas and argument types are validated

높음레벨 1자동mcp-server

설명

The server validates every tool input and output against the tool's advertised schema at the server middleware layer before the tool executes. Validation uses the JSON Schema dialect each schema declares in $schema, defaulting to 2020-12 when none is declared. A tools/call request that fails the CallToolRequest structure is a protocol error. A well-formed call whose arguments fail the tool's input schema is surfaced as a tool execution error in a normal result with isError set to true, not as a -32602 protocol error. Where a tool declares an outputSchema, the server returns structured results that conform to it. The server sanitizes the whole tool schema, including tool names, parameter names, descriptions, and outputs, not only inputSchema. The validator accepts the full schema vocabulary the 2026-07-28 revision permits, including composition keywords, conditionals, and internal $ref...

점검 방법

감사 방식: 셸 명령

shell
cfg="${MCP_CONFIG:-/etc/mcp/server.json}"; [ -f "$cfg" ] || { echo "missing $cfg (set MCP_CONFIG)"; exit 1; }; grep -Eq '"cis_5_1_1"|"protocolVersion"|"capabilities"|"auth"' "$cfg" && echo compliant || echo "non-compliant: section 5.1.1"
예상 출력
compliant

조치 방법

조치 방식: 가이드 또는 인프라 패치

Add a validation middleware layer that runs before tool dispatch and validates every tool call's arguments against the tool's input schema under the dialect the schema declares. Return a schema-violating call as a tool execution error in a normal result with isError set true, and reject a structurally malformed tools/call request as a protocol error. Where a tool declares an outputSchema, validate the structured result against it before returning. Sanitize all schema fields, meaning tool names, parameter names, descriptions, and outputs, not only inputSchema, before they reach the model or downstream use. Tighten schemas to strict types, disallow additionalProperties where appropriate, and mark required fields. Configure the validator so it does not auto- dereference external $ref URIs, and bound schema depth and validation time. This is server middleware and configuration, and the exact validator is implementation-specific, for example ajv for TypeScript servers, so there is no portable command.

속성

운영 체제
모두
태그
aimcpmcp-server
참고 자료
CIS MCP Server Benchmark v1.0.0 - 5.1.1 Ensure tool schemas and argument types are validated

이 호스트 점검하기

감사 권한이 있는 시스템에서 실행하세요. 스캔은 읽기 전용입니다.

shell
tmaegis scan --target mcp-server