Back to skill

Security audit

Hugo Blog Publisher

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent Hugo blog publisher, but it automatically reads broad memory files and can write, commit, and push blog changes without an explicit review gate.

Install only if you are comfortable with an agent reading local memory/config to find blog settings and using your GitHub credentials to publish. Before use, require a manual review of generated files, target repo/branch/remote, commit message, and final push; provide blog path/domain explicitly instead of allowing broad memory lookup.

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)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:13
Finding
Overbroad Access to Persistent Agent Memory## Vulnerability Details **File Location**: `SKILL.md:13-16` **Vulnerability Type**: Least-privilege violation through automatic access to general-purpose memory files **Risk Level**: Medium ### Vulnerable Code Snippet ```markdown ## 自动读取配置 此 Skill 会自动尝试从以下位置读取博客配置: 1. 用户记忆文件(MEMORY.md / USER.md)中的博客域名、路径等 2. 博客目录下的 .git 配置 如果未找到配置,才询问用户。 ``` ### Technical Analysis The skill directs the agent to search `MEMORY.md` and `USER.md` automatically before asking the user for blog configuration. These are general-purpose persistent memory files and may contain unrelated personal information, credentials, operational details, or instructions from previous sessions. The publishing task only requires narrowly scoped values such as a blog path and domain. Reading broad memory stores without explicit consent or field-level restrictions violates least privilege and unnecessarily brings unrelated persistent information into the active execution context. The instructions do not define permitted fields, prohibit use of unrelated content, or require user confirmation. No instruction to transmit memory contents externally was identified, so the confirmed risk is unauthorized or excessive access rather than demonstrated exfiltration. ### Attack Path 1. A user invokes the blog-publishing skill. 2. The skill automatically opens `MEMORY.md` or `USER.md` before requesting configuration. 3. Unrelated persistent information becomes available in the agent's active context. 4. That information may influence execution, appear in generated output, or be exposed through subsequent tool use or error reporting. ### Impact Assessment The affected scope includes any information stored in the accessible memory files. The skill gains read access beyond the minimum data required to publish a Hugo article. The issue does not itself grant new operating-system privileges and does not prove external data disclosure, but it increases confidentiality risk and expands the amount of sensitive co ...[truncated 31 chars]
Remediation
## Remediation Suggestions - Ask the user directly for the blog path and domain instead of searching general-purpose memory by default. - Store publishing configuration in a dedicated file containing only explicitly documented fields. - Require informed user consent before reading `MEMORY.md` or `USER.md`. - If memory access is necessary, retrieve only named configuration keys rather than loading entire files. - Explicitly prohibit using, displaying, logging, or forwarding unrelated memory content. - Validate any retrieved path or domain before using it in filesystem or Git operations.

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:116
Finding
Potential Shell Command Injection Through Unescaped Git Command Placeholders## Vulnerability Details **File Location**: `SKILL.md:116-120` **Vulnerability Type**: Shell command injection caused by unsafe interpolation of user-derived values **Risk Level**: High ### Vulnerable Code Snippet ```bash cd {博客路径} git add content/posts/{文件名} git commit -m "新增:{文章标题}" git push ``` ### Technical Analysis The documented workflow inserts the blog path, generated filename, and article title directly into shell commands. The instructions do not require structured process arguments, robust shell escaping, strict slug validation, path canonicalization, or rejection of shell metacharacters. The title is derived from user-provided article content, while the blog path may come from user input or memory. If an implementation follows this template through shell-string construction, attacker-controlled characters may terminate or modify the intended command. Quoting the commit message with double quotes is insufficient because shell substitutions and quote-breaking input may still be interpreted. The unquoted path and filename placeholders are also vulnerable to token splitting, option injection, metacharacter interpretation, and path traversal. This is an instruction-level unsafe coding pattern rather than proof that a particular runtime implementation uses a shell. Exploitation applies when an agent or wrapper executes the rendered text through a shell. ### Attack Path 1. An attacker supplies an article with a crafted title or causes a malicious blog path to be selected. 2. The skill extracts the attacker-controlled value. 3. The value is interpolated into `cd`, `git add`, or `git commit -m` according to the documented command template. 4. A shell interprets injected syntax, command substitution, separators, redirections, or additional Git options. 5. The injected operation runs with the local privileges and credentials of the publishing agent. 6. The attacker may modify local files, stage unintended content, execute local commands, or use the agen ...[truncated 558 chars]
Remediation
## Remediation Suggestions - Do not construct shell command strings from dynamic values. Invoke Git and filesystem operations through structured argument arrays. - Pass the commit message as a literal argument, for example conceptually as `["git", "commit", "-m", title]`, without shell evaluation. - Canonicalize the blog directory and verify that it resolves to an explicitly authorized repository root. - Generate slugs with a strict allowlist such as lowercase ASCII letters, digits, and hyphens. - Reject path separators, traversal sequences, control characters, shell metacharacters, and leading hyphens in generated filenames. - Use `--` before path arguments where supported, such as `git add -- <validated-path>`, to prevent option injection. - Stage an explicit allowlist of generated files rather than broad directories. - Show the exact files and commit message to the user and require confirmation before committing or pushing. - Verify the Git remote and active branch against an approved configuration before `git push`.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (8)

Tp1

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding
HTML comments in tool metadata are invisible to users but may be processed by AI agents, enabling hidden instruction injection.

Hidden Instructions

High
Category
Prompt Injection
Content
---
name: hugo-blog-publisher
version: 1.1.0
description: 发布文章到 Hugo 博客。用于当用户说"发布博客"、"推送到blog"、"post to blog"、"发布文章"等。自动完成 front matter 渲染、<!--more--> 标记添加、git 推送流程。
---

# Hugo Blog Publisher
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
---
name: hugo-blog-publisher
version: 1.1.0
description: 发布文章到 Hugo 博客。用于当用户说"发布博客"、"推送到blog"、"post to blog"、"发布文章"等。自动完成 front matter 渲染、<!--more--> 标记添加、git 推送流程。
---

# Hugo Blog Publisher
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Missing User Warnings

High
Confidence
98% confidence
Finding
The skill describes automatically creating/modifying content files, taxonomy mapping files, and then committing and pushing to Git without an explicit user confirmation gate. In a local environment with GitHub credentials, this can turn a mistaken or adversarial invocation into immediate persistence and remote publication of unintended content.

Hidden Instructions

High
Category
Prompt Injection
Content
### 5. 添加 <!--more--> 截断标记

在第一段或导言后添加 `<!--more-->`,让列表页显示摘要。

位置通常在:
- 第一段结束后的空行
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
### 5. 添加 <!--more--> 截断标记

在第一段或导言后添加 `<!--more-->`,让列表页显示摘要。

位置通常在:
- 第一段结束后的空行
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger description uses broad phrases such as '发布博客', 'post to blog', and an open-ended '等', which can cause the skill to activate for loosely related requests. Because the skill performs file writes, reads local configuration, and may push to GitHub, ambiguous activation increases the chance of unintended publication or repository modification.

Natural-Language Policy Violations

Low
Confidence
92% confidence
Finding
This markdown file is written entirely in Chinese and presents the templates and usage instructions only in that language. Under the policy rule for natural-language violations, this can be considered a language/locale constraint because it does not offer an alternative language or any opt-in choice.

Static analysis

No suspicious patterns detected.