Back to skill

Security audit

Smart Agent Workflow

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed agent-workflow methodology package, but its persistent memory features and setup guidance create privacy, prompt-injection, and unsafe command risks that should be reviewed before installation.

Install only if you want a stateful workflow skill that writes local memory/log files and you are prepared to review or disable the memory integration. Do not allow stored memory to override higher-priority instructions, restrict where memory files can be written, avoid using attacker-controlled user IDs, and replace the documented curl-to-shell, unpinned npx, and unprotected .env setup steps with pinned and verified alternatives.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
Findings (6)

T03 · Remote Payload Retrieval and Execution

Error
Location
docs/OLLAMA_SETUP.md:17
Finding

Remote Installer Is Downloaded and Executed Without Integrity Verification

Content
View full analysis
Remediation
View remediation
' echo ' ollama-package' | sha256sum -c - # Verify the publisher signature as an additional control. ``` ]]>

T02 · Agent Memory Poisoning

Error
Location
integrations/memory_manager.py:117
Finding

Untrusted Conversation Content Can Poison Persistent Agent Memory

Content
View full analysis
MEMORY_MAX_CHARS: new_memory = new_memory[:MEMORY_MAX_CHARS] + "\n...(已截断)" self.save_memory(user_id, new_memory) except Exception as e: pass # 压缩失败不影响主流程 # ========== 结构化 System Prompt ========== def build_system_prompt(self, user_id: str, base_prompt: str = "") -> str: """构建包含记忆的 System Prompt""" memory = self.load_memory(user_id) parts = [base_prompt or "你是一个智能助手,回答简洁友好。"] if memory: parts.append(f"\n【用户记忆】\n{memory}") parts.append("\n请根据用户记忆和对话历史,准确理解上下文并回复。") ...[truncated 1946 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
integrations/memory_manager.py:42
Finding

Unsanitized User Identifier Enables Filesystem Path Traversal

Content
View full analysis
list: """加载对话历史""" path = os.path.join(self.storage_dir, f"{user_id}_history.json") if os.path.exists(path): with open(path, 'r', encoding='utf-8') as f: return json.load(f) return [] def save_history(self, user_id: str, history: list): """保存对话历史(只保留最近 N 轮)""" max_msgs = SHORT_TERM_ROUNDS * 2 if len(history) > max_msgs: history = history[-max_msgs:] path = os.path.join(self.storage_dir, f"{user_id}_history.json") with open(path, 'w', encoding='utf-8') as f: json.dump(history, f, ensure_ascii=False, indent=2) def add_message(self, user_id: str, role: str, content: str) -> list: """添加一条消息到历史""" history = self.load_history(user_id) history.append({"role": role, "content": content}) self.save_history(user_id, history) return history # ========== 长期记忆(摘要压缩)========== def load_memory(self, user_id: str) -> str: """加载长期记忆""" path = os.path.join(self.storage_dir, f"{user_id}_memory.md") if os.path.exists(path): with open(path, 'r', encoding='utf-8') as f: return f.read() return "" def save_memory(self, user_id: str, content: str): """保存长期记忆""" path = os.path.join(self.storage_dir, f"{user_id}_memory.md") with open(path, 'w', encoding='utf-8') as f: f.write(content) ``` The same pattern is used for deletion: ```python def clear(self, user_id: str): """清除用户所有记忆""" for suffix in ['_history.json', '_memory.md', '_stats.json']: ...[truncated 1822 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
integrations/memory_manager.py:117
Finding

Conversation History and Persistent Memory May Be Sent to an Unrestricted External AI Provider

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
AGENTS.md:116
Finding

Documentation Invokes Unpinned Third-Party Packages

Content
View full analysis
# 如: npx skills find slack ``` ``` `docs/OLLAMA_SETUP.md:94`: ```bash # 安装 python-dotenv pip install python-dotenv ``` ### Technical Analysis The `npx skills` command may retrieve and execute a package from the configured npm registry when that package is not already installed. No package scope, exact version, integrity value, or trusted source is specified. This gives the current registry resolution control over code that executes on the local machine. The `pip install python-dotenv` command similarly installs whichever release the active Python package index currently resolves, without an exact version or hash. While `python-dotenv` is a recognized package name, unpinned installation weakens reproducibility and exposes users to future package compromise or index substitution. ### Attack Path 1. A dependency account, registry, mirror, or package release is compromised. 2. An Agent or user follows the documented `npx` or `pip` command. 3. The package manager resolves the latest available package from the configured registry. 4. The package is downloaded without comparison to a project-supplied integrity value. 5. In the `npx` case, package code may execute immediately; in the Python case, malicious installation behavior or imported package code may execute within the environment. 6. The malicious component gains the privileges of the invoking user or build process. ### Impact Assessment A compromised dependency may read local files, steal package-manager or repository credentials, modify the project, alter Agent behavior, or download additional payloads. The scope is the invoking account and any credentials or resources available to the package-manager proc ...[truncated 8 chars]
Remediation
View remediation
--hash=sha256: ``` - Install with hash enforcement: ```bash python -m pip install --require-hashes -r requirements.txt ``` - Replace the bare `npx skills` invocation with a pinned, scoped package name and reviewed version. - Prefer `npx --no-install` when the trusted tool is expected to be installed already. - Use trusted registries and lock registry configuration in controlled environments. - Review transitive dependencies and package lifecycle scripts before use. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
docs/OLLAMA_SETUP.md:81
Finding

Telegram Bot Token Is Written to a Plaintext Environment File Without Protection Guidance

Content
View full analysis
.env << 'EOF' TELEGRAM_BOT_TOKEN=你的Bot Token TELEGRAM_ADMIN_CHAT_ID=你的Chat ID AI_ENGINE=ollama OLLAMA_BASE_URL=http://localhost:11434 OLLAMA_MODEL=llama2 EOF # 安装 python-dotenv pip install python-dotenv ``` ``` The guide later repeats the plaintext write: ```bash # 方式 2:或者创建 .env 文件 echo 'TELEGRAM_BOT_TOKEN=your_bot_token' > .env echo 'TELEGRAM_ADMIN_CHAT_ID=your_chat_id' >> .env echo 'AI_ENGINE=ollama' >> .env echo 'OLLAMA_MODEL=llama2' >> .env ``` ### Technical Analysis The guide instructs users to place a live Telegram bot token in a plaintext `.env` file. It does not instruct them to set restrictive permissions, exclude the file from version control, avoid backups, or prefer a secret-management facility. The final permissions depend on the user's `umask`; in some environments, the file may be readable by other local users. Because `.env` is commonly located inside a project directory, it can also be accidentally committed, archived, copied into container images, or exposed by development tooling. ### Attack Path 1. A user replaces the placeholder with a valid Telegram bot token. 2. The shell creates `.env` using the account's default permissions. 3. Another local user, backup process, development tool, container build, or source-control operation accesses the file. 4. The token is copied or disclosed. 5. An unauthorized party uses the token to authenticate as the Telegram bot until the token is revoked. ### Impact Assessment An attacker obtaining the token can impersonate and control the Telegram bot within the permissions granted by Telegram's Bot API. This may permit sending messages, receiving updates, in ...[truncated 134 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (89)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents a general AI-agent work methodology skill covering planning/reporting/safety/context practices. The supplied code does not implement task classification, WBS decomposition, P0/P1 reporting, or safety checks. Instead, it specifically implements conversation memory persistence and summarization infrastructure. While 'Context 管理' is loosely related, the code's primary purpose is memory/history management with filesystem storage and AI-based compression, which is much narrower and materially different from the declared methodology-focused description. Therefore this is a description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description says this skill provides an AI agent methodology/process framework, which is conceptual and workflow-oriented. The actual code instead performs a concrete operational task: archiving old .md log files on disk. This is a materially different primary purpose and introduces filesystem-manipulation capabilities that are not declared. There is no evident connection between task planning/methodology features and this archival behavior, so this should be flagged as a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description presents a broad AI-agent workflow/methodology skill, emphasizing planning, reporting, safety, and context-management guidance. The supplied code instead implements a concrete file-maintenance utility for a specific markdown memory file. Its primary behavior is to inspect hot.md, create backups, and delete lines tagged [deprecated] when the file grows beyond a threshold. That is a materially different purpose from the declared methodology skill and introduces undeclared filesystem/content-modification capabilities tied to a specific resource (memory/hot.md). This is not merely a supporting implementation detail of the described methodology; it is an operational maintenance script with a different function.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a workflow/methodology skill for AI agent task management and safety practices. The supplied code does something materially different: it generates a weekly performance report from local metrics data. This is not an implementation detail of task classification, WBS decomposition, reporting prioritization, safety checking, or context management. The code also accesses local logs and writes report files, capabilities not reflected in the declared purpose. Therefore the description does not accurately represent the code's actual behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a general AI agent working methodology skill covering planning, decomposition, reporting, safety, and context management. The provided code instead implements a repository health-check utility that inspects specific files/directories and a line-count threshold in memory/hot.md. This is a materially different primary purpose and introduces filesystem validation capabilities that are not reflected in the description. While '安全检查' is mentioned in the description, this code's concrete behavior is structural file-system checking for a template, not the broader methodology functions claimed. Therefore the description does not accurately represent the supplied code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

声明描述的是高层次的工作方法论与流程指导能力,而实际代码仅实现了一个具体的指标记录脚本。代码没有体现任务类型判断、WBS 拆分、P0/P1 分级汇报、安全检查或 Context 管理等核心宣称能力。其主要功能是将运行指标写入本地日志文件,这属于未在描述中体现的实际能力,且与宣称的主要目的存在明显偏差。因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a high-level agent workflow/methodology skill, but the actual code implements a concrete filesystem utility for locked file writes. This is a materially different primary purpose: instead of providing task-judgment, WBS, reporting, safety-review, or context-management logic, it performs file output with lock acquisition and retry handling. The file-writing and lock-management capabilities are undeclared and unrelated to the stated methodology function, so this is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

There is a clear description-behavior mismatch. The declared purpose describes a cross-platform AI-agent methodology skill offering workflow guidance features, while the actual code only performs recursive keyword search in a local logs directory. This is not a supporting implementation detail of the declared methodology functions, and it introduces filesystem log access that is not mentioned in the description or permissions.

Content

No source excerpt is available for this finding.

External Script Fetching

High
Category
Supply Chain
Confidence
98% confidence
Finding

The guide recommends piping a remotely fetched shell script directly into sh, which executes network content without prior verification, review, checksum validation, or signature checks. If the upstream server, DNS, TLS trust path, or distribution script is compromised, users could execute arbitrary code on their machine immediately.

Content

Scanner excerpt · docs/OLLAMA_SETUP.md (reported line 18)May include surrounding context.

Linux:

bash
curl -fsSL https://ollama.com/install.sh | sh

Windows:

Chaining Abuse

High
Category
Tool Misuse
Confidence
97% confidence
Finding

The use of a shell pipeline to pass curl output directly into sh removes an opportunity for users or tooling to inspect the fetched content before execution. This chaining pattern amplifies the risk of remote code execution from a compromised download source and is especially dangerous in setup documentation because users are likely to copy-paste it verbatim.

Content

Scanner excerpt · docs/OLLAMA_SETUP.md (reported line 18)May include surrounding context.

Linux:

bash
curl -fsSL https://ollama.com/install.sh | sh

Windows:

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · docs/OLLAMA_SETUP.md (reported line 81)May include surrounding context.

python bot.py

text

### 方式 2:使用 .env 文件

```bash
cd ~/Desktop/smart-agent-template/integrations/telegram

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · docs/OLLAMA_SETUP.md (reported line 86)May include surrounding context.

python bot.py

text

### 方式 2:使用 .env 文件

```bash
cd ~/Desktop/smart-agent-template/integrations/telegram

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · docs/OLLAMA_SETUP.md (reported line 87)May include surrounding context.

python bot.py

text

### 方式 2:使用 .env 文件

```bash
cd ~/Desktop/smart-agent-template/integrations/telegram

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · docs/OLLAMA_SETUP.md (reported line 156)May include surrounding context.

python bot.py

text

### 方式 2:使用 .env 文件

```bash
cd ~/Desktop/smart-agent-template/integrations/telegram

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · docs/OLLAMA_SETUP.md (reported line 157)May include surrounding context.

python bot.py

text

### 方式 2:使用 .env 文件

```bash
cd ~/Desktop/smart-agent-template/integrations/telegram

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · docs/OLLAMA_SETUP.md (reported line 158)May include surrounding context.

python bot.py

text

### 方式 2:使用 .env 文件

```bash
cd ~/Desktop/smart-agent-template/integrations/telegram

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · docs/OLLAMA_SETUP.md (reported line 159)May include surrounding context.

python bot.py

text

### 方式 2:使用 .env 文件

```bash
cd ~/Desktop/smart-agent-template/integrations/telegram

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · docs/OLLAMA_SETUP.md (reported line 160)May include surrounding context.

python bot.py

text

### 方式 2:使用 .env 文件

```bash
cd ~/Desktop/smart-agent-template/integrations/telegram

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · docs/OLLAMA_SETUP.md (reported line 226)May include surrounding context.

bash
# 清理缓存重试
rm -rf ~/.ollama/models
ollama pull llama2

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · docs/OLLAMA_SETUP.md (reported line 226)May include surrounding context.

bash
# 清理缓存重试
rm -rf ~/.ollama/models
ollama pull llama2

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The protocol instructs agents to modify files and, after user confirmation, execute git push to a remote GitLab repository. Embedding direct remote write instructions in a workflow skill is dangerous because it enables code and document exfiltration or unauthorized repository changes, especially when the skill otherwise presents itself as methodology/governance rather than a deployment or release tool.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This markdown file contains operational instructions entirely in Chinese, beginning with the title and continuing throughout the document. Under the policy for natural-language violations, forcing a specific language without user opt-in or a documented justification is a reportable locale-policy issue.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
87% confidence
Finding

This is the same underlying issue: the workflow directs use of npx skills without version pinning, creating a supply-chain and arbitrary code execution exposure. Because agent skills may be followed automatically, even an informational lookup command can become dangerous if it triggers remote package resolution and execution.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill is presented as workflow methodology, but it also instructs the agent to write user-derived information into persistent logs and memory files as part of normal operation. That expands the skill from guidance into stateful data collection, which increases privacy, retention, and unintended disclosure risk beyond what a user may reasonably expect from a methodology skill.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The instructions direct the agent to collect user corrections, preferences, and standing guidance into persistent files without clear necessity tied to the skill's stated purpose. In practice, this can accumulate sensitive behavioral data or confidential user content, creating avoidable privacy and secondary-use risks if those files are later exposed or reused in unrelated contexts.

Content

No source excerpt is available for this finding.