Stored XSS Vulnerability Report – mcp-context-forge
Summary
A Stored Cross-Site Scripting (XSS) vulnerability exists in the [mcp-context-forge](https://github.com/IBM/mcp-context-forge) project. The issue allows an attacker to persistently inject JavaScript payloads into the MCP Admin UI via Global Prompts feature. When a user views the template, the JavaScript executes in the browser context, enabling full UI compromise, phishing, or Potential keystroke logging or fake login overlays.
PoC
1. After login go to "Global Prompts" feature.
2. Then look at the Add new prompt.
3. Add name and description as you want.
4. In the Template section add this below code to prove that it is vulnerable to stored xss.
for identification of XSS you can use below input in template section
<img src=x onerror="alert('XSS Executed')">
For UI defacement you can use below input
<img src=x onerror="document.body.innerHTML='<h1 style=color:red;text-align:center;margin-top:20%>🔥 This MCP Gateway is Compromised 🔥</h1><p style=text-align:center>Reported by DevSec Hacker</p>';">
https://github.com/user-attachments/assets/13682ace-ec1c-4bc2-b9d0-be95ce0285b8
5. Then click on Add Prompt button
6. Go to available prompts
7. click on view button for this prompt that we saved.
8. BOOM!!!
9. it will work.
https://github.com/user-attachments/assets/134177cf-3caf-4705-a89b-e1afb900a40b
Impact
JavaScript execution in the context of...
Affected versions
| Package | Affected | Fixed in |
|---|---|---|
| mcp-context-forge-ui Product | < 0.3.1 | 0.3.1 |
Details and references
### Summary A Stored Cross-Site Scripting (XSS) vulnerability exists in the [mcp-context-forge](https://github.com/IBM/mcp-context-forge) project. The issue allows an attacker to persistently inject JavaScript payloads into the MCP Admin UI via Global Prompts feature. When a user views the template, the JavaScript executes in the browser context, enabling full UI compromise, phishing, or Potential keystroke logging or fake login overlays. ### PoC 1. After login go to "Global Prompts" feature. 2. Then look at the Add new prompt. 3. Add name and description as you want. 4. In the Template section add this below code to prove that it is vulnerable to stored xss. for identification of XSS you can use below input in template section `<img src=x onerror="alert('XSS Executed')">` For UI defacement you can use below input `<img src=x onerror="document.body.innerHTML='<h1 style=`color:red;text-align:center;margin-top:20%`>🔥 This MCP Gateway is Compromised 🔥</h1><p style=`text-align:center`>Reported by DevSec Hacker</p>';">` https://github.com/user-attachments/assets/13682ace-ec1c-4bc2-b9d0-be95ce0285b8 5. Then click on Add Prompt button 6. Go to available prompts 7. click on view button for this prompt that we saved. 8. BOOM!!! 9. it will work. https://github.com/user-attachments/assets/134177cf-3caf-4705-a89b-e1afb900a40b ### Impact JavaScript execution in the context of the Admin UI Full UI defacement or phishing attacks Potential keystroke logging or fake login overlays
- Severity from
- GitHub (reviewed advisory)
- Weakness
- CWE-79