Skip to content

Commit 74dc0de

Browse files
ssaumitraclaude
andauthored
DX-119567: Fix security vulnerabilities in MCP Server (#105)
Addresses 57 Trivy-flagged CVEs (3 CRITICAL, 17 HIGH) via three tracks: 1. Delete src/dremioai/servers/frameworks/ (langchain + beeai) which is unused by the live dremio-mcp-server path. This drops langchain*, langgraph, and beeai-framework from the dependency tree, eliminating ~18 CVEs incl. CVE-2025-68664 (CRITICAL). 2. Remove litellm (no imports in codebase) to drop CVE-2026-35030 (CRITICAL), CVE-2026-35029 (HIGH), and GHSA-69x8-hrgq-fjj8 (HIGH). 3. Bump direct and transitive dependencies to fixed versions: aiohttp, black, mcp, requests, starlette, pytest; plus lower bounds for h11 (CRITICAL CVE-2025-43859), python-multipart, orjson, setuptools, urllib3, cryptography, filelock, python-dotenv, and pygments. Route regex fix in mcp.py: The mcp upgrade (1.10 -> 1.27) tightened the streamable-HTTP route to an exact match on "/mcp" (path_regex ^/mcp$). This broke the project-id-prefixed URL pattern "/mcp/<project_id>/" that ProjectIdMiddleware extracts and the e2e PAT tests rely on -- the request 404'd before middleware could run. After registering ProjectIdMiddleware, we loosen the Route's path_regex to also match "/mcp/<project_id>/..." so the middleware has a chance to pull the project id out of the URL. The middleware itself is unchanged. Test plan: - Ran `trivy filesystem .` after the changes and confirmed zero HIGH/CRITICAL findings remain in uv.lock (down from 57). - Ran the full pytest suite: 341 passed, 0 failed. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 613f940 commit 74dc0de

10 files changed

Lines changed: 1429 additions & 2787 deletions

File tree

docs/frameworks.md

Lines changed: 0 additions & 62 deletions
This file was deleted.

docs/settings.md

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -96,44 +96,6 @@ prometheus:
9696
token: <string> # Authentication token
9797
```
9898

99-
### LangChain Settings (Experimental)
100-
101-
The Tools defined in the `tools` section can be used with LangChain if required as well. The LangChain integration depends on `openai` or `ollama` for LLM. The [src/dremoiai/servers/frameworks/langchain/server.py] supplies a command line interface showing the integration.
102-
103-
```yaml
104-
langchain:
105-
llm: <Model> # LLM type (ollama/openai)
106-
openai:
107-
api_key: <string> # OpenAI API key
108-
model: <string> # Model name (default: gpt-4)
109-
org: <string> # Optional: Organization ID
110-
ollama:
111-
model: <string> # Model name (default: llama3.1)
112-
```
113-
114-
### BeeAI Settings (Experimental)
115-
116-
[BeeAI](https://github.com/i-am-bee/beeai-framework) framework supports MCP as well as multiple LLM providers. The [src/dremoiai/servers/frameworks/beeai/server.py] supplies a command line interface showing this integration.
117-
118-
```yaml
119-
beeai:
120-
mcp_server:
121-
command: "uv"
122-
args:
123-
- "run"
124-
- "--directory"
125-
- "<toplevel git directory>"
126-
- "dremio-mcp-server"
127-
- "run"
128-
sliding_memory_size: <int> # Memory window size
129-
anthropic:
130-
api_key: <string> # Anthropic API key
131-
chat_model: <string> # Chat model name
132-
openai: <OpenAI> # OpenAI settings (same as LangChain)
133-
ollama: <Ollama> # Ollama settings (same as LangChain)
134-
```
135-
136-
13799
## Configuration Methods
138100

139101
### File-based Configuration

0 commit comments

Comments
 (0)