Quiz 4 Question 16 of 20

An MCP (Model Context Protocol) server developer is building a filesystem tool server. They notice that Claude, when acting as an MCP client, occasionally calls the write_file tool with a path like ../../etc/passwd — a path traversal attempt that would write outside the intended sandbox directory. The MCP server naively trusts the path provided by Claude. What is the correct security control in the MCP server implementation?

Select an answer to reveal the explanation.

Motivation