Back to skill

Security audit

Hermes Deployer

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a real Hermes deployment guide, but its defaults could expose a persistent messaging agent with broad access and weak safeguards.

Review carefully before installing. Use a dedicated low-privilege service account or container, avoid bypassPermissions for a network-facing bot, disable allow-all/open messaging defaults, pin Hermes to a reviewed commit or signed release, restrict token file permissions to owner-only, and require human review before service changes, upgrades, process kills, or automatic skill changes.

Vulnerability Patterns
  • 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
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • 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
Findings (5)

T06 · System Persistence

Error
Location
SKILL.md:163
Finding

Persistent Execution Through a System-Wide systemd Service

Content
View full analysis
/dev/null << 'SVC' [Unit] Description=Hermes Agent Gateway After=network-online.target Wants=network-online.target [Service] Type=simple User=$USER Group=$USER WorkingDirectory=/home/$USER/hermes-agent ExecStart=/home/$USER/hermes-agent/venv/bin/hermes gateway run --replace Environment=HOME=/home/$USER Environment=PATH=/home/$USER/hermes-agent/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin Environment=HERMES_HOME=/home/$USER/.hermes Restart=on-failure RestartSec=15 KillMode=mixed KillSignal=SIGTERM TimeoutStopSec=30 StandardOutput=journal StandardError=journal [Install] WantedBy=multi-user.target SVC sudo systemctl daemon-reload sudo systemctl enable hermes-gateway.service sudo systemctl start hermes-gateway.service ``` ### Technical Analysis The instructions use elevated privileges to write a system-wide service definition under `/etc/systemd/system`, enable it at boot, and immediately start it. The service automatically restarts on failure and survives both termination of the deployment session and system reboots. Persistent operation is consistent with the Skill's declared purpose of running a gateway continuously. Nevertheless, it creates a durable execution mechanism for code installed from an external repository. The service launches an executable from a user-controlled working tree and virtual environment. If that executable, its dependencies, or the working tree is subsequently compromised, the changed code will execute whenever the service starts or restarts. The service runs as the configured non-root user rather than as root, which reduces direct impact. However, root privileges are still used to register and manage the service, and no meaningful systemd sandboxing restrictions are applied. ...[truncated 983 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:98
Finding

Network-Facing Agent Configured to Bypass Permission Controls

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:273
Finding

Gateway Examples Permit Unrestricted Messaging Users

Content
View full analysis
Remediation
View remediation

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:38
Finding

Mutable Remote Repository Is Installed and Later Updated Without Integrity Pinning

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:54
Finding

API and Messaging Credentials Stored in a Plaintext File Without Explicit Permission Hardening

Content
View full analysis
~/.hermes/.env << 'ENV' # === LLM Provider === # Option 1: OpenAI-compatible endpoint OPENAI_API_KEY=sk-your-api-key-here OPENAI_BASE_URL=https://api.lkeap.cloud.tencent.com/v3 # Option 2: Zhipu AI # GLM_API_KEY=your-glm-api-key # Option 3: Anthropic # ANTHROPIC_API_KEY=sk-ant-xxx # === Platform configuration === # -- Weixin iLink -- # WEIXIN_ACCOUNT_ID=xxx@im.bot # WEIXIN_TOKEN=xxx@im.bot:token # WEIXIN_BASE_URL=https://ilinkai.weixin.qq.com # WEIXIN_CDN_BASE_URL=https://novac2c.cdn.weixin.qq.com/c2c # WEIXIN_DM_POLICY=open # WEIXIN_GROUP_POLICY=open # WEIXIN_HOME_CHANNEL=user_openid@im.wechat # GATEWAY_ALLOW_ALL_USERS=true # -- Telegram -- # TELEGRAM_BOT_TOKEN=xxx # TELEGRAM_ALLOWED_USERS=user_id # TELEGRAM_HOME_CHANNEL=user_id ENV ``` ### Technical Analysis The instructions place LLM API keys and messaging-platform tokens in a plaintext `.env` file. Neither the directory nor the file is created with an explicit restrictive mode. Their permissions therefore depend on the operator's current `umask` and any pre-existing directory permissions. On a normally configured system with a restrictive umask, the resulting file may already be protected. However, the procedure does not enforce or verify this security property. On shared systems or systems with permissive defaults, other local accounts or processes may be able to read the credentials. The use of a local environment file can be operationally legitimate, but explicit ownership and mode controls are the minimum necessary protection for long-lived production credentials. ### Attack Path 1. The operator follows the instructions on a shared host or under a permissive umask. 2. `~/.hermes` or `.env` is created with group-readable or world-readable permissions. 3. Another local account or compromis ...[truncated 696 chars]
Remediation
View remediation
Vulnerability Patterns
  • 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
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
Findings (45)

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · SKILL.md (reported line 34)May include surrounding context.

md
python3 --version  # 需要 3.11+

# 2. 安装系统依赖
sudo apt update && sudo apt install -y python3-venv python3-pip git nodejs npm

# 3. 克隆 hermes-agent
cd /home/$USER

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

The skill explicitly instructs creation of a plaintext .env file to store API keys and platform secrets in the user's home directory. Plaintext credential storage is risky in server environments because other processes, backups, shell history, mis-set permissions, or accidental support/log sharing can expose long-lived secrets.

Content

Scanner excerpt · SKILL.md (reported line 54)May include surrounding context.

Hermes 支持多种 LLM provider。推荐方式是 provider: "custom" + 环境变量。

创建 ~/.hermes/.env

bash
mkdir -p ~/.hermes

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

This heredoc example normalizes writing credentials directly into ~/.hermes/.env, increasing the likelihood of insecure secret handling and accidental disclosure. In a bot deployment context, exposed tokens can let attackers impersonate the bot, access paid APIs, or interact with messaging platforms under the victim's account.

Content

Scanner excerpt · SKILL.md (reported line 59)May include surrounding context.

bash
mkdir -p ~/.hermes

cat > ~/.hermes/.env << 'ENV'
# === LLM Provider ===
# 方式一:OpenAI 兼容接口(腾讯云 LKEAP、DeepSeek、智谱 等)
OPENAI_API_KEY=sk-your-api-key-here

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
88% confidence
Finding

Removing ~/.hermes/gateway.pid as part of forceful cleanup is a destructive file operation that can mask process-state issues and, if generalized by an automated agent, normalize unsafe deletion without validation. In this troubleshooting context it is not overtly malicious, but it is still a state-altering action that should be gated and justified.

Content

Scanner excerpt · SKILL.md (reported line 384)May include surrounding context.

pkill -f 'hermes.*gateway' sleep 2 pkill -9 -f 'hermes.*gateway' # 强杀 rm -f ~/.hermes/gateway.pid sudo systemctl start hermes-gateway.service

text

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 · SKILL.md (reported line 423)May include surrounding context.

...

text

确保 .env 里有对应的 API key(`OPENAI_API_KEY` 用于 custom provider)。

### 问题:"No response generated"

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 · SKILL.md (reported line 428)May include surrounding context.

...

text

确保 .env 里有对应的 API key(`OPENAI_API_KEY` 用于 custom provider)。

### 问题:"No response generated"

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 · SKILL.md (reported line 457)May include surrounding context.

...

text

确保 .env 里有对应的 API key(`OPENAI_API_KEY` 用于 custom provider)。

### 问题:"No response generated"

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 · SKILL.md (reported line 475)May include surrounding context.

...

text

确保 .env 里有对应的 API key(`OPENAI_API_KEY` 用于 custom provider)。

### 问题:"No response generated"

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · SKILL.md (reported line 435)May include surrounding context.

快速测试 API 连通性:

bash
curl -s https://api.lkeap.cloud.tencent.com/v3/chat/completions \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"glm-5","messages":[{"role":"user","content":"hi"}],"max_tokens":10}' | python3 -m json.tool

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README explicitly encourages users to let the AI automatically install, configure, restart, and troubleshoot software on a Linux server, but it does not warn that these actions can modify system state, alter services, or affect availability. In a deployment/operations skill, this omission increases the chance that a user authorizes risky commands without informed consent, which can lead to unintended configuration changes or service disruption.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

该 markdown 文件适用 SQP-1。L004 中的触发词除了较具体的 "部署 hermes"、"安装 hermes" 外,还包含 "hermes"、"hermes agent"、"聊天机器人部署" 等过宽或边界不清的表述,缺少触发范围限制或负例说明,容易在一般讨论机器人、部署或 Hermes 相关名词时被意外匹配。

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 34)May include surrounding context.

md
python3 --version  # 需要 3.11+

# 2. 安装系统依赖
sudo apt update && sudo apt install -y python3-venv python3-pip git nodejs npm

# 3. 克隆 hermes-agent
cd /home/$USER

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 331)May include surrounding context.

md
python3 --version  # 需要 3.11+

# 2. 安装系统依赖
sudo apt update && sudo apt install -y python3-venv python3-pip git nodejs npm

# 3. 克隆 hermes-agent
cd /home/$USER

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 334)May include surrounding context.

md
python3 --version  # 需要 3.11+

# 2. 安装系统依赖
sudo apt update && sudo apt install -y python3-venv python3-pip git nodejs npm

# 3. 克隆 hermes-agent
cd /home/$USER

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 343)May include surrounding context.

md
python3 --version  # 需要 3.11+

# 2. 安装系统依赖
sudo apt update && sudo apt install -y python3-venv python3-pip git nodejs npm

# 3. 克隆 hermes-agent
cd /home/$USER

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill asks users to place API keys and platform tokens into ~/.hermes/.env and also shows permissive settings such as open DM/group policies and GATEWAY_ALLOW_ALL_USERS=true without emphasizing access-control and exposure risks. In a messaging-bot deployment skill, weak warnings here materially increase the risk of unauthorized bot access, account abuse, and credential leakage.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 57)May include surrounding context.

创建 ~/.hermes/.env

bash
mkdir -p ~/.hermes

cat > ~/.hermes/.env << 'ENV'
# === LLM Provider ===

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 57)May include surrounding context.

创建 ~/.hermes/.env

bash
mkdir -p ~/.hermes

cat > ~/.hermes/.env << 'ENV'
# === LLM Provider ===

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · SKILL.md (reported line 63)May include surrounding context.

md
# === LLM Provider ===
# 方式一:OpenAI 兼容接口(腾讯云 LKEAP、DeepSeek、智谱 等)
OPENAI_API_KEY=sk-your-api-key-here
OPENAI_BASE_URL=https://api.lkeap.cloud.tencent.com/v3

# 方式二:智谱 AI 原生(免费额度)
# GLM_API_KEY=your-glm-api-key

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · SKILL.md (reported line 239)May include surrounding context.

md
# === LLM Provider ===
# 方式一:OpenAI 兼容接口(腾讯云 LKEAP、DeepSeek、智谱 等)
OPENAI_API_KEY=sk-your-api-key-here
OPENAI_BASE_URL=https://api.lkeap.cloud.tencent.com/v3

# 方式二:智谱 AI 原生(免费额度)
# GLM_API_KEY=your-glm-api-key

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · SKILL.md (reported line 247)May include surrounding context.

md
# === LLM Provider ===
# 方式一:OpenAI 兼容接口(腾讯云 LKEAP、DeepSeek、智谱 等)
OPENAI_API_KEY=sk-your-api-key-here
OPENAI_BASE_URL=https://api.lkeap.cloud.tencent.com/v3

# 方式二:智谱 AI 原生(免费额度)
# GLM_API_KEY=your-glm-api-key

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · SKILL.md (reported line 435)May include surrounding context.

md
# === LLM Provider ===
# 方式一:OpenAI 兼容接口(腾讯云 LKEAP、DeepSeek、智谱 等)
OPENAI_API_KEY=sk-your-api-key-here
OPENAI_BASE_URL=https://api.lkeap.cloud.tencent.com/v3

# 方式二:智谱 AI 原生(免费额度)
# GLM_API_KEY=your-glm-api-key

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

This configuration pairs an external LLM endpoint with permissions.mode set to bypassPermissions, meaning the deployed agent may perform actions without interactive approval while also sending data to a third-party service. In the context of a self-improving agent deployment skill, combining unrestricted execution semantics with external service connectivity materially raises the risk profile.

Content

Scanner excerpt · SKILL.md (reported line 97)May include surrounding context.

md
model:
  default: "glm-5"           # 模型名
  provider: "custom"          # 使用 custom provider
  base_url: "https://api.lkeap.cloud.tencent.com/v3"  # API 地址

permissions:
  mode: bypassPermissions     # 服务器部署建议 bypass

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This section instructs users to create and enable a persistent systemd service, modify system configuration, and manage processes with elevated privileges, but the warnings are operational rather than security-focused. In an agent skill context, insufficient gating around persistent service creation and destructive maintenance steps increases the chance of unsafe or unintended host changes.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
93% confidence
Finding

Writing directly to /etc/systemd/system with sudo establishes persistent system-level execution. In an agent skill, creating a root-mediated service definition is a high-risk action because it changes host startup behavior and can be abused or misapplied if executed without strict confirmation and templating safeguards.

Content

Scanner excerpt · SKILL.md (reported line 162)May include surrounding context.

Phase 4: 创建 systemd 服务

bash
sudo tee /etc/systemd/system/hermes-gateway.service > /dev/null << 'SVC'
[Unit]
Description=Hermes Agent Gateway
After=network-online.target