T01 · Skill Instruction Hijacking
- Location
scripts/cnki-watch.mjs:1331- Finding
Untrusted CNKI Metadata Is Injected into the Main Agent Session
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill has a coherent CNKI lookup purpose, but it needs Review because it includes under-disclosed automated verification bypass, unsafe credential/session handling, and recurring chat injection behavior.
Install only if you are comfortable giving the skill CNKI session credentials and allowing it to create recurring OpenClaw cron jobs that inject CNKI metadata into chat. Review the CAPTCHA-solving code, disabled TLS validation, gateway-token handling, and unpinned npx guidance before using it with real credentials or persistent sessions.
scripts/cnki-watch.mjs:1331Untrusted CNKI Metadata Is Injected into the Main Agent Session
scripts/cnki-watch.mjs:963Gateway Authentication Token Is Exposed Through Process Arguments and Error Messages
scripts/cnki-watch.mjs:449Browser Disables TLS Certificate Validation for Authenticated CNKI Requests
scripts/cnki-watch.mjs:660Embedded CAPTCHA Solver Circumvents Human-Verification Controls and Contradicts the Skill Contract
Referenced artifact was not completely inspected
node scripts/cnki-watch.mjs --help
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Topic lookups must include the paper title and source. Journal lookups should keep the requested journal name visible in either `source` or `matched_query`.
## Authentication and CNKI access
Credential precedence:
The script automates CNKI login and actively attempts to solve slider CAPTCHAs by analyzing page images and simulating mouse movement. That is a deliberate bypass of anti-automation controls, which can violate access restrictions and enables unauthorized scripted use of an authenticated session.
The skill declares environment-variable usage for CNKI authentication but does not declare an explicit tool scope such as permissions or allowed-tools. That weakens least-privilege controls and makes it harder for reviewers and runtime policy to constrain what the skill can access, especially since it handles sensitive cookies and credentials.
The top-level skill description does not clearly warn that subscriptions will periodically push content into the main OpenClaw chat. That can lead to user surprise, inadvertent data propagation, and consent issues because a one-time setup causes ongoing background delivery into a shared or persistent context.
The skill instructs users to provide CNKI_COOKIE or username/password credentials but does not include a privacy and handling warning for these secrets. Because cookies may represent active sessions and credentials can grant account access, insufficient warning increases the chance of insecure storage, oversharing, or accidental disclosure through logs or chat context.
Subtle instructions detected that may alter agent decision-making or introduce hidden biases.
Always use the bundled script instead of ad hoc CNKI browsing:
node {baseDir}/scripts/cnki-watch.mjs <command> [flags]
The documentation tells users to run npx cnki-watch without pinning a version, which can fetch and execute whatever package version is current at runtime. This creates a supply-chain execution risk: a compromised, typosquatted, or newly malicious package release could run arbitrary code in the user's environment.
The documentation instructs users to run npx cnki-watch without a pinned version, which can fetch and execute the latest package from the registry at runtime. That creates a supply-chain risk: if the package is compromised, typosquatted, or updated maliciously, arbitrary code could run in the user's environment.
The skill automatically runs npm install/npm ci with inherited environment variables when playwright-core is missing. Installing dependencies at runtime can execute arbitrary lifecycle scripts from the package tree and introduces supply-chain risk unrelated to a simple CNKI lookup workflow.
This is the same underlying issue as the earlier auto-install finding: the script executes npm automatically without an explicit user warning or approval. Silent package installation expands the trust boundary and can trigger unreviewed install scripts, making the skill dangerous in environments that expect passive data retrieval only.
The browser context is created with a hard-coded locale: "zh-CN", which forces a specific language/locale regardless of user preference. The policy for this audit flags language or locale constraints unless the skill offers choice or clearly documents a justified region-specific limitation in the file.
This code persists subscription state to runtime/subscriptions.json via fs.writeFile, storing user query subscriptions and run metadata. In this file there is no confirmation prompt or clear disclosure comment/docstring warning that the skill writes persistent local state.
The skill reads sensitive authentication material such as CNKI_COOKIE, CNKI_USERNAME, CNKI_PASSWORD, and a gateway token from environment or config values. This file lacks a clear inline warning or explanatory comment notifying users that credentials will be consumed for browser login and gateway access.
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.
maxPages = 1,
exactSource = false,
preferDateSort = false,
strictAuth = false,
}) {
const settings = await loadSettings();
const cookie = resolveCredential(settings, "CNKI_COOKIE");
The cron prompt instructs another agent to run a command exactly once, not ask follow-up questions, and not modify the command. This is prompt-level control designed to suppress safety checks and operator clarification, which becomes risky because it bridges scheduled automation into privileged command execution.
Recurring CNKI monitoring can justify scheduling, but this code also directly administers platform cron jobs and includes a manual trigger path for immediate execution. Those host scheduling control capabilities are broader than the manifest's user-facing description of creating subscriptions that periodically push updates into chat.
The defaults hard-code "Asia/Shanghai" and pair it with China-specific schedule handling, which imposes a locale assumption in natural-language-facing behavior. In this file there is no visible user choice, opt-in, or policy justification for forcing that locale as the default.
Detected: suspicious.dangerous_exec, suspicious.exposed_secret_literal