T03 · Remote Payload Retrieval and Execution
Error
- Location
scripts/install-example.sh:35- Finding
Mutable Remote Repository Is Executed After an Unbound Manual Review
- Content
View full analysis
/tmp/st-ent-mcp-smoke.out 2>/tmp/st-ent-mcp-smoke.err & ``` ### Technical Analysis The script clones the current state of a remote repository, or updates an existing checkout with `git pull --ff-only`, and then executes `mcp/server.js`. The preceding `ST_ENT_MCP_REVIEWED=1` check is only a Boolean assertion and is not cryptographically or logically bound to a specific Git commit. Consequently, the revision executed by the script can differ from the revision that was manually audited. A branch update can occur between review and execution, and every later invocation against an existing checkout automatically pulls new code before running it. HTTPS protects the connection in transit but does not ensure that the retrieved revision is the one previously reviewed. This creates a mutable remote code-execution channel. The external repository is outside the audited artifact, so its retrieved contents cannot be considered reviewed merely because this installer was reviewed. ### Attack Path 1. A user reviews revision A of the upstream repository. 2. The user sets `ST_ENT_MCP_REVIEWED=1`, believing the reviewed code will be installed. 3. The upstream default branch is changed to revision B, whether through repository compromise, maintainer account compromise, or an unreviewed update. 4. The installer clones revision B or runs `git pull --ff-only` and updates the checkout to revision B. 5. The script immediately executes `node "$REPO_DIR/mcp/server.js"`. 6. Malicious code in revision B runs with the invoking user's privil ...[truncated 663 chars]- Remediation
View remediation
&2 exit 1 fi ``` ]]>
