CVE-2026-40576: excel-mcp-server has a Path Traversal issue
excel-mcp-server 0.1.7 and earlier let an unauthenticated network client read, write and overwrite files anywhere on the host when run in SSE or Streamable-HTTP mode. `get_excel_path()` does not enforce the `EXCEL_FILES_PATH` sandbox. Upgrade to 0.1.8.
Published Apr 14, 2026 · Updated Oct 27, 2026 · Analysis Oct 30, 2026
What an attacker can do
get_excel_path() in src/excel_mcp/server.py has two flaws. An absolute path is returned unchanged (line 86), so the sandbox is never consulted. A relative path is joined onto EXCEL_FILES_PATH with os.path.join and no realpath or commonpath check (line 94), so ../ escapes it. All 25 @mcp.tool() handlers call it first.
Two things make it worse. The default bind address is 0.0.0.0 (FASTMCP_HOST), so uvx excel-mcp-server streamable-http listens on every interface. And the SSE and Streamable-HTTP transports have no authentication. Anyone who reaches port 8017 can call any tool.
The reporter confirmed seven primitives on a live server: write outside the sandbox by absolute path and by ../, directory creation anywhere writable (workbook.py runs mkdir(parents=True)), reading another workbook's data, overwriting a victim spreadsheet, and attempting to open /etc/hostname. Targets are .xlsx files, so the loss is spreadsheet data, corrupted business files, disk fill, and planted macro templates. The stdio transport is not network-facing.
Who is affected
PyPI excel-mcp-server 0.1.7 and earlier, in sse or streamable-http transport mode. Check:
pip show excel-mcp-serverAlso check how the server was started and whether port 8017 is reachable from other hosts, and whether FASTMCP_HOST was set.
excel-mcp-server
- Ecosystem
- PyPI
- Affected
- <= 0.1.7
- Fixed in
- 0.1.8
- Check
pip show excel-mcp-server
How to fix it
Upgrade to 0.1.8:
pip install -U "excel-mcp-server>=0.1.8"As interim steps from the advisory's facts: set FASTMCP_HOST=127.0.0.1 so the server does not listen on all interfaces, and put authentication in front of the port. Restrict the process to a directory it needs, with no write access elsewhere.
How to tell if you were hit
Look for .xlsx files and directories created outside the EXCEL_FILES_PATH directory, and for spreadsheets whose content changed without a user edit. Check connections to port 8017 from addresses other than your MCP clients, and tool-call logs with filepath values that are absolute or contain ../.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
A path traversal vulnerability exists in `excel-mcp-server` versions up to and including 0.1.7. When running in SSE or Streamable-HTTP transport mode (the documented way to use this server remotely), an unauthenticated attacker on the network can read, write, and overwrite arbitrary files on the host filesystem by supplying crafted filepath arguments to any of the 25 exposed MCP tool handlers.
The server is intended to confine file operations to a directory set by the EXCEL_FILES_PATH environment variable. The function responsible for enforcing this boundary — get_excel_path() — fails to do so due to two independent flaws: it passes absolute paths through without any check, and it joins relative paths without resolving or validating the result. Combined with zero authentication on the default network-facing transport and a default bind address of 0.0.0.0 (all interfaces), this allows trivial remote exploitation.
---
Details
| Field | Value | | **Package** | [`excel-mcp-server`](https://pypi.org/project/excel-mcp-server/) (PyPI) | | **Repository** | https://github.com/haris-musa/excel-mcp-server | | **Affected versions** | `<= 0.1.7` | | **Tested version** | `0.1.7` — commit [`de4dc75`](https://github.com/haris-musa/excel-mcp-server/commit/de4dc75f6ba629ccd2e097f5963235846be622e6) | | **CWE** | [CWE-22](https://cwe.mitre.org/data/definitions/22.html) — Improper Limitation of a Pathname to a Restricted Directory | | **CVSS 3.1** | **8.2 High** — `AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H` | | **Transports affected** | `sse`, `streamable-http` (network-facing) | | **Authentication required** | **None** |
---
Vulnerable Code
The root cause is in src/excel_mcp/server.py, lines 75–94:
def get_excel_path(filename: str) -> str:
"""Get full path to Excel file."""
# FLAW 1 — absolute paths bypass the sandbox entirely
if os.path.isabs(filename):
return filename # line 86: returned as-is
# In SSE/HTTP mode, EXCEL_FILES_PATH is set
if EXCEL_FILES_PATH is None:
raise ValueError(...)
# FLAW 2 — relative paths joined without boundary validation
return os.path.join(EXCEL_FILES_PATH, filename) # line 94: "../" escapesWhy this is exploitable
Flaw 1 — Absolute path bypass (line 86): If the attacker passes filepath="/etc/shadow" or filepath="/home/user/secrets.xlsx", the function returns it unchanged. The sandbox directory EXCEL_FILES_PATH is never consulted.
Flaw 2 — Relative traversal (line 94): os.path.join("/srv/sandbox", "../../etc/passwd") produces "/srv/sandbox/../../etc/passwd", which resolves to "/etc/passwd". No os.path.realpath() or os.path.commonpath() check is performed, so ../ sequences escape the sandbox.
Contributing factors that increase severity
- Default bind address is `0.0.0.0` (all interfaces) —
server.pyline 70: ``python host=os.environ.get("FASTMCP_HOST", "0.0.0.0"),`A user who follows the README and runsuvx excel-mcp-server streamable-httpwithout explicitly settingFASTMCP_HOST` exposes the server to their entire LAN.
- Zero authentication — FastMCP's SSE and Streamable-HTTP transports ship with no authentication. The server adds none. Any TCP client that reaches port 8017 can call any tool.
- All 25 tool handlers are affected — every
@mcp.tool()decorated function callsget_excel_path(filepath)as its first action. This is not an isolated endpoint; it is the entire API surface.
- Arbitrary directory creation —
src/excel_mcp/workbook.pyline 24 runspath.parent.mkdir(parents=True, exist_ok=True)before saving, meaning the attacker can create directory trees at any writable location.
---
Proof of Concept
Video demonstration

asciinema recording: https://asciinema.org/a/2HVA3uKvVeFahIXY
I have also attached the full PoC shell script (record-poc.sh) and the Python exploit script (exploit_test.py) to a Google Drive for the maintainer to review and reproduce independently:
Google Drive (PoC scripts): Shared privately via email
Contents:
record-poc.sh— automated PoC recording script (bash)exploit_test.py— Python exploit that tests all 7 primitives against a running server
Setup
# install
pip install excel-mcp-server mcp httpx
# start server with a sandbox directory
mkdir -p /tmp/sandbox
EXCEL_FILES_PATH=/tmp/sandbox FASTMCP_HOST=127.0.0.1 FASTMCP_PORT=8017 \
excel-mcp-server streamable-httpExploit script
The following Python script connects to the server with zero credentials and demonstrates all exploitation primitives:
{REMOVING CAUSE FOR SAFETY CONCERNS}
Results
All 7 test cases passed against a live server instance:
CONFIRMED: 7 | FAILED: 0
[CONFIRMED] AUTH: Connected with ZERO authentication. 25 tools exposed.
[CONFIRMED] P1-WRITE-ABS: file exists=True size=4783B (outside sandbox)
[CONFIRMED] P2-WRITE-TRAVERSAL: escaped sandbox via ../ exists=True
[CONFIRMED] P3-MKDIR: attacker directory tree created=True
[CONFIRMED] P4-READ: exfiltrated SSN=True name=True
[CONFIRMED] P5-OVERWRITE: victim data replaced=True
[CONFIRMED] P6-STAT: server attempted to open /etc/hostname (format error confirms file access)Filesystem evidence (independently verified after exploit)
Files created outside the sandbox:
$ ls -la /tmp/cve-hunt/outside_sandbox/
-rw-rw-r-- 1 hitarth hitarth 4783 Apr 10 17:36 P1_absolute_write.xlsx
-rw-rw-r-- 1 hitarth hitarth 4783 Apr 10 17:36 P2_traversal_write.xlsxAttacker-created directory tree:
$ find /tmp/cve-hunt/attacker_dir
/tmp/cve-hunt/attacker_dir
/tmp/cve-hunt/attacker_dir/deep
/tmp/cve-hunt/attacker_dir/deep/nested
/tmp/cve-hunt/attacker_dir/deep/nested/x.xlsxVictim file after overwrite (original SSN destroyed):
('SSN', 'Name')
('ATTACKER-CONTROLLED', 'PWNED') # was: ('123-45-6789', 'Alice Johnson')
('987-65-4321', 'Bob Smith')---
Impact
An unauthenticated network attacker can:
| What | How | Severity | | **Read any `.xlsx` file** on the host | Supply absolute path to `read_data_from_excel` | Confidentiality loss — cross-tenant data theft of financial data, HR records, reports | | **Write `.xlsx` files anywhere** on the filesystem | Supply absolute path or `../` traversal to `create_workbook` or `write_data_to_excel` | Integrity loss — destroy or corrupt any writable `.xlsx`, plant malicious files | | **Create arbitrary directories** anywhere writable | `create_workbook` triggers `mkdir(parents=True)` on attacker-controlled path | Precursor to privilege escalation or DoS | | **Overwrite existing business files** with attacker content | `write_data_to_excel` with absolute path to target | Silent data corruption — audit reports, salary sheets, financial models | | **Fill disk** via repeated writes | Loop `create_workbook` with unique filenames | Denial of service — crash services dependent on free disk | | **Plant macro-enabled templates** (`.xltm`) at known shared paths | `create_workbook` at path like `/home/user/Templates/report.xltm` | Client-side RCE chain when downstream user opens the template in Excel |
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 candidateReferences
Credited to hits313.
Questions
- Does CVE-2026-40576 need authentication?
No. SSE and Streamable-HTTP transports ship without authentication, and the server adds none, so any client reaching the port can call the tools.
- Is stdio mode affected?
The advisory says the network-facing transports,
sseandstreamable-http, are the affected ones.- Which version fixes it?
0.1.8. Versions up to and including 0.1.7 are vulnerable.
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 entriesCVE-2026-102943
Dagu MCP DAG specification read bypasses path containment and workspace isolation
medium6.5Nov 10, 2026CVE-2026-102610
fast-agent: `fast-agent serve` binds HTTP to 0.0.0.0 with no authentication by default; with --shell this is unauthenticated remote command execution
medium6.4Nov 9, 2026CVE-2026-63655
tsParticles: Unbounded HTTP Request Body Buffering in @tsparticles/mcp-server Leads to Remote DoS
high7.5Nov 9, 2026CVE-2026-76892
tsParticles: Malformed JSON requests can terminate the @tsparticles/mcp-server HTTP process
high8.7Nov 9, 2026CVE-2026-76893
tsParticles: A single anonymous MCP session can monopolize HTTP mode and deny new clients
medium6.9Nov 9, 2026CVE-2026-77604
Code Graph RAG: MCP paginated read_file path traversal / arbitrary file read
high7.5Nov 9, 2026
