T08 · Insecure Dependencies
- Location
scripts/install.js:41- Finding
Unpinned Third-Party Packages and Skills Are Installed Globally
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This setup skill is mostly transparent, but it asks agents to install unpinned global packages and skills and includes unsafe command-generation patterns.
Install only if you trust the lark-cli package and the globally added skills. Prefer pinned versions, avoid sudo npm install, review the exact skills before global activation, and enter Feishu App Secrets only into the local CLI prompt. Treat generated commands containing user-provided domains as unsafe unless the domain value is validated.
scripts/install.js:41Unpinned Third-Party Packages and Skills Are Installed Globally
scripts/auth.js:17Unsanitized Domain Argument Is Embedded in an Agent-Executed Shell Command
The declared description presents a comprehensive lark-cli installation and configuration assistant covering prerequisites through OAuth login, verification, first commands, and broad skill coverage. However, the supplied code chunk only emits a static text prompt for environment checking. It does not install anything, configure Feishu app settings, manage OAuth, extract authorization URLs, verify setup, or interact with any agent skills. While environment checking is consistent with one small part of the declared purpose, the actual code is materially narrower than the description and lacks the key advertised capabilities.
The declared description presents a broader end-to-end setup assistant covering installation, app configuration, OAuth flow support, verification, and first commands. The supplied code chunk only outputs a textual installation guide for Step 1 and optionally source-vs-npm variants in English or Chinese. It contains no logic for prerequisites checking, app configuration, OAuth/browser URL extraction, command execution, or interaction with the 20 skills beyond mentioning how to install them. This is a material description-behavior mismatch in primary scope and implemented capabilities.
The description promises an installation and configuration guide covering the full setup lifecycle: prerequisites, npm install, app config, OAuth flow handling, verification, and broad built-in skill coverage. The supplied code does not implement any of those behaviors. It simply reads --lang and --domain arguments and prints a static instructional prompt with example lark-cli commands and usage tips. While this is loosely related to helping users learn lark-cli, it is materially narrower and different in purpose from the declared setup/configuration workflow. Therefore this is a clear description-to-behavior mismatch.
The skill instructs the agent to ask the user to paste the Feishu App ID and App Secret into the interactive flow, exposing a secret to the agent/session instead of constraining entry to a trusted local prompt. In an agentic context, this increases the risk of credential capture, logging, transcript retention, or reuse outside the intended application setup.
Tell the user: "Please paste your Feishu App ID and App Secret.
You can find these at: https://open.feishu.cn/app → select your app → Credentials & Basic Info"
After entering credentials, the CLI saves them to the OS keychain.
` : `SCENARIO: New Feishu app creation (most users)
STEP 1 — Run config init in the background (non-blocking)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Problem: URL expired (>10 minutes)
→ Re-run: lark-cli config init --new (generates a fresh URL)
Problem: "permission denied" or keychain error
→ macOS: grant terminal keychain access in System Preferences → Privacy & Security
→ Linux: install libsecret: apt install libsecret-1-0 or set LARK_CONFIG_FILE env var
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Problem: URL expired (>10 minutes)
→ Re-run: lark-cli config init --new (generates a fresh URL)
Problem: "permission denied" or keychain error
→ macOS: grant terminal keychain access in System Preferences → Privacy & Security
→ Linux: install libsecret: apt install libsecret-1-0 or set LARK_CONFIG_FILE env var
The skill instructs agents to perform network-capable actions such as npm installation, OAuth login, and external CLI interactions, but it does not declare any explicit tool scope or permissions boundary. In agent environments, missing scope declarations can cause overbroad execution or unclear operator expectations about what external access the skill requires.
The usage section states --lang zh # default, which establishes a specific language default rather than offering a neutral or user-chosen locale. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern unless the locale constraint is clearly justified.
Using npx skills add larksuite/cli -y -g without a pinned version allows whatever package version is current at execution time to be fetched and run. This creates a supply-chain risk where a compromised upstream release or unexpected breaking change could execute unreviewed code in the user's environment.
The file header states 'PROMPT GENERATOR ONLY — no outbound network requests,' but the generated prompt explicitly instructs the agent to run lark-cli auth login and lark-cli auth status, which inherently contact Feishu/Lark services for OAuth and authentication state. In an agent-skill context, this misleading claim can cause unsafe trust decisions, especially if reviewers or orchestrators rely on comments to determine whether a skill can trigger networked actions.
The script defaults lang to zh when the user does not supply --lang, which imposes a specific language choice by default. This is a natural-language policy concern because the skill does not ask for user preference or present language choice before using Chinese output.
The script sets the default language to 'zh' when no --lang argument is provided. This imposes a specific language by default rather than offering a neutral choice or explicit user opt-in, which matches the language/locale policy violation criteria.
The file-level documentation says 'PROMPT GENERATOR ONLY — no outbound network requests,' which suggests a limited, passive role. However, the emitted prompt explicitly instructs an agent to run lark-cli config init --new, extract a browser URL, and send the user to Feishu Open Platform, so the documented intent understates the operational effect of the script.
The script sets the default language to 'zh' when no --lang argument is provided. This forces a specific language by default rather than offering a neutral default or requesting user preference, which is a natural-language locale policy concern.
The guide explicitly recommends sudo npm install -g @larksuite/cli as a remedy for permission errors. Running npm package installation as root is dangerous because npm lifecycle scripts and package contents execute with elevated privileges; if the package or any dependency is compromised, this becomes full-system code execution.
→ Verify: lark-cli --version
→ Expected: v1.0.4 (or latest)
→ Common errors:
- "EACCES: permission denied" → Run: sudo npm install -g @larksuite/cli
Or fix npm permissions: https://docs.npmjs.com/resolving-eacces-permissions-errors
- "npm: command not found" → Install Node.js first: https://nodejs.org
- China mirror (slow npm): npm install -g @larksuite/cli --registry https://registry.npmmirror.com
The script instructs users to run npx skills add larksuite/cli -y -g without pinning an exact package version. npx resolves and executes the current package from the registry, so a compromised upstream release, typosquat, or malicious dependency update could result in arbitrary code execution during installation, especially because the command is global and non-interactive.
The verification step again uses npx skills list, which may trigger package resolution/execution from an unpinned source if skills is not already locally installed. Repeating unpinned npx usage increases exposure to supply-chain compromise in an installation guide intended for broad agent use.
This is the Chinese-language duplicate of the same unsafe root-install recommendation. In the context of a setup skill that encourages users to copy/paste commands, suggesting sudo npm install -g materially increases the likelihood of privileged execution of untrusted package scripts.
→ 验证:lark-cli --version
→ 预期:v1.0.4(或最新版本)
→ 常见错误:
- "EACCES: permission denied" → 运行:sudo npm install -g @larksuite/cli
- "npm: command not found" → 先安装 Node.js:https://nodejs.org
- 国内镜像加速:npm install -g @larksuite/cli --registry https://registry.npmmirror.com
`}
This is the Chinese-language duplicate of the same unpinned npx skills add larksuite/cli -y -g installation instruction. Because it installs agent skills globally and suppresses prompts with -y, it heightens the risk of unnoticed arbitrary code execution if the upstream package is compromised.
This verification command mirrors the earlier unpinned npx skills list issue in the Chinese section. Even as a 'list' command, it may execute remotely resolved package code, which is unsafe in a setup script that users are expected to follow verbatim.
The script defaults to zh when --lang is not provided, so users receive Chinese output unless they explicitly opt into English. This is a natural-language locale choice imposed by default rather than offered neutrally at runtime.
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.
Ask the user what they'd like to do. Suggested prompts to offer:
• "Show me today's calendar agenda"
• "Send a test message to a chat"
• "Create a task for me"
• "Search my documents for ..."
• "Find a contact by name"
The script sets the default language to 'zh' when no --lang argument is provided. This imposes a specific language choice by default rather than asking the user to choose, which conflicts with the policy against forcing a locale without opt-in.
The script-generated instructions advise using sudo npm install -g @larksuite/cli if permissions fail. Running npm with root privileges is dangerous because install scripts from dependencies execute with elevated privileges, increasing the impact of any compromised package or malicious postinstall behavior.
` : ''}${activeSteps.includes('install') ? `STEP 2 — Install lark-cli
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Install the CLI (try without sudo first)
npm install -g @larksuite/cli
# If permission error: sudo npm install -g @larksuite/cli
This finding points to the same privileged-install guidance in context: encouraging root-level npm installation meaningfully expands the blast radius of any supply-chain compromise. In this skill, the danger is amplified because it is a setup guide intended to be followed verbatim by agents and end users.
# Install the CLI (try without sudo first)
npm install -g @larksuite/cli
# If permission error: sudo npm install -g @larksuite/cli
# China mirror: npm install -g @larksuite/cli --registry https://registry.npmmirror.com
# Verify installation