T03 · Remote Payload Retrieval and Execution
- Location
SKILL.md:130- Finding
Unverified Remote Installation Script Executed Directly by Bash
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches its ModelScope API purpose, but it includes risky install and credential-handling instructions that could expose tokens or run unverified code if followed.
Install only if you are comfortable reviewing ModelScope install commands yourself. Avoid the curl-to-bash installer, use least-privilege short-lived tokens, do not place real tokens in Git URLs or shell commands, and treat Studio deploy/delete/secret operations as account-changing actions that need explicit confirmation each time.
SKILL.md:130Unverified Remote Installation Script Executed Directly by Bash
SKILL.md:130Unpinned Third-Party Package and Skill Installations
SKILL.md:445Authentication Tokens Exposed Through Command Arguments and Git URLs
SKILL.md:481Persistent Authentication Cookies Conflict with the Session-Only Credential Policy
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
headers = {}
if token:
headers["Authorization"] = f"Bearer {token}"
r = requests.get(url, headers=headers, timeout=15, **kwargs)
r.raise_for_status()
d = r.json()
# 兼容 /api/v1/(PascalCase)和 /openapi/v1/(snake_case)
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
headers = {"Content-Type": "application/json"}
if token:
headers["Authorization"] = f"Bearer {token}"
r = requests.put(url, headers=headers, json=body, timeout=15)
r.raise_for_status()
d = r.json()
if "Data" in d:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
需要一个 ModelScope API Token:
1. 访问 https://www.modelscope.cn/my/overview 注册登录
2. 点右上角头像 → 「访问令牌」(Access Token) → 新建令牌
3. 复制生成的 Token(格式:`ms-xxxxxx`)
### 在 WorkBuddy 中使用
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
需要一个 ModelScope API Token:
1. 访问 https://www.modelscope.cn/my/overview 注册登录
2. 点右上角头像 → 「访问令牌」(Access Token) → 新建令牌
3. 复制生成的 Token(格式:`ms-xxxxxx`)
### 在 WorkBuddy 中使用
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
需要一个 ModelScope API Token:
1. 访问 https://www.modelscope.cn/my/overview 注册登录
2. 点右上角头像 → 「访问令牌」(Access Token) → 新建令牌
3. 复制生成的 Token(格式:`ms-xxxxxx`)
### 在 WorkBuddy 中使用
Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.
Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.
声明描述的是一个可与 ModelScope 生态交互的 API 技能,核心能力应包括调用远程接口进行搜索、查询、下载,甚至在确认后执行部署/安装等变更操作。但提供的代码块只是 generate_screenshots.py:它创建图片画布、绘制静态文本并保存为 PNG 截图。代码中出现的 API 路径、安装命令和部署步骤都只是写入图片的展示内容,不会被实际执行,也没有网络访问、命令执行、用户确认或资源管理逻辑。因此该代码块的实际主要用途是生成文档/展示截图,而非实现所声明的技能功能,属于明显不匹配。
整体上,这段代码确实与 ModelScope API 辅助相关,主方向与声明部分一致,但声明明显比实际实现更广。代码只实现了只读查询能力的一部分:技能、MCP、模型,以及底层的数据集查询函数;没有实现下载,也没有实现 Studio 相关接口。虽然声明包含“数据集”支持,但当前 CLI 入口没有 datasets 命令,因此对外可用能力与描述不完全一致。另一个小的未声明能力是可获取用户运行中的 MCP 服务器列表(list_operational_mcp),不过这不是主要偏差。综合来看,属于描述与实际行为存在实质性不一致。
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
curl -s "https://www.modelscope.cn/openapi/v1/skills?page_number=1&page_size=10&search=股票" | python -m json.tool
Query 参数:
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
curl -s "https://www.modelscope.cn/openapi/v1/skills/@Alipay/alipay-payment-integration" | python -m json.tool
返回额外字段 install_command(3 种安装方式):
The command curl -fsSL https://modelscope.cn/skills/install.sh | bash downloads a remote script and executes it immediately without verification. This is dangerous because any compromise of the server, CDN, TLS termination, or upstream script content results in arbitrary code execution on the user's machine.
{
"install_command": [
"npx skills add https://modelscope.cn/skills/@Alipay/alipay-payment-integration",
"curl -fsSL https://modelscope.cn/skills/install.sh | bash -s -- @Alipay/alipay-payment-integration",
"pip install --upgrade modelscope && modelscope skills add @Alipay/alipay-payment-integration"
]
}
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
curl -s -X PUT "https://www.modelscope.cn/openapi/v1/mcp/servers" \
-H "Content-Type: application/json" \
-d '{"filter": {"category": "developer-tools"}, "page_number": 1, "page_size": 10, "search": ""}' | python -m json.tool
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
curl -s "https://www.modelscope.cn/openapi/v1/mcp/servers/@modelcontextprotocol/fetch?get_operational_url=true" | python -m json.tool
返回关键字段:
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
curl -s "https://www.modelscope.cn/openapi/v1/mcp/servers/operational" \
-H "Authorization: Bearer ms-xxxxxx" | python -m json.tool
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
curl -s -X PUT "https://www.modelscope.cn/api/v1/models" \
-H "Authorization: Bearer ms-xxxxxx" \
-H "Content-Type: application/json" \
-d '{"page_number": 1, "page_size": 10, "search": "llama"}' | python -m json.tool
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
curl -s "https://www.modelscope.cn/api/v1/models/{owner}/{name}" \
-H "Authorization: Bearer ms-xxxxxx" | python -m json.tool
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
curl -s -X PUT "https://www.modelscope.cn/api/v1/datasets" \
-H "Authorization: Bearer ms-xxxxxx" \
-H "Content-Type: application/json" \
-d '{"page_number": 1, "page_size": 10, "search": "finance"}' | python -m json.tool
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
curl -s "https://www.modelscope.cn/api/v1/datasets/{namespace}/{name}" \
-H "Authorization: Bearer ms-xxxxxx" | python -m json.tool
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
curl -s "https://www.modelscope.cn/api/v1/datasets/{namespace}/{name}/repo/tree" \
-H "Authorization: Bearer ms-xxxxxx" | python -m json.tool
The documentation recommends merge --allow-unrelated-histories, a flag that suppresses normal Git safety checks and can cause unrelated content to be merged into a repository. In a deployment workflow that uses tokens and push-based publication, this increases the risk of importing malicious or unintended history into a live project if followed blindly.
**Git 推送要点**:
- 默认分支 **`master`**(不是 `main`),禁止 force push
- 推送地址:`https://oauth2:${TOKEN}@www.modelscope.cn/studios/${owner}/${repo_name}.git`
- 首次推送前需 `fetch` + `merge --allow-unrelated-histories`
**Gradio 模式要求**:
- 入口文件:`app.py`(固定)
The README advertises deployment and management capabilities beyond the stated query/search/download-oriented scope, creating a scope mismatch that can mislead users and host systems about what actions the skill may attempt. In an agent environment, understated mutating capabilities increase the risk of unexpected state-changing operations being invoked without appropriate review or guardrails.
The README highlights deployment and management functions but does not prominently warn users about the operational impact of those actions, such as creating cloud resources or changing remote state. In a skill catalog, missing user-facing warnings increases the chance that impactful actions are perceived as routine lookups and executed without adequate scrutiny.
Claiming access to the 'complete API' and full deployment/management features overstates the skill's authority and can cause users or orchestrators to trust it with broader privileges than intended. This is dangerous in tool-enabled agents because capability overclaiming undermines least-privilege assumptions and can normalize high-impact actions.
The trigger keywords are broad and loosely scoped, making accidental invocation more likely when users discuss ModelScope-related topics casually. In an autonomous assistant context, broad triggers can activate external API interactions or capability discovery without sufficiently clear user intent.