Back to skill

Security audit

Universal Intelligence Agent

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a coherent web research pipeline, but it asks for broad runtime authority and has under-scoped network and filesystem controls that users should review before installing.

Review this skill before installing. It is not evidence of theft or destructive intent, but it should be run only in an environment where broad web fetching, local ~/.uia state files, possible cron monitoring, and report/WAL writes are acceptable. Avoid passing untrusted session IDs, and prefer a sandboxed network egress policy that blocks private and metadata addresses.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
middlewares/transaction.py:41
Finding

Path Traversal Through Unvalidated Session Identifiers

Content
View full analysis
500: raise ValueError(f"max_results out of range: {self.max_results}") if self.timeout < 30 or self.timeout > 3600: raise ValueError(f"timeout out of range: {self.timeout}") ``` `middlewares/transaction.py:41-48` uses the identifier directly when constructing the WAL path: ```python def __init__(self, wal_dir: Optional[Path] = None): from pathlib import Path as _Path import os as _os self.wal_dir = wal_dir or _Path(_os.path.expanduser("~")) / ".uia" / "wal" self.wal_dir.mkdir(parents=True, exist_ok=True) def write(self, entry: WALEntry): wal_file = self.wal_dir / f"{entry.session_id}.wal" ``` `middlewares/transaction.py:57-61` also uses it when reading WAL data: ```python def read(self, session_id: str) -> list[WALEntry]: wal_file = self.wal_dir / f"{session_id}.wal" if not wal_file.exists(): return [] ``` `middlewares/transaction.py:88-92` uses the same unsafe path construction ...[truncated 2886 chars]
Remediation
View remediation
str: if not SESSION_ID_PATTERN.fullmatch(value): raise ValueError("Invalid session identifier") return value ``` 4. Add defense-in-depth containment checks before every file operation: ```python def contained_path(base: Path, filename: str) -> Path: base = base.resolve() target = (base / filename).resolve() if target.parent != base: raise ValueError("Path escapes the permitted directory") return target ``` 5. Apply the checks consistently to: - WAL reads, writes, and deletion. - Report generation. - Side-effect logs. - Temporary-directory prefixes. 6. Add tests for `../`, absolute paths, backslashes, URL-encoded traversal, long identifiers, Unicode separator variants, and platform-specific drive paths. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
layers/scraper.py:170
Finding

Server-Side Request Forgery Exposure in the Documented Crawling Flow

Content
View full analysis
0: interval = random.uniform(REQUEST_INTERVAL_MIN, REQUEST_INTERVAL_MAX) time.sleep(interval) page = self._crawl_single(url, session_id) ``` `layers/scraper.py:210-215` documents the intended runtime fetch without a mandatory outbound-request policy: ```python try: # Fetch page content through the web_fetch tool. # In the actual environment, CodeBuddy runtime executes web_fetch. # Contract: web_fetch(url=url, fetchInfo="extract page body") logger.debug(f"[Scraper] Attempt {attempt}/{MAX_RETRIES} for {url}") ``` The available sanitizer in `middlewares/anti_corruption.py:48-86` checks the scheme and basic syntax but does not validate the destination network address: ```python def sanitize_url(url: str) -> Optional[str]: """ Sanitize and validate a URL. - Allow only HTTP/HTTPS. - Remove authentication information. - Validate basic format. """ from urllib.parse import urlparse, urlunparse if not url or not isinstance(url, str): return None url = url.strip() try: parsed = urlparse(url) except Exception: return None if parsed.scheme not in ("http", "https"): return None if "@" in parsed.netloc: parsed = parsed._replace(netloc=parsed.netloc.split("@")[-1]) safe_url = urlunparse(( parsed.scheme, parsed.netloc, parsed.path or "/", ...[truncated 2934 chars]
Remediation
View remediation
Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • 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 (140)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description promises a broad intelligence collection and analysis capability involving multi-engine search, anti-crawling, LLM/NLP processing, and stateful orchestration. The supplied code does none of that. It only defines typed data models for alert rules, alert events, and cron monitoring configuration. This is a materially different primary purpose: monitoring/alert schema design rather than search, scraping, or analysis execution. No evidence in this chunk supports the advertised 16-engine search, anti-crawling, LLM usage, NLP, or end-to-end information collection behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The description promises a full pipeline for information gathering through analysis, emphasizing multi-engine search, anti-scraping, LLM usage, NLP, and persistent state. However, this code chunk is purely declarative: it defines typed models and validators for expected analysis outputs. While the schema references NLP, LLM analysis, credibility, sentiment, and sources as fields, it does not perform those actions. This is a material description-behavior mismatch because the primary purpose of the code shown is contract enforcement for analysis outputs, not the advertised end-to-end intelligence collection system.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The supplied code does not implement a search agent, crawler, anti-bot logic, LLM usage, or NLP analysis. It only provides typed contract/schema infrastructure for passing data between pipeline stages and serializing/restoring state snapshots. While the description mentions '无损状态' (lossless state), this code does include snapshot persistence/restoration support, so that specific aspect is partially aligned. However, the primary declared purpose is a full information-gathering and analysis system, whereas this code chunk is merely internal context-bus plumbing. That is a material description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The description promises a broad end-to-end intelligence agent covering web search across many engines, anti-crawl capability, LLM usage, NLP, and stateful orchestration. The actual code chunk is much narrower: it only declares typed input/output data models for an NLP analysis component. While the schema does align with the NLP part of the description, it does not implement or evidence the major advertised capabilities such as search, scraping, anti-bot bypass, LLM access, or pipeline orchestration. Therefore the supplied code chunk materially underdelivers relative to the declared primary purpose, so this is a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description promises a broad intelligence collection and analysis capability spanning search, anti-crawling, LLMs, NLP, and persistent workflow. In contrast, this code chunk is limited to contract/schema definitions for report input and output objects. Schema definitions are a supporting component for a reporting system, but they do not demonstrate the advertised primary capabilities. Because the actual code's observed purpose is report data modeling rather than information gathering and analysis, this is a material description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The supplied code does not implement a search engine aggregator, crawling, anti-bot logic, LLM usage, NLP analysis, or a full collection-to-analysis pipeline. It only defines typed contracts and validation rules for search-related data structures. While these schemas may support a larger search system, this chunk’s actual behavior is limited to input/output validation, which is materially narrower than the declared purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

该代码片段的核心功能是用 Pydantic 定义严格的状态模型和事务/阶段转换规则,属于底层状态管理与恢复机制实现。虽然描述中提到“无损状态”,这与代码中的状态机、阶段历史和WAL条目有一定关联,但其余绝大多数宣称能力——搜索、爬取、反爬、LLM、NLP——在该片段中完全没有体现。就该代码块本身而言,实际行为与声明的主要用途存在明显偏差,因此应判定为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description promises a broad information-gathering and analysis system with multiple search engines, anti-crawling support, LLM/NLP capabilities, and state handling. However, the supplied code chunk is only an init.py file for a package that re-exports three classes. On its own, it does not implement or demonstrate any of the advertised capabilities. While one exported class name suggests rollback/state-related support, the primary observed behavior is simple module aggregation, which is materially different from the declared end-to-end intelligence tool.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

该描述宣称的是一个完整的信息采集与分析代理,核心能力应包括搜索、多引擎聚合、反爬、内容抓取、LLM/NLP分析等。给定代码却仅是 ACL(Anti-Corruption Layer)校验层,负责验证阶段输出的数据质量与结构完整性,例如检查 None、空列表、必需字段、URL 格式、页面内容长度、可信度分数范围,并封装为 StageValidator 用于搜索→爬取、爬取→分析、分析→报告等阶段的数据边界控制。这属于支持性基础设施,而不是描述中宣称的主要能力实现。虽然代码命名中出现搜索/爬取/分析阶段,说明它可能服务于该类系统,但当前片段本身并不执行搜索、反爬、抓取、LLM 或 NLP,因此描述与实际代码行为存在明显不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The declared description promises a broad end-to-end intelligence tool covering search across 16 engines, anti-crawling bypass, free LLM usage, NLP, and persistent state. However, the supplied code is limited to post-crawl analysis orchestration. It accepts crawl_data as input, runs three internal analyzers (NLP, credibility, LLM), selects a decision framework based on intent, and formats results into an AnalysisOutput schema. The file comments explicitly state it must not directly call search engines. Therefore, the actual behavior shown is a narrower analysis component rather than the full information collection-to-analysis pipeline described. NLP and LLM-related analysis are consistent with part of the description, but several headline capabilities are absent from this code chunk, making the description materially broader than the implemented behavior here.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

声明描述的是一个覆盖“采集+分析”全链路的综合情报工具,重点能力包括多引擎搜索、反爬、LLM、NLP和状态保持。而实际代码只是一个独立的来源可信度评分组件,输入已获取的页面数据后做启发式打分。它没有网络访问、没有搜索实现、没有抓取或反爬逻辑、没有任何大模型或自然语言处理调用,也没有状态持久化/恢复机制。虽然“信息分析”中的一个子能力——来源可信度评估——与声明中的“分析”方向略有相关,但整体主用途和能力范围明显比声明狭窄且不同,属于描述与实际行为不符。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

声明描述的是一个完整的信息采集与分析系统,重点在多引擎搜索、反爬、LLM与NLP处理等核心能力;但本代码片段实际只负责在分析失败时生成统一的降级输出,属于错误处理/兜底逻辑。它没有执行搜索、反爬、LLM推理或NLP分析,只是读取总线中可能已有的搜索结果并包装成部分结果。因此,这段代码的实际主要用途与声明的核心能力明显不一致,构成描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a broad, user-facing intelligence collection and analysis system with multiple search engines, anti-crawler support, and LLM/NLP features. The supplied code chunk does not perform searching, scraping, analysis, or model interaction. Instead, it is a narrow internal support component for tracking engine reliability and applying auto-degradation/skip policies. While engine health management could support a multi-engine search system, this chunk’s actual behavior is materially narrower than the declared purpose, so the description does not accurately represent what this code actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

声明描述的是一个端到端情报采集与分析系统,核心能力应包括多引擎搜索、反爬、LLM/NLP 分析和状态管理。但提供的代码片段仅执行 schema 到输出字典的字段映射、简单聚合统计和日期范围推断,属于内部适配/格式转换组件。虽然代码中出现 entities、sentiment、cross_validation 等分析结果字段,但它并不生成这些结果,只是读取已有数据并重组输出。因此,这段代码的实际用途与宣称的主要能力存在明显不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The declared description presents a full-featured intelligence collection and analysis pipeline with multi-engine search, anti-crawling capability, LLM/NLP analysis, and persistent state. The supplied code chunk does not perform those functions. It is an input adapter layer: it sanitizes input, infers language with simple character heuristics, classifies intent via regex patterns, validates limits, constructs a normalized request object, and provides a static engine-name list. While the engine list suggests possible integration with multiple search providers elsewhere, this chunk itself does not execute searches, scraping, analysis, monitoring, or persistence. Therefore the description materially overstates what this code actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

声明描述的是一个覆盖“搜索采集→反爬→LLM分析→状态保持”的完整情报系统,但提供的代码片段只是其中一个分析子模块,而且该模块本身也没有真正执行 LLM 调用。其主要行为是:探测本地或外部 provider 是否存在,然后始终进行规则基础的降级分析。代码与描述在核心能力和主用途上存在明显差异,尤其是搜索、反爬、状态管理和真实 LLM 使用均未体现,因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

描述宣称的是一个覆盖搜索、采集、反爬、LLM 分析和状态保持的综合情报系统;但该代码块实际只是纯 NLP 处理组件,文件头注释也明确写明“专注纯 NLP 处理,不关心搜索/爬取/报告”。其功能局限于正则分词/关键词统计、规则实体识别和按句截取摘要。虽然“NLP”这一点与描述部分吻合,但整体主用途与宣称的全链路情报员明显不一致,且多个核心宣称能力在代码中完全未体现,因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The description promises a comprehensive intelligence agent covering web search across many engines, anti-bot handling, LLM/NLP-based analysis, and end-to-end information gathering. The supplied code does not implement any of those core capabilities. Instead, it focuses on transforming existing analysis data into human-readable reports and JSON, with optional Jinja2 templating and side effects in the form of file writes to the user's home directory. That is a materially narrower and different purpose than the declared description, and it includes undeclared output/file-write behavior. While this could be one internal component of such a larger system, this specific code chunk does not accurately represent the declared functionality on its own.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The code does relate broadly to an information-collection-and-analysis pipeline because it coordinates search, crawl, analyze, report, and deliver stages. However, the declared description emphasizes user-facing capabilities such as '16-engine search', 'smart anti-crawling', 'free LLM', and 'NLP', while this code chunk does not implement or demonstrate those specific capabilities. Instead, its primary function is orchestration and operational control: scheduling phases, enforcing ACL/type validation, handling global timeouts, writing WAL snapshots, rolling back on failure, generating degraded outputs, and resuming interrupted sessions. Those are substantial undeclared capabilities and indicate the description does not accurately represent what this supplied code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description presents the skill as an end-to-end intelligence/search and analysis system. However, this code chunk does not perform search, scraping, LLM inference, NLP, or stateful orchestration of those features. Instead, it performs startup environment checks: testing outbound network access to fixed hosts, checking free disk space, inspecting WAL files for interrupted sessions, verifying Python version, and importing standard-library dependencies. WAL inspection loosely relates to the 'lossless state' claim, but the module’s primary purpose is operational readiness checking, which is materially different from the declared user-facing functionality. Therefore this chunk does not accurately represent the declared purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description advertises an information collection and analysis capability (search engines, anti-crawling, LLM, NLP). The supplied code does not implement search, crawling, NLP, or analysis. Instead, it performs internal transactional recovery/cleanup logic: reading a rollback plan, deleting files, and coordinating rollback behavior with a UnitOfWork. This is a materially different primary purpose and includes undeclared filesystem-manipulation capability.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The declared description presents a broad, end-to-end 'intelligence agent' with multi-engine search, anti-crawling resistance, LLM analysis, NLP, and state management. The supplied code is much narrower: it is a scraper module focused on fetching pages from already-supplied search results, with anti-blocking tactics such as UA rotation, randomized delays, retries, and fallback to cache/summary. Those anti-bot scraping claims are consistent with the description, but most of the larger advertised capabilities are absent from this code chunk. Because the actual behavior is only one subcomponent of the declared system and does not itself implement the core claimed search/analysis/state features, this is a description-behavior mismatch for the supplied chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description promises a broad, feature-rich information collection and analysis system. However, the supplied code chunk is only a trivial package file with a docstring and no functional logic. Based on this code alone, none of the advertised capabilities are present. Therefore, the description does not accurately represent the actual behavior of the supplied code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description advertises a broad search-and-analysis system with multi-engine search, anti-crawling bypass, LLM and NLP features, and integrated information gathering. The supplied code chunk does none of that. It is a security-focused middleware module for sanitizing inputs and content to reduce injection, XSS, malformed URL, and unsafe filename risks. While sanitization could be a supporting component in a larger system, this code chunk’s actual purpose is materially different from the declared primary purpose and does not implement the headline capabilities claimed in the description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The supplied code does not perform search, scraping, LLM inference, NLP, or information gathering/analysis. It is infrastructure code for resilience and availability control, specifically a three-level circuit breaker that monitors failures and opens/closes breakers for engines, phases, and the overall system. While such middleware could support a larger search/analysis system, this chunk’s actual purpose is materially different from the declared end-user functionality, so the description does not accurately represent this code chunk.

Content

No source excerpt is available for this finding.