T01 · Skill Instruction Hijacking
- Location
SKILL.md:7- Finding
Agent Instruction and Response Hijacking Through Highest-Priority Skill Rules
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This coupon skill has a coherent coupon-login purpose, but it silently persists account tokens, adds recurring automation, and ships unsafe local file and command-handling code.
Review before installing, especially on shared or cloud agent hosts. This skill handles Meituan login credentials and can keep them across sessions, including in general agent memory without user-facing notice. It can also create recurring coupon jobs. Do not use it unless you trust the publisher and are comfortable auditing or disabling the memory-token fallback, shared cache access, and cron setup paths.
SKILL.md:7Agent Instruction and Response Hijacking Through Highest-Priority Skill Rules
SKILL.md:419Silent Persistence of a Reusable Account Token in General Agent Memory
scripts/auth.py:1168Authentication Consent State Is Automatically Granted During Token Restoration
scripts/skill_cache_cli.py:200Arbitrary File Read, Write, and Deletion Through Cache Path Traversal
scripts/auth.py:1086Shell Command Injection Through Environment-Controlled Scheduler User ID
The documented behavior includes broad filesystem discovery, local CRUD, shared cache handling, and token/device-token state management beyond a narrowly defined coupon assistant role. Even if intended for operational support, these capabilities enlarge the attack surface and create opportunities for overbroad file access and sensitive state manipulation under a misleading functional label.
The documented behavior includes broad filesystem discovery, local CRUD, shared cache handling, and token/device-token state management beyond a narrowly defined coupon assistant role. Even if intended for operational support, these capabilities enlarge the attack surface and create opportunities for overbroad file access and sensitive state manipulation under a misleading functional label.
The trigger list is extremely broad and includes generic coupon, savings, shopping, and lifestyle phrases, increasing the chance of unintended invocation. In this skill, accidental activation is especially risky because invocation can lead into authentication, token handling, and coupon issuance/account actions rather than a low-impact informational response.
The fallback intent rules allow activation from loosely related consumption or savings contexts without clear limiting conditions. Because the skill can steer users into account-linked actions and persistent token flows, vague activation logic materially raises the risk of unwanted or surprise execution.
Referenced artifact was not completely inspected
> 完整的定时任务创建、管理、失败处理和跨平台兼容规则,读取 `references/cron-rules.md`。
Referenced artifact was not completely inspected
> 完整的定时任务创建、管理、失败处理和跨平台兼容规则,读取 `references/cron-rules.md`。
The skill explicitly directs cross-session storage and recovery of a live user token via agent memory or KV APIs. Persisting bearer credentials in shared agent memory is high risk because those stores are often less isolated, less purpose-bound, and more accessible than a dedicated secure credential store.
Copying the full environment into a subprocess is not mere harvesting for display, but it does propagate all available secrets and contextual credentials to a child process selected by path logic elsewhere in the file. Combined with the overrideable CLI path, this broad environment inheritance increases the blast radius of any subprocess compromise and can expose unrelated secrets to helper code.
# 配置环境变量,确保 CLI 能正确探测工作空间
# 避免依赖 cwd 导致路径不一致的问题
env = os.environ.copy()
env.setdefault("SKILL_CACHE_WORKSPACE", _get_workspace())
try:
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
cmd.append(subcommand)
cmd.extend(args)
env = os.environ.copy()
env.setdefault("SKILL_CACHE_WORKSPACE", _get_workspace())
try:
The shared_read/shared_write and auth_* functions create a cross-skill shared area and a common mt_auth_tokens.json store, allowing one skill to read or modify authentication material associated with another skill name. For a coupon skill, this is unjustified and dangerous because it breaks skill isolation and could enable credential theft, session hijacking, or unauthorized actions across skills.
The skill clearly directs shell execution, environment inspection, local file reads/writes, and network-backed auth/issuance flows, yet declares no explicit tool scope or permission boundary. In an agent ecosystem, this weakens least-privilege controls and increases the chance the skill is invoked with broader capabilities than users or orchestrators expect.
L012 requires that all user-facing replies be 'completely consistent' with predefined wording in the documentation, which effectively fixes the interaction language and phrasing. There is no indication that users can choose another language or locale, nor a documented region-specific justification for this constraint.
The document claims only masked phone numbers are stored locally, but elsewhere specifies storage of user_token and persistent device_token. This inconsistency is dangerous because it misleads users and orchestrators about the sensitivity of retained data, weakening meaningful consent and privacy review.
The skill instructs the agent to copy a user_token into agent-wide memory/KV storage outside the local auth file, creating an additional persistence channel for an authentication secret. This broadens exposure across sessions, sandboxes, and possibly unrelated skills, making token theft, reuse, or unintended cross-context access more likely.
This duplicated finding points to the same cross-session token persistence behavior and remains valid for the same reasons: durable storage of bearer tokens in generic memory broadens exposure. In the context of a coupon skill, such persistence exceeds what users would typically expect from a convenience feature.
不同平台的 Agent 可能具备不同的持久化能力,按优先级尝试:
1. **Agent 记忆文件**(推荐):写入 Agent 平台声明会跨 session 持久化的记忆文件(如 MEMORY.md、CLAUDE.md 等)。以 KV 格式记录,key 固定为 `meituan-coupon-user-token`,value 为 token 值
2. **KV 存储 API**(如 persistent_kv / state_store / memory_write 等):key 固定为 `meituan-coupon-user-token`
3. **无持久化能力** → 跳过兜底,每次走登录流程
> ⚠️ 不要新建独立文件来存储 token。云端 Claw 平台只持久化预定义的记忆文件,新建的文件在 session 结束后会丢失。
This duplicated finding points to the same cross-session token persistence behavior and remains valid for the same reasons: durable storage of bearer tokens in generic memory broadens exposure. In the context of a coupon skill, such persistence exceeds what users would typically expect from a convenience feature.
不同平台的 Agent 可能具备不同的持久化能力,按优先级尝试:
1. **Agent 记忆文件**(推荐):写入 Agent 平台声明会跨 session 持久化的记忆文件(如 MEMORY.md、CLAUDE.md 等)。以 KV 格式记录,key 固定为 `meituan-coupon-user-token`,value 为 token 值
2. **KV 存储 API**(如 persistent_kv / state_store / memory_write 等):key 固定为 `meituan-coupon-user-token`
3. **无持久化能力** → 跳过兜底,每次走登录流程
> ⚠️ 不要新建独立文件来存储 token。云端 Claw 平台只持久化预定义的记忆文件,新建的文件在 session 结束后会丢失。
The login flow instructs collection of a user's phone number and SMS verification code, but the nearby user-facing prompts do not clearly disclose that authentication state and acceptance status are persisted locally in a token file. This creates a privacy and consent gap: on shared devices or agent hosts, users may not understand that future access could occur without re-consent, increasing the risk of unauthorized account access or retention of sensitive session data.
Forcing all users onto Asia/Shanghai without locale choice can cause automation to run at unexpected times, especially for users outside that timezone. In a scheduled-action feature, time ambiguity undermines informed consent and can lead to unintended recurring behavior despite the user providing a valid local-time preference.
The file materially expands the skill from user-initiated coupon actions into persistent scheduled automation with proactive follow-up behavior. That creates a broader operational scope, increases the chance of unintended background actions, and can surprise users if automation persists after a one-time interaction.
The rule explicitly authorizes automatic coupon claiming at scheduled times without renewed user confirmation and frames it as frictionless convenience. That is risky because it normalizes ongoing autonomous actions, may continue after user intent changes, and lacks strong warning about persistence, revocation, or edge cases such as account/token changes.
The documentation instructs the agent to orchestrate cross-platform cron/job creation and deletion, including system-level commands, which exceeds the narrow coupon-assistant function and increases the blast radius if the logic is misused or compromised. Embedding platform-specific job management also raises the risk of unauthorized persistence or execution in environments with broader privileges.
The file states that all response copy must be output exactly as written, and all provided templates are in Chinese. This creates a language-policy issue because the skill appears to require a specific language regardless of user preference, with no opt-in or alternative locale handling documented in this file.
This finding duplicates the same persistent-session behavior: auth tokens are written to reusable cache/storage locations and later restored automatically. In the context of an agent skill, that persistence is more sensitive because other tools, sessions, or users on the same workspace may gain access to those tokens.
调用 mt-ug-ods-skill-cache CLI
Args:
command: 主命令(如 auth, shared, read, write 等)
subcommand: 子命令(如 get, set, list 等)
args: 额外参数列表
raw_output: 是否返回原始输出(用于 shared read 等直接返回内容的命令)
This finding duplicates the same persistent-session behavior: auth tokens are written to reusable cache/storage locations and later restored automatically. In the context of an agent skill, that persistence is more sensitive because other tools, sessions, or users on the same workspace may gain access to those tokens.
调用 mt-ug-ods-skill-cache CLI
Args:
command: 主命令(如 auth, shared, read, write 等)
subcommand: 子命令(如 get, set, list 等)
args: 额外参数列表
raw_output: 是否返回原始输出(用于 shared read 等直接返回内容的命令)
The code executes an external Python script whose path can be overridden via the SKILL_CACHE_CLI_PATH environment variable, and it inherits a copied environment into that subprocess. In an agent/runtime context, this creates a trust-boundary violation: if an attacker can influence environment variables or deployment packaging, they can cause arbitrary code execution under the agent's privileges.
env.setdefault("SKILL_CACHE_WORKSPACE", _get_workspace())
try:
result = subprocess.run(cmd, capture_output=True, text=True, timeout=30, env=env)
stdout = result.stdout.strip() if result.stdout else ""
# raw_output 模式:直接返回原始内容
No suspicious patterns detected.