Back to skill

Security audit

sn-search-code

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent developer-search skill that calls known search APIs, with routine cautions around optional API tokens and dependency installation.

Install in an isolated Python environment, consider pinning httpx before use, and provide GitHub/HuggingFace/Stack Exchange credentials through environment variables or a secret manager rather than command-line flags. Do not search for sensitive private text unless you are comfortable sending that query to the selected third-party API.

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

Unbounded Third-Party Dependency Version

Content
View full analysis
=0.27 ``` The documented installation workflow is: ```bash python3 -m pip install -r requirements.txt ``` ### Technical Analysis The dependency specification permits pip to install any available `httpx` release at or above version 0.27. No upper bound, exact version, lock file, or package hash is provided. Consequently, the dependency installed in the future may differ from the version considered during this audit. If the package distribution channel, maintainer account, or a future release is compromised, installation or import of the resolved package could execute attacker-controlled code. The current artifact does not itself retrieve and execute arbitrary source code, and no evidence indicates that the current `httpx` package is malicious; the risk arises from the non-reproducible dependency policy. ### Attack Path 1. An attacker compromises the upstream package, maintainer account, or package distribution channel and publishes a malicious version satisfying `httpx>=0.27`. 2. A user follows the documented command to install the project dependencies. 3. Pip resolves the malicious or compromised version because it satisfies the open-ended constraint. 4. Attacker-controlled package installation or runtime code executes in the Python environment. 5. The code gains the permissions of the user or service account performing the installation or running the search scripts. ### Impact Assessment Successful exploitation could execute arbitrary code with the privileges of the installing or runtime account. Depending on that account's permissions, this could expose environment variables, API tokens, accessible files, search queries, and network resources. If installation is performed with administrative ...[truncated 59 chars]
Remediation
View remediation
``` 2. Generate and maintain a dependency lock file through a controlled update process. 3. Record cryptographic hashes and install with pip's `--require-hashes` option. 4. Review transitive dependencies, because pinning only the direct dependency does not make the full environment reproducible. 5. Run dependency installation as an unprivileged account in an isolated virtual environment or container. 6. Use automated dependency vulnerability and provenance scanning before accepting upgrades. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
scripts/github_search.py:83
Finding

API Credentials Accepted Through Command-Line Arguments

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 (14)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

声明描述的是一个更广泛的多源检索能力,覆盖 GitHub、技术问答、开发者讨论和 HuggingFace 资源。但代码实际只调用 GitHub Search API 的 repositories/code/issues 三类端点,没有任何面向技术问答站点、开发者论坛/讨论区或 HuggingFace Hub 的访问逻辑。因此描述未准确反映实际行为,存在明显的能力范围不一致。虽然代码确实支持查找开源项目、代码示例和 GitHub Issue,这与声明的部分内容一致,但声明中的其他主要能力并未实现。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

代码行为非常聚焦:根据 --type 选择 models/datasets/spaces,调用 https://huggingface.co/api 对应端点进行搜索,可选使用 HF_TOKEN 鉴权,然后解析并输出 HuggingFace 结果。其访问资源和主功能仅限 HuggingFace Hub。相比之下,声明描述了更广泛的搜索能力,包含代码示例、开源项目、GitHub Issue、技术问答、开发者讨论等,这些通常需要访问 GitHub、问答站点或开发者社区资源,但代码中完全没有相关实现。因此描述未准确代表该代码块的实际能力,属于明显不匹配。

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The visible user-facing description and heading are written entirely in Chinese, and the file does not indicate that language selection is optional or that the skill is specifically intended only for Chinese-speaking users. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation.

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/github_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


API_BASE = "https://api.github.com/search"

# 搜索类型 -> API 路径
SEARCH_TYPES = {

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The module's natural-language documentation is entirely in Chinese and describes the shared utility library in that language, indicating a fixed language choice. Under the policy, forcing a specific language without offering user choice or documenting a justified locale constraint is a violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring and subsequent CLI help strings are written in Chinese, which imposes a specific language on users without offering a locale selection. This can violate language or locale policy where skills should not force a language absent user opt-in or clear region-specific justification.

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/stackoverflow_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


API_URL = "https://api.stackexchange.com/2.3/search/advanced"


def search(query: str, limit: int, sort: str = "relevance", tagged: str | None = None, api_key: str | None = None) -> list[dict]:

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The dependency is specified as httpx>=0.27, which allows any future release to be installed and makes builds non-reproducible. This can unintentionally pull in breaking or vulnerable versions over time, increasing supply-chain risk even if no specific exploit is guaranteed today.

Content

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

text
httpx>=0.27

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
82% confidence
Finding

Because the manifest does not pin the httpx version, it is impossible to verify from this file alone whether the installed release includes a version affected by known advisories. The danger is primarily uncertainty and supply-chain exposure: an environment could resolve to a vulnerable release without the maintainer realizing it.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The module docstring is written entirely in Chinese, and the CLI help text elsewhere in the file is also Chinese-only. This imposes a specific language choice in user-facing text without offering an alternative or opt-in, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The command description and argument help strings are user-facing natural language, but they are provided only in Chinese. Because the file offers no language choice or documented locale-specific justification, this is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

This code sends the user's query and request metadata to an external service via HTTP, which is a data-transmitting operation. In this file there is no confirmation prompt, print/log disclosure, or comment/docstring warning that user input will be sent to hn.algolia.com.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code performs an outbound HTTP request to api.stackexchange.com using user-provided query data and may also include an API key from arguments or environment variables. Although network access is the skill's purpose, the file itself contains no confirmation prompt or explicit disclosure that user input and credentials are sent to a third-party service.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.