Back to skill

Security audit

魔搭魔粒每日自动领取

Security checks for vulnerabilities and agentic risk

Overview

The optional self-test needs review because it visits live websites and can reach real claim buttons if its fake-page setup fails.

Use a dedicated browser profile with debugging restricted to loopback, and close it when finished. Avoid running the self-test in an authenticated browser until it reliably verifies its fake page and stops on setup failures; its 'local' description does not mean offline. Live-browser behavior was not exercised in this review. The inspected code supports a testing-safety concern, not a finding of credential theft or malicious intent.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (13)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

访问的 ModelScope 页面与领取魔粒的目标一致,但命令直接调用 chrome.exe,并使用独立 profile 启动远程调试浏览器。这不是单纯连接现有浏览器的实现细节,而是执行了描述明确排除的浏览器启动及配置文件写入行为。该代码片段未展示点击领取或余额校验,但不应仅因片段未包含这些步骤而判定额外不一致。

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

A self-test is explicitly declared, and its fixture creation and regression checks are supporting implementation details. However, load_page("example.com") performs real third-party navigation and Page.setDocumentContent modifies that third-party page; subsequent evaluations also read and modify its JavaScript state. Refusing to click claim buttons there does not satisfy the broader promise to operate only on modelscope.cn pages. Comments asserting that the fake page makes no real requests do not eliminate the preceding real navigation. The imported browser lifecycle helpers are not supplied, so their names alone do not establish a separate violation of the no-start/no-stop promise.

Content

No source excerpt is available for this finding.

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/run_selftest.py (reported line 81)May include surrounding context.

python
return 2

    print("[ok] 已连上 127.0.0.1:%d" % args.port)
    env = dict(os.environ)
    env["SELFTEST_PORT"] = str(args.port)
    r = subprocess.run([sys.executable, os.path.join(HERE, "selftest.py")],
                       cwd=HERE, env=env)

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_write, network, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Unbounded Resource Access

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill allows unbounded resource consumption (API calls, storage, compute). Without rate limits or quotas, a compromised or misbehaving agent can cause denial-of-service or cost overruns.

Content

Scanner excerpt · scripts/ms_cdp.py (reported line 166)May include surrounding context.

python
except Exception:
            pass

    def readable(self, timeout=0.3):
        try:
            r, _, _ = select.select([self.sock], [], [], timeout)
            return bool(r)

Internal Network Request

Medium
Category
Server-Side Request Forgery
Confidence
70% confidence
Finding

Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.

Content

Scanner excerpt · scripts/ms_cdp.py (reported line 210)May include surrounding context.

python
# ---- HTTP 侧 ----
    def _http(self, path):
        req = urllib.request.Request("<redacted-url>" % (self.port, path))
        with self._opener.open(req, timeout=10) as r:
            return json.loads(r.read().decode("utf-8"))

Tainted flow: 'tmp' from os.environ.get (line 721, credential/environment) → open (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/ms_checkin.py (reported line 724)May include surrounding context.

python
tmp = LOG_PATH + ".tmp"
    # 显式 newline="":Windows 上默认会把 \n 翻成 \r\n,同一份 JSON 换台机器
    # 生成就是另一套行尾,diff 全是噪音。
    with open(tmp, "w", encoding="utf-8", newline="") as f:
        json.dump(data, f, ensure_ascii=False, indent=2)
    os.replace(tmp, LOG_PATH)

Internal Network Request

Medium
Category
Server-Side Request Forgery
Confidence
70% confidence
Finding

Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.

Content

Scanner excerpt · scripts/run_selftest.py (reported line 40)May include surrounding context.

python
def cdp_up(port):
    """调试端口是否可用。返回 (ok, 版本信息)。"""
    try:
        with urllib.request.urlopen(
                "<redacted-url>" % port, timeout=4) as r:
            return True, json.loads(r.read().decode("utf-8"))
    except Exception:

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/run_selftest.py (reported line 83)May include surrounding context.

python
print("[ok] 已连上 127.0.0.1:%d" % args.port)
    env = dict(os.environ)
    env["SELFTEST_PORT"] = str(args.port)
    r = subprocess.run([sys.executable, os.path.join(HERE, "selftest.py")],
                       cwd=HERE, env=env)
    print("[..] 自测退出码 = %s" % r.returncode)
    return r.returncode

The self-test navigates to and modifies example.com pages despite the manifest's ModelScope-only restriction.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The manifest explicitly limits page operations to modelscope.cn, but L262 calls load_page("example.com"). That helper performs a real HTTPS navigation and replaces the destination document through Page.setDocumentContent (L109–L123); L294–L303 additionally modify JavaScript globals on that third-party page. Although these operations test the hostname guard, they exceed the stated domain restriction even when no buttons are clicked.

Content

No source excerpt is available for this finding.

Activation examples include generic questions without requiring ModelScope or Magicube context.

Low
Category
Trigger Abuse
Confidence
94% confidence
Finding

“今天领了吗” (Have you claimed it today?) and “够不够跑一轮核验” (Is there enough to run one verification round?) can refer to unrelated rewards or resources. Listing them as standalone activation conditions without a context requirement could invoke this browser-automation skill unintentionally.

Content

No source excerpt is available for this finding.

The pre-click comment claims that a completion-text change counts as success, but classification explicitly rejects that criterion.

Low
Category
Excessive Agency
Confidence
100% confidence
Finding

L515 says that completion text appearing after the click also counts as a successful claim. In contrast, L442–L450 return UNKNOWN when a button was clicked but the balance did not increase, even if the completion text changed. This directly contradicts documentation about the skill's central success criterion, although the implemented classification follows the stricter intended behavior.

Content

No source excerpt is available for this finding.

The script modifies environment variables despite explicitly documenting that it does not.

Low
Category
Excessive Agency
Confidence
99% confidence
Finding

The capability boundary at L016 explicitly says the script does not modify environment variables. However, L751–L754 populate LOCALAPPDATA and ProgramFiles when missing, including a hard-coded user-specific path. These changes affect the current process environment, although they do not persistently change system settings.

Content

No source excerpt is available for this finding.