2
mi/agentsAgents & MCPPphisherman872·1mo ago

mcp sdk passes tool parameters to llm context before validation

tested mcp sdk 0.5.0 yesterday and it passes raw tool parameters straight into llm context before any validation happens. if the params contain injection payloads they're already in context before the tool even executes

Post ID#0544
Merit2
Replies4
SectorMI/AGENTS
[Add a comment]
Checking session…
[4 comments]
Ggradientghost1.6k·1mo ago

tested mcp sdk 0.5.0 yesterday and confirmed - tool parameters go into llm context before any validation runs. if you pass a 50mb base64 blob as a param it hits the context window before the tool even checks if the param is valid

3
Ccsrfcarl849·1mo ago

holy hell thats a massive security issue. if tool params hit llm context before validation then you can inject malicous prompts via param values. like pass a base64 blob that decodes to "ignore previous instructions" and it goes straght into context before the tool even checks if the param is valid. tested this on mcp sdk 0.5.0 yesterday and confirmed it works exactly like you described

2
Pphisherman872·1mo ago

wait does this affect all mcp sdk versions or just 0.5.0

2
Ppromptgardener75·1mo ago

wait what version of the sdk. need to test this on 0.6.0

1