Skip to main content

SKY-D368 · Supply chain and agent configuration

MCP server launched from a hidden or temporary folder

High

An MCP server entry can start a program that lives outside the repository, such as node ~/.dev-utils/server.js. SKY-D368 reports a committed server whose code comes from a hidden folder in the home directory (one whose name starts with a dot, or AppData) or from a temporary folder such as /tmp.

Languages
MCP configuration files
Quality gate
Full scan: listed, not counted by the gate. Diff scan: fails the gate on its own. A baseline scan treats the rule like a diff scan when the baseline's rule_coverage lists it.
Finding type
review
Catalog name
MCP server launched from a hidden home-directory path
Wrong result? Report itA false positive, a missed case or a confusing message: it goes privately to the founder.

Why it matters

Nothing in the repository shows what that file does, and malware drops its payload in exactly such places. The SANDWORM_MODE campaign registered rogue MCP servers pointing at ~/.dev-utils/server.js, so every agent session started the attacker's code.

What Skylos flags

.cursor/mcp.json · JSONReported on line 3
{  "mcpServers": {    "dev-utils": {      "command": "node",      "args": ["~/.dev-utils/server.js"]    }  }}

What Skylos leaves alone

.cursor/mcp.json · JSON
{  "mcpServers": {    "dev-utils": {      "command": "~/.nvm/versions/node/v22.11.0/bin/node",      "args": ["tools/mcp/server.js"]    }  }}

Why Skylos leaves it alone

The program is in a hidden home folder, but it is Node from the nvm version manager, which Skylos recognises as a toolchain launcher. The code it runs, tools/mcp/server.js, is in the repository, where reviewers can read it.

How Skylos decides

  1. Runs with --danger (and -a). The ca9 library reads the same MCP server blocks as SKY-D367: .mcp.json, .cursor/mcp.json, .vscode/mcp.json and other mcp.json files, mcpServers in Claude and Gemini settings, and [mcp_servers.*] in .codex/config.toml.
  2. A path is hidden when it starts with a home directory (~, $HOME, /Users/<name>, /home/<name>, /root, C:\Users\<name>) followed by a folder whose name starts with a dot or is AppData, or with %APPDATA%. It is temporary when it starts with /tmp, /private/tmp, /var/tmp, /dev/shm, /var/folders, $TMPDIR, %TEMP% or a Windows Temp folder.
  3. Checks, in order, the program itself (unless it is a known launcher such as node, python, npx or uvx in a version-manager folder like ~/.nvm, ~/.pyenv or ~/.volta, or in a bin folder under ~/.local, ~/.cargo and similar), the inner command of sh -c or bash -c, paths in the server's NODE_OPTIONS, LD_PRELOAD, DYLD_INSERT_LIBRARIES and PYTHONSTARTUP, the script or package path of a local, Git or URL launch, the value after -r, --require, --import, --loader, --from or --spec, and the cwd of a local or python -m launch.
  4. Reports HIGH on the line of the server's name. Keeps the same files as SKY-D365 (regular files in the scanned folder that Git lists, or every file outside Git).
  5. In the gate, a full scan lists the finding without counting it. In a diff scan a server is new when its rule, file and a digest of its name and command are not among the merge base's findings, and a new one fails the gate on its own.

How to fix it

Commit the server's code to the repository, or launch a published package at an exact version, so reviewers can see what runs. Remove a server nobody on the team added on purpose.

.cursor/mcp.json · JSON · the fix, against the flagged file
{  "mcpServers": {    "dev-utils": {      "command": "node",Removed:       "args": ["~/.dev-utils/server.js"]Added:       "args": ["tools/mcp/server.js"]    }  }}

When it can be wrong

  • A tool you installed on purpose in a hidden folder, such as a script under ~/.config or ~/.local/share, is reported: only launchers in known toolchain folders are trusted.
  • A server that is only a url, with no command, is never checked.

Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.

How to silence it

  • Skylos reads no inline marker for this rule, even where the file allows comments.

  • Accept a reviewed server with a baseline: skylos baseline ., then --baseline. The entry matches the rule, file, server name and command, not the line. In pull-request CI (SKYLOS_POLICY_BASE), the entry must also be in the base commit's .skylos/baseline.json.

  • [tool.skylos] ignore = ["SKY-D368"] turns the rule off for the whole project.

From the Skylos rule handbook, Skylos 5.8.0 (commit 5b880b0). All rules.