Back to skill

Security audit

Zhihu Cli

Security checks for vulnerabilities and agentic risk

Overview

This Zhihu CLI skill is purpose-aligned, but it needs review because it handles reusable account cookies and allows account-content deletion without a required confirmation step.

Review this before installing if the agent will use your Zhihu account. Prefer QR login over cookie login, avoid pasting cookies into chat or command lines, consider pinning and reviewing the pyzhihu-cli version, and require the agent to ask for explicit confirmation before any delete, publish, vote, follow, or other account-changing action. Use zhihu logout to clear the local session when finished.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (2)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:41
Finding

Unpinned and Unverified Third-Party CLI Dependency

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:15
Finding

Zhihu Session Cookies Exposed Through Command-Line Arguments

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

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.

Content

Scanner excerpt · SKILL.md (reported line 54)May include surrounding context.

md
1. **诉求 → 命令**:按下表映射。
2. **数据查询优先用 --json**:凡执行**数据查询类**指令(如 `search`、`hot`、`question`、`answers`、`answer`、`user`、`user-answers`、`user-articles`、`followers`、`following`、`feed`、`topic`、`collections`、`notifications`、`whoami` 等),**必须**带 `--json`,以获取 API 返回的完整数据,便于解析、汇总或向用户展示;不得仅依赖终端表格等非结构化输出。例外:`feeds` 当前不支持 `--json`;需要展示回答评论时使用 `answer --comments`(`--json` 只输出回答详情,不输出评论)。
3. **需登录时**:先 `zhihu status`;未登录则 `zhihu login --qrcode` 或引导用户 `zhihu login --cookie "..."`。
4. **扫码登录**:执行 `zhihu login --qrcode` 后,若本轮未发过二维码且用户已配置 OpenClaw → 先将二维码复制到 OpenClaw 工作目录的 `media` 文件夹,再 `openclaw message send --channel <渠道> --target <目标> --media <media 路径>/login_qrcode.png --message "请用知乎 App 扫码并确认登录"`;**保持登录进程不中断**直到成功/失败/超时;用户说「重新登录/换号」则中断当前进程再重新执行登录。**复制步骤**:Linux/macOS:`mkdir -p ~/.openclaw/workspace/media && cp ~/.zhihu-cli/login_qrcode.png ~/.openclaw/workspace/media/`;Windows:`mkdir "%USERPROFILE%\.openclaw\workspace\media" 2>nul & copy "%USERPROFILE%\.zhihu-cli\login_qrcode.png" "%USERPROFILE%\.openclaw\workspace\media\login_qrcode.png"`(若 OpenClaw 工作目录不同则替换为实际路径)。
5. **安全**:Cookie 仅本地;优先扫码,避免在不可信处粘贴 Cookie;可提醒 `zhihu logout` 清空。
6. **升级**:`uv tool upgrade pyzhihu-cli` / `pipx upgrade pyzhihu-cli` / `pip install -U pyzhihu-cli`。

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

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.

Content

Scanner excerpt · SKILL.md (reported line 137)May include surrounding context.

md
1. **诉求 → 命令**:按下表映射。
2. **数据查询优先用 --json**:凡执行**数据查询类**指令(如 `search`、`hot`、`question`、`answers`、`answer`、`user`、`user-answers`、`user-articles`、`followers`、`following`、`feed`、`topic`、`collections`、`notifications`、`whoami` 等),**必须**带 `--json`,以获取 API 返回的完整数据,便于解析、汇总或向用户展示;不得仅依赖终端表格等非结构化输出。例外:`feeds` 当前不支持 `--json`;需要展示回答评论时使用 `answer --comments`(`--json` 只输出回答详情,不输出评论)。
3. **需登录时**:先 `zhihu status`;未登录则 `zhihu login --qrcode` 或引导用户 `zhihu login --cookie "..."`。
4. **扫码登录**:执行 `zhihu login --qrcode` 后,若本轮未发过二维码且用户已配置 OpenClaw → 先将二维码复制到 OpenClaw 工作目录的 `media` 文件夹,再 `openclaw message send --channel <渠道> --target <目标> --media <media 路径>/login_qrcode.png --message "请用知乎 App 扫码并确认登录"`;**保持登录进程不中断**直到成功/失败/超时;用户说「重新登录/换号」则中断当前进程再重新执行登录。**复制步骤**:Linux/macOS:`mkdir -p ~/.openclaw/workspace/media && cp ~/.zhihu-cli/login_qrcode.png ~/.openclaw/workspace/media/`;Windows:`mkdir "%USERPROFILE%\.openclaw\workspace\media" 2>nul & copy "%USERPROFILE%\.zhihu-cli\login_qrcode.png" "%USERPROFILE%\.openclaw\workspace\media\login_qrcode.png"`(若 OpenClaw 工作目录不同则替换为实际路径)。
5. **安全**:Cookie 仅本地;优先扫码,避免在不可信处粘贴 Cookie;可提醒 `zhihu logout` 清空。
6. **升级**:`uv tool upgrade pyzhihu-cli` / `pipx upgrade pyzhihu-cli` / `pip install -U pyzhihu-cli`。

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill explicitly exposes destructive commands such as delete-question, delete-pin, and delete-article including the -y non-interactive confirmation flag, but it does not require an explicit user confirmation step or warn that deletion is irreversible. In an agent-execution context, this increases the chance of accidental or prompt-induced destructive actions against the user's account and content.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.