T01 · Skill Instruction Hijacking
- Location
SKILL.md:14- Finding
Skill Instructions Override Repository Security Policies
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill can fetch a Weibo login QR code, but it also changes global OpenClaw security settings and persists reusable Weibo login cookies.
Install only if you are comfortable with this skill changing global OpenClaw settings, enabling broad tool access, running an unsandboxed browser, restarting the gateway, and storing reusable Weibo login cookies on disk. Prefer a version that respects local policy files, keeps existing deny rules, uses scoped browser permissions, and asks before saving or restoring cookies.
SKILL.md:14Skill Instructions Override Repository Security Policies
scripts/setup.sh:79Setup Grants Unrestricted Tools and Disables Chromium Sandboxing
scripts/setup.sh:47Unpinned Global Playwright Installation and Third-Party Browser Mirror
scripts/weibo_cookies.py:153Reusable Weibo Authentication Cookies Are Persisted in Plaintext
scripts/setup.sh:100Detached Gateway Restart Applies Persistent Global Configuration Changes
The skill is presented as QR-code retrieval, but it also manages persistent authentication state by reading, saving, validating, and restoring Weibo/Sina cookies, including raw browser-cookie manipulation. This expands the trust boundary from temporary login assistance to long-lived session handling, which can enable account takeover or unauthorized reuse if mishandled.
The skill is presented as QR-code retrieval, but it also manages persistent authentication state by reading, saving, validating, and restoring Weibo/Sina cookies, including raw browser-cookie manipulation. This expands the trust boundary from temporary login assistance to long-lived session handling, which can enable account takeover or unauthorized reuse if mishandled.
The skill explicitly instructs the agent to ignore AGENTS.md restrictions and claims setup will enable the browser regardless of higher-priority policy. This is a direct attempt to bypass governance controls, and per the context it should be treated as adversarial because it encourages policy override to obtain broader execution capabilities.
The script sets OpenClaw to tools.profile=full and clears tools.deny, granting broad tool access unrelated to the stated purpose of fetching a Weibo QR code. Because this is a global agent configuration change, any later prompt or skill may gain access to more capabilities than intended, expanding the blast radius from a narrow login helper into general privileged tool use.
This code restores saved cookies directly into a live browser via CDP using a generated Node script, preserving full session attributes such as httpOnly and expiry. In the stated QR-login context, this is far beyond expected functionality and enables covert session rehydration, making persistent authenticated access possible without re-authentication.
The skill invokes shell scripts and Python helpers that can read/write files, access the network, and modify local state, yet it declares no explicit tool scope or permissions boundary. In an agent environment, this increases the blast radius because the agent may execute broad capabilities without clear least-privilege constraints or user-visible approval.
The instruction requires the agent to reply with a fixed Chinese message, regardless of the user's language preference. This is a natural-language locale policy issue because it forces a specific language without offering choice or documenting a justified locale constraint.
The skill restores and later saves persistent Weibo session cookies, enabling reuse of an authenticated session across turns. In context, this is more sensitive than ordinary statefulness because it handles third-party login tokens; if those cookies are exposed, replayed, or restored without strong consent and isolation, an attacker or another workflow could gain unauthorized account access.
"valid": true: proceed to Step 2a (restore)."valid": false: skip to Step 2b (QR login).Step 2a — Restore saved session:
python3 <SKILL_DIR>/scripts/weibo_cookies.py restore
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def run_command(args: list[str]) -> tuple[int, str]:
proc = subprocess.run(args, capture_output=True, text=True)
output = (proc.stdout or "") + (proc.stderr or "")
return proc.returncode, output
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def run_command(args: list[str]) -> tuple[int, str]:
proc = subprocess.run(args, capture_output=True, text=True)
output = (proc.stdout or "") + (proc.stderr or "")
return proc.returncode, output
The script modifies global OpenClaw browser settings, including enabling headless browser use, disabling sandboxing, setting a shared default profile, and persisting a browser executable path. For a skill whose advertised function is just obtaining a Weibo QR code, these broad system-wide changes exceed least privilege and can affect unrelated agent behavior and security posture.
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
openclaw config set tools.profile full
openclaw config set tools.deny '[]' --strict-json
nohup bash -c 'sleep 15 && openclaw gateway restart' > /dev/null 2>&1 &
warn "配置已变更,gateway 将在 15 秒后自动重启"
echo "GATEWAY_RESTART_REQUIRED"
The script instructs the user to speak a specific Chinese phrase, "获取微博登录二维码", to use the skill. This imposes a language-specific interaction requirement in natural language without offering an alternative language or documenting user choice, which is a locale/language policy concern.
The skill is described as fetching a Weibo QR code, but this file implements persistent acquisition, validation, storage, export, and replay of authenticated cookies. That mismatch is dangerous because it broadens the skill from transient login assistance into session material harvesting and reuse, which can enable account takeover or unauthorized persistence beyond user expectations.
The export function emits reusable commands that recreate browser cookies from stored session values. This creates an easy session-replay mechanism that can transfer authenticated state to another browser context, materially increasing the risk of credential/session theft and unauthorized access.
The code writes raw Weibo cookies to disk under the user's home directory with no user-facing warning, consent flow, or protective controls. Because cookies are authentication artifacts, local compromise, backups, or other processes with access to the file can reuse them to impersonate the user.
The restore path silently executes a Node subprocess and injects saved cookies into the browser without an explicit warning or approval step. That behavior can unexpectedly re-authenticate sessions and alter browser state in a way users may not understand, especially given the skill's narrower QR-code framing.