Metadata-Version: 2.4
Name: vuln-mcp-filesystem-workspace-actions
Version: 0.1.0
Summary: Intentionally vulnerable MCP server for security training — filesystem ops with path traversal and code execution flaws
Author: Riyaz Walikar
License: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Education
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Security
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# vuln-mcp-filesystem-workspace-actions

**Intentionally vulnerable MCP server** for AI security pentesting training.

Exposes filesystem tools (read/write/list/execute) with deliberate path traversal and code execution vulnerabilities. The server accepts a workspace directory but path validation is naive — `../../../etc/passwd` escapes the workspace.

**DO NOT use in production. This is a training target.**

## Tools

| Tool | Vulnerability |
|------|--------------|
| `read_file` | Path traversal — reads any file on the filesystem |
| `write_file` | Path traversal — writes to any location the process can access |
| `list_directory` | Path traversal — lists any directory on the system |
| `execute_code` | Arbitrary Python code execution, no sandboxing |

## Usage

```bash
# Run via uvx (after publishing to PyPI)
uvx vuln-mcp-filesystem-workspace-actions /path/to/workspace

# Or locally
python -m vuln_mcp_fs /path/to/workspace
```

## MCP Client Configuration

`.mcp.json`:

```json
{
  "mcpServers": {
    "vuln-filesystem": {
      "command": "uvx",
      "args": [
        "vuln-mcp-filesystem-workspace-actions",
        "/path/to/workspace"
      ]
    }
  }
}
```

## Lab Exercises

1. **Path traversal:** Ask the agent to `read_file` with path `../../../etc/passwd`
2. **Write outside workspace:** `write_file` to `../../../tmp/pwned.txt`
3. **Code execution:** Use `execute_code` to run `__import__('os').system('id')`
4. **Chain attacks:** Read `.env` files, SSH keys, or AWS credentials from the host
