SW-CFG-015: MCP server given the whole home directory or the filesystem root
Last updated 26 November 2026
| Fact | Value |
|---|---|
| Severity | High |
| Checks | Configuration file |
| Malicious indicator | No |
| OWASP Agentic Top 10 | ASI03 |
| OWASP MCP Top 10 | MCP02 |
| OWASP Agentic Skills Top 10 | None mapped |
| MITRE ATLAS | AML.T0053 |
| NIST SP 800-53 | AC-6 (provisional mapping to SP 800-53 base controls) |
| EU AI Act | Evidence toward EU AI Act article 15 |
| First shipped in | Scanner 1.25.0 |
What it detects
The rule reads the servers of the MCP client files (.mcp.json, .vscode/mcp.json and .cursor/mcp.json, in any folder), the inline servers of a plugin manifest and the MCP servers of Codex's config.toml and Gemini CLI's settings.json. Hooks files and marketplace files are not read. It judges the arguments of a server, and an argument fires when it is the whole home directory or the filesystem root and it stands in one of three places.
The home directory itself is ~, $HOME, ${HOME}, %USERPROFILE%, /Users/<name>, /home/<name> or C:\Users\<name>, with or without a closing slash. The root is /, a drive root such as C:\, /home, /Users or /root. The three places are the arguments that follow the package of a filesystem server, the value of a flag that names a directory (--root, --allowed-directories and the similar flags, as --flag value or --flag=value), and the host side of a bind mount of docker or podman, in -v or --volume or in the source part of --mount. A server is a filesystem server when its name, its command or an argument that is not a path says filesystem, fs or files.
Each argument that matches is one finding on the server's line, and the evidence names the form, such as the whole home directory or a bind mount of the filesystem root, never the path, because a home path carries a user name. A deeper path, ., a project variable such as ${workspaceFolder}, a relative path and the container side of a mount are quiet, and so is a server that is not a filesystem server and has no such flag. The rule cannot see what a server does with the folder it is given, a grant that is made outside the arguments a client file holds, or a folder handed over through the server's environment variables, which the fields the scanner reads do not hold; of the variables, it reads only the home directory forms above.
How the rule is measured: on its whole frame of 9,859 server entries, 8,511 of them in MCP configuration files and 1,348 in settings files, from 9,360 public files. The frozen rule flagged 22 entries from 16 components, fewer than the 60 that a held-out split needs, so every flagged entry was labelled, no part was held out, the rule was not tuned on them and the set was scored once. Precision is 100.0% (95% interval 85.1% to 100.0%; 22 of 22) and recall is 66.1% (47.0% to 84.8%), measured on 26 November 2026, so the severity is high. The labels come from two language-model labellers and a third that adjudicated blind, and a person audited a sample of 150 items. The labellers are models of one model family, planted examples may be easier than real ones, and the sets are not published because they hold third-party text. The scanner's benchmarks page gives the method and the records.
Why it matters
A filesystem server hands the agent every file under the folder it is given. On the whole home directory that includes SSH keys, cloud credentials, browser profiles, shell history and every other project on the machine, and a mistaken tool call or an instruction hidden in a file the agent reads can reach any of them. On the root it includes the system files as well. The scanner maps this rule to OWASP MCP02, Privilege Escalation via Scope Creep, and ASI03, Identity and Privilege Abuse, and to NIST SP 800-53 control AC-6, Least Privilege.
Example
The server below is a filesystem server, and the folder it is given is the home directory:
.mcp.json
{
"mcpServers": {
"files": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"~"
]
}
}
}The evidence says that an argument is the whole home directory and gives its position, never the path.
How to fix
Give the server only the project folder it needs, for example the path of the repository, and keep the home directory and the credentials in it out of its reach.
Replace the argument with the folder the work happens in: ${workspaceFolder} in a client that expands it, or . when the client starts the server in the project folder, or the path of the repository. If the agent needs a second folder, name it as its own argument.
For a container, mount only the project folder on the host side of the -v value, and keep the home directory and the filesystem root out of every mount. A server that really needs files from outside the project can be given the one folder that holds them, not the folder above it.
If it is a false positive
A server on a personal machine whose purpose is to search or tidy the whole home directory, or a container that mounts the home directory of a disposable virtual machine, is reported although the access is intended. Accept the finding with a note that says why the whole folder is needed and what the machine holds, and keep the expiry short. The rule is high under every preset, so a repository or a workstation that passed on an earlier scanner can fail after the upgrade.
If the finding is not a problem in your case, accept it with a note: in the dashboard a manager or owner can accept a finding and the note is kept with it; with the scanner on its own, add it to the baseline file with a reason and an expiry date.