T03 · Remote Payload Retrieval and Execution
- Location
- README.md:165
- Finding
- Unpinned Remote Repository Is Downloaded and Executed with Feishu Credentials<![CDATA[ ## Vulnerability Details **File Location**: `README.md:165-171`; related persistent execution configuration in `mcp-config-template.json:3-12` **Vulnerability Type**: Unpinned remote payload retrieval and execution **Risk Level**: Critical ### Vulnerable Code ```bash # Clone MCP Server cd ~/.openclaw/workspace/skills 2>/dev/null || mkdir -p ~/.openclaw/workspace/skills && cd ~/.openclaw/workspace/skills git clone https://github.com/Shuai-DaiDai/feishu-doc-manager.git cd feishu-doc-manager # Execute install.sh if it exists [ -f install.sh ] && bash install.sh ``` The resulting external script is then configured as an MCP process with Feishu credentials: ```json "feishu-doc-manager": { "command": "bash", "args": [ "<FEISHU_DOC_MANAGER_INSTALL_PATH>/install.sh" ], "env": { "FEISHU_APP_ID": "<YOUR_FEISHU_APP_ID>", "FEISHU_APP_SECRET": "<YOUR_FEISHU_APP_SECRET>" }, "_comment": "Feishu document management MCP Server" } ``` ### Technical Analysis The installation procedure clones the current default branch of an external GitHub repository without selecting an immutable commit, release artifact, checksum, or cryptographic signature. It then immediately executes `install.sh`. The executed script is not included in this project, so its effective behavior can change after this project has been reviewed. In addition, the MCP template repeatedly executes that external script while exposing `FEISHU_APP_ID` and `FEISHU_APP_SECRET` through its environment. This creates a time-of-review versus time-of-use supply-chain boundary: the code ultimately executed by the user is not fixed by this repository. ### Attack Path 1. An attacker compromises the external repository, its maintainer account, or its default branch. 2. The attacker modifies `install.sh` or files loaded by that script. 3. A user follows the documented installation process and clones the modified default branch. 4. The user runs `bash install.sh`, causing attacker-controlle ...[truncated 759 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Vendor the reviewed MCP implementation into the audited distribution where feasible. 2. Otherwise, pin the clone to a reviewed immutable commit: ```bash git clone https://github.com/Shuai-DaiDai/feishu-doc-manager.git cd feishu-doc-manager git checkout --detach <REVIEWED_COMMIT_SHA> ``` 3. Verify the checked-out commit and published artifact using a trusted signature or checksum before execution. 4. Do not use `install.sh` itself as the long-running MCP entry point. Configure a fixed, reviewed executable after installation. 5. Do not automatically execute newly downloaded shell scripts. 6. Run the external component in a sandbox with only required filesystem and network access. 7. Supply a separate least-privileged Feishu application credential rather than credentials shared with unrelated skills. 8. Document the exact reviewed upstream revision and establish a controlled update-review process. ]]>
