NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · Other MCP servers and tools

GHSA-62gx-5q78-wrvx: obsidian-local-rest-api: Authenticated path traversal via URL-encoded %2F in /vault/{path} — arbitrary host file read/write/delete

highCVSS 3.1 8.8

The obsidian-local-rest-api plugin lets an authenticated client read, write or delete any file the Obsidian process can reach, by sending a percent-encoded slash (%2F) in a /vault/{path} URL. It affects versions before 4.1.3. The release notes for 4.1.3 describe the fix, though the advisory's patched-version field says None. The plugin is often used as an MCP server for AI agents.

Published Jul 15, 2026 · Updated Nov 2, 2026 · Analysis Nov 1, 2026

What an attacker can do

In src/requestHandler.ts, the handlers vaultGet, vaultPut, vaultPatch, vaultPost and vaultDelete call decodeURIComponent on the request path after Express has routed it. A literal ../ is collapsed or rejected during routing and returns 404. But %2F is not a separator at that stage, so ..%2F..%2F passes routing and the handler turns it into a real ../../. %2e%2e behaves the same. The decoded path then goes to the vault adapter (readBinary, getAbstractFileByPath) with no check that it stays inside the vault. Only vaultMove has such a check.

The attacker needs the API key (CVSS: low privileges, network). With it, a curl --path-as-is request to /vault/..%2F..%2F..%2F..%2Fetc%2Fpasswd returns the file, and a PUT creates files outside the vault. Reach is limited to what the Obsidian user can access: SSH keys, browser profiles, dotfiles, credentials.

The AI angle is the main risk. The advisory notes the API is widely used as an MCP server. A prompt injection hidden in vault notes, or a malicious MCP client, can make an agent emit a %2F path. That turns note editing into access to the whole host filesystem, without the user ever granting it.

Who is affected

All versions of the npm package obsidian-local-rest-api below 4.1.3. The plugin listens on HTTPS port 27124 by default in the advisory's examples. Check the installed plugin version in Obsidian under Settings, Community plugins, or from the plugin's manifest in your vault:

grep '"version"' .obsidian/plugins/obsidian-local-rest-api/manifest.json

Any version under 4.1.3 is vulnerable.

obsidian-local-rest-api

Ecosystem
npm
Affected
< 4.1.3
Fixed in
4.1.3
Check
npm ls obsidian-local-rest-api

How to fix it

The advisory data lists no patched version. However, the 4.1.3 release notes say they fix the authenticated path traversal in the /vault/{path} endpoints, where a percent-encoded slash could escape the vault root. Update the plugin to 4.1.3 or later and confirm the version afterwards.

The advisory gives no user-side workaround. Until you update, disable the plugin or keep the API key away from agents and untrusted clients.

How to tell if you were hit

Search any reverse-proxy, access or MCP tool-call logs for requests to /vault/ containing %2F.., ..%2F, %2e%2e or %2E%2E. Look for files you did not create outside the vault, such as new files in /tmp or your home directory, and for unexpected reads of ~/.ssh or /etc/passwd. If an agent talks to this API, Beam's record of its MCP tool calls and file access can show the encoded paths it sent.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

The Local REST API's /vault/{path} endpoints (GET/PUT/PATCH/POST/DELETE) percent-decode the request path *inside the handler — after* Express has already routed and normalized it, then hand it to the Obsidian vault adapter with no confinement check. A literal ../ is resolved/rejected at the routing layer (→ 404), but %2F is not a separator there, so ..%2F..%2F survives routing and is only turned into a real / by the handler's decodeURIComponent, reconstituting a ../ traversal that walks out of the vault. An authenticated client can read, write, or delete arbitrary files on the host with the Obsidian process's privileges.

Details

Framework: Express (import express from "express"; routes registered via this.api.route("/vault/*")…).

The vulnerable line — in src/requestHandler.ts, every vault handler (vaultGet, vaultPut, vaultPatch, vaultPost, vaultDelete) derives the path like this:

  const rawPath = decodeURIComponent(
    req.path.slice(req.path.indexOf("/", 1) + 1),
  );

The path is decodeURIComponent'd after Express routing. A literal ../ is collapsed/rejected at the routing layer, but %2F isn't a separator there — so ..%2F..%2F reaches the handler intact and this decodeURIComponent turns it into a real ../../. The string routing saw (`…%2F…`) is not the string the handler uses (`…/…`), and %2e%2e behaves the same way.

No confinement on the decoded path. The handlers pass rawPath straight to the vault adapter — e.g. this.app.vault.adapter.readBinary(filePath) / this.app.vault.getAbstractFileByPath(filePath) — with no path.resolve + vault-root prefix check, so the reconstituted ../../ escapes.

The fix already exists in your code — for MOVE only. vaultMove confines correctly:

  const syntheticRoot = "/vault";
  const resolved = posix.resolve(syntheticRoot, normalized);
  if (resolved !== syntheticRoot && !resolved.startsWith(syntheticRoot + "/")) {
    this.returnCannedResponse(res, { errorCode: ErrorCode.PathTraversalNotAllowed });
    return;
  }

GET/PUT/PATCH/POST/DELETE lack this guard. Apply the same `posix.resolve(syntheticRoot, …)` + `startsWith` check to the decoded path in every vault handler, and reject any segment that decodes to ...

PoC

Prereq: a running Obsidian with the Local REST API plugin enabled and its configured API key ($API_KEY). Targets below are Unix; adjust per OS (e.g. ..%2F..%2FWindows%2Fwin.ini on Windows).

  # READ outside the vault (returns 200 + the target file's real bytes):
  curl --path-as-is -k -H "Authorization: Bearer $API_KEY" \
    "https://127.0.0.1:27124/vault/..%2F..%2F..%2F..%2Fetc%2Fpasswd"

  # WRITE outside the vault (creates a file on disk outside the vault root):
  curl --path-as-is -k -X PUT -H "Authorization: Bearer $API_KEY" --data "pwned" \
    "https://127.0.0.1:27124/vault/..%2F..%2F..%2Ftmp%2Fcanary.txt"

--path-as-is stops curl from collapsing .. client-side. A plain ../ (unencoded) request returns 404 — only the %2F/%2e%2e encoded form bypasses, confirming the decode-after-routing gap.

Impact

Authenticated arbitrary file read / write / delete outside the Obsidian vault, with the OS privileges of the Obsidian process — typically the user's home directory (SSH keys, browser profiles, dotfiles, credentials). Amplified in MCP/LLM-agent deployments: this API is widely used as an MCP server, so a prompt-injection in vault content (or a malicious MCP client) can make an agent emit a %2F path — turning "the agent can edit my notes" into "the agent can read/write any file on the host," with no user intent to grant filesystem access beyond the vault.

This vulnerability was reported by Caleb Brisbin through responsible disclosure.

Credited to AgenticWizard, zuhairhalawa.

Questions

Does an attacker need the API key?

Yes. The advisory describes an authenticated flaw: the client must send a valid Bearer token. The risk is a leaked key, an untrusted MCP client, or an agent steered by prompt injection that already holds the key.

Why does a plain ../ not work?

Express resolves or rejects a literal ../ at the routing layer and returns 404. The encoded %2F form survives routing and is decoded later by the handler, so the check and the use see different strings.

Is version 4.1.3 patched?

The 4.1.3 release notes say it fixes the traversal. The advisory's patched field says None, which conflicts, so confirm by upgrading and re-testing with an encoded path.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More Other MCP servers and tools vulnerabilities

All Other MCP servers and tools entries