Back to skill

Security audit

sn-search-social-cn

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed Chinese social-platform search helper, but it asks users to install an unused unpinned dependency and can persist full Zhihu content to local temporary files without a cleanup path.

Review before installing. Use an isolated virtual environment, remove the unused xhs dependency, pin dependencies, prefer environment variables over CLI cookie arguments, and manually delete any Zhihu temporary content files created during searches.

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
requirements.txt:1
Finding

Unused and Unpinned Third-Party Dependency Expands Supply-Chain Exposure

Content
View full analysis
=0.27 xhs ``` ### Technical Analysis The dependency list installs the unpinned `xhs` package even though no project script imports or uses it. The declared functionality also states that Xiaohongshu has no script entry point. Consequently, installing this package exceeds the minimum dependencies required for the Skill. Neither dependency is locked to a reviewed version or protected with artifact hashes. The unconstrained `xhs` entry allows pip to install whichever release currently satisfies the package name, along with its transitive dependencies. The `httpx>=0.27` constraint similarly permits future versions that were not reviewed during this audit. This finding does not establish that the current packages are malicious. It identifies an avoidable supply-chain attack surface: a compromised package release, malicious maintainer update, or compromised transitive dependency could introduce code during installation or runtime. ### Attack Path 1. A user follows the installation instructions and runs: ```bash python3 -m pip install -r requirements.txt ``` 2. Pip resolves the latest available `xhs` release and its transitive dependencies from the configured package index. 3. A malicious or compromised release supplies executable build, installation, or imported package code. 4. Pip installs or executes that code under the privileges of the user running the installation. 5. The malicious package can access resources available to that user, even though `xhs` is not needed by any implemented search script. The path requires compromise or malicious publication of a dependency; no such compromise was demonstrated in the audited files. ### Impact Assessment Successful exploitation could execute code with the privileges of the user or environment performing the pip ins ...[truncated 560 chars]
Remediation
View remediation
``` 2. Pin `httpx` and every required transitive dependency to reviewed versions using a lock file. 3. Generate hash-verified requirements and install with: ```bash python3 -m pip install --require-hashes -r requirements.lock ``` 4. Review dependency provenance, maintainers, release history, and known vulnerability reports before updating. 5. Install dependencies in an isolated virtual environment using a non-privileged account. 6. Add automated checks that reject unused, unpinned, or unapproved dependencies. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
scripts/zhihu_search.py:140
Finding

Zhihu Response Content Persists in Undeleted Temporary Files

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (13)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill documentation describes capabilities that require access to environment variables and outbound network requests, but it does not declare any explicit tool scope or allowed-tools/permissions boundary. This creates a governance and least-privilege gap: a runtime may grant broader access than intended, and reviewers or users cannot easily verify what the skill is permitted to do before execution.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The description and usage instructions repeatedly constrain the skill to Chinese social platforms and Chinese search contexts, but do not state that this locale restriction is optional or user-selected. Under the policy, forcing a specific language or locale without opt-in is a natural-language policy violation unless the restriction is explicitly justified and documented.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/bilibili_search.py (reported line 10)May include surrounding context.

python
from search_utils import build_parser, get_client, get_key, make_item, make_result, print_json


SEARCH_URL = "https://api.bilibili.com/x/web-interface/search/all/v2"


def search(query: str, limit: int, cookie: str | None = None, order: str = "") -> list[dict]:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script accepts a Bilibili cookie from CLI or environment and attaches it to requests to an external service, but this file provides no meaningful warning about the sensitivity of that credential or when it is actually needed. In an agent setting, users may supply account cookies without realizing they are being transmitted, increasing the risk of account/session exposure through misuse, logging, or accidental reuse.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code file contains natural-language docstrings and error/help text entirely in Chinese, including the module description and dependency-install message. Under the policy, forcing a specific language without user opt-in or documented locale justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

When content exceeds the inline limit, the script writes the full Zhihu body to a persistent temporary file using delete=False and then returns its filesystem path in output. In an agent environment, this can leave sensitive or copyrighted content on disk longer than necessary and expose local path information or file contents to downstream components/users who were not expecting durable storage.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/zhihu_search.py (reported line 172)May include surrounding context.

python
# 其他类型直接返回 obj 里的 url(若有)
    raw = obj.get("url", "")
    # 将 api.zhihu.com 替换为 www.zhihu.com
    return raw.replace("https://api.zhihu.com/", "https://www.zhihu.com/")


def _strip_html(html: str) -> str:

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

技能清单描述将知乎部分表述为“知乎问答”,而该脚本通过 --type 参数实际支持 general、topic、people、zvideo 等搜索类型,不仅限于问答内容。尤其 people 和 zvideo 明显扩展到了用户与视频搜索,超出了描述中对知乎覆盖面的限定。

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

httpx>=0.27 is only lower-bounded, so future installs may resolve to different versions over time. While this is not an exploit by itself, it weakens reproducibility and makes it harder to ensure the deployed package version has been vetted for security and compatibility.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
httpx>=0.27
xhs

Unverifiable Dependency: httpx has 2 known advisory(ies) (CVE-2021-41945 (Improper Input Validation in httpx); CVE-2021-41945 (Encode OSS httpx <=1.0.0.beta0 is affected by improper input validation in `http)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The dependency xhs is completely unpinned, so installation will pull whatever version is current at install time. This creates a supply-chain risk because builds are non-reproducible and may unexpectedly consume a vulnerable, malicious, or breaking release, which is more concerning here because the skill interacts with external Chinese social-platform content and likely relies on network-facing parsing/scraping behavior.

Content

Scanner excerpt · requirements.txt (reported line 2)May include surrounding context.

text
httpx>=0.27
xhs

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The user-facing docstrings and argument help text are written exclusively in Chinese, which imposes a specific language/locale without any opt-in or alternative. Under the stated policy, locale or language constraints should be optional or clearly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The file’s natural-language docstrings, CLI description, and user-facing error messages are all in Chinese, with no indication that other languages are supported or that the locale is intentionally constrained. This can violate language/locale policy when a skill imposes a specific language without user opt-in or documented justification.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.