Details
Who is affected
Anyone running excel-mcp-server in SSE or Streamable-HTTP mode on a reachable network — which is the documented and recommended deployment for remote use. The project README explicitly states:
- *"Works both locally and as a remote service"*
- *"Streamable HTTP Transport (Recommended for remote connections)"*
The server has 3,655+ GitHub stars and is published on PyPI with active downloads.
---
Suggested Fix
Replace get_excel_path() with a version that enforces the sandbox boundary:
import os
def get_excel_path(filename: str) -> str:
if EXCEL_FILES_PATH is None:
# stdio mode: local caller is trusted
if not os.path.isabs(filename):
raise ValueError("must be absolute path in stdio mode")
return filename
# Remote mode (SSE / streamable-http): enforce sandbox
if os.path.isabs(filename):
raise ValueError("absolute paths are not permitted in remote mode")
if "\x00" in filename:
raise ValueError("NUL byte in filename")
base = os.path.realpath(EXCEL_FILES_PATH)
candidate = os.path.realpath(os.path.join(base, filename))
if not candidate.startswith(base + os.sep) and candidate != base:
raise ValueError(f"path escapes EXCEL_FILES_PATH: {filename}")
return candidate
References