Back to skill

Security audit

Hermes AGI指令迭代与执行监督

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a local task-supervision helper, but its included scoring tools have unsafe input handling that could execute commands or overwrite writable JSON files.

Install only if you are comfortable with a Chinese-language local task tracker that saves your task prompts under ~/.hermes. Do not use it with sensitive instructions, and avoid invoking score.sh or the Python score command on untrusted values until the numeric validation and task-file path restrictions are fixed.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/score.sh:5
Finding

Command Injection Through Unvalidated Bash Arithmetic Expressions

Content
View full analysis
Remediation
View remediation
&2 exit 2 fi completed_num=$((10#$COMPLETED)) failed_num=$((10#$FAILED)) SCORE=$((completed_num * 10 - failed_num * 5)) ``` Additional hardening should include: - Use the validated numeric variables in every later comparison. - Quote variables in non-arithmetic shell contexts. - Define reasonable upper bounds to prevent integer overflow or nonsensical scores. - Add tests using malformed values, arithmetic syntax, array subscripts, empty arguments, negative numbers, and very large integers. - Consider moving all score processing into the Python implementation to avoid maintaining two inconsistent scoring engines. ]]>

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/hermes_supervisor.py:116
Finding

Unrestricted File Overwrite Through Attacker-Controlled Task Path

Content
View full analysis
= len(task["subtasks"]) * 0.8 else 0 total = base + quality_bonus for st in task["subtasks"]: st["status"] = "completed" if st["id"] in completed_ids else ("failed" if st["id"] in failed_ids else "pending") task["score"] = {"total": total, "base": base, "bonus": quality_bonus} task["completed_at"] = datetime.now().strftime("%Y-%m-%dT%H:%M:%SZ") with open(task_file, "w", encoding="utf-8") as f: json.dump(task, f, ensure_ascii=False, indent=2) ``` The unrestricted path is exposed by the command-line interface: ```python elif cmd == "score": task_file = sys.argv[2] completed = json.loads(sys.argv[3]) if len(sys.argv) > 3 else [] failed = json.loads(sys.argv[4]) if len(sys.argv) > 4 else [] print(json.dumps(score_task(task_file, completed, failed), ensure_ascii=False)) ``` ### Technical Analysis The `score` command accepts an arbitrary filesystem path and forwards it directly to `score_task`. The function reads and subsequently overwrites that path without verifying that: - The canonical path is contained within `~/.hermes/tasks`. - The file is a regular Hermes task file. - The path does not resolve through a symbolic link. - The parsed document conforms to a strict task schema. - The task identifier corresponds to a trusted index entry. An attacker can therefore direct the Skill to any writable JSON file with the fields required by the function. The application mutates `subtasks`, `score`, and `completed ...[truncated 1630 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description presents a broad AGI supervision system that breaks down instructions, evaluates execution, enforces reward/punishment, and rewrites inadequate instructions. The provided code only implements one narrow piece: numeric score calculation based on completed/failed counts with status labeling and JSON output. While scoring could be a supporting part of a larger supervision system, this code chunk does not perform the core declared behaviors such as task decomposition, execution validation, or instruction rewriting. Therefore the actual behavior is materially narrower and different from the declared primary purpose.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill instructs automatic invocation of local scripts and writes task data into ~/.hermes/tasks/, yet it does not declare any explicit tool scope or permissions boundary. That creates an authorization/transparency gap: an agent or user may not realize the skill performs file writes, increasing the chance of unintended local state changes or abuse if the scripts are modified or invoked on sensitive input.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill explicitly tells the AI to auto-run a shell script and create files locally, but it does not present a clear warning or consent step for those file writes. In agent environments, undocumented automatic writes can violate user expectations, create persistent artifacts, and open the door to misuse if the script handles unsafe input or writes outside the intended directory.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

L188-L189 写明“本skill不替代执行,只负责监督和优化”“奖惩积分系统需用户自行维护”,但前文 L43-L49、L106-L110、L175-L182 明确描述该 skill 会自动调用脚本记录任务到 ~/.hermes/tasks/ 并自动计算积分状态。这不是单纯遗漏实现细节,而是对 skill 是否实际管理任务与积分形成直接矛盾。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The natural-language metadata forces a specific language in the visible skill name and description, but the file does not document that the skill is intended only for Chinese-speaking users or offer any language/locale choice. Under the policy, language constraints should be opt-in or clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script persists the full user instruction in raw_input to a file under $HOME/.hermes/tasks, but there is no confirmation prompt, visible warning, or explanatory comment telling the user that their input will be stored on disk. Because this is a code file and the operation writes potentially sensitive user data to the filesystem, it meets the missing-warning criteria.

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 presents its primary natural-language interface entirely in Chinese, including the core skill description and task templates, with no indication that users may choose another language or locale. That creates a language-policy concern because the skill appears to impose a specific language by default rather than documenting an opt-in or justified region-specific constraint.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill persists raw user input and generated task records under ~/.hermes without warning, including potentially sensitive instructions, work content, or personal data. In an agent context, silent local retention increases privacy and data-handling risk because other local users, backup systems, or later processes may access this information unexpectedly.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The manifest description and the rest of the skill instructions are presented entirely in Chinese, and the file does not indicate that this language choice is optional or region-specific. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The natural-language comments and usage text are presented only in Chinese, which imposes a specific language without any opt-in, alternative locale, or documented region-specific constraint. This matches the language/locale policy violation category for natural-language content in code files.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This file contains only Chinese-language category names and instructional text, which implies the skill output or interaction is constrained to Chinese. Under the policy, language restrictions should be opt-in or clearly justified; no such choice or justification appears in this file.

Content

No source excerpt is available for this finding.