Back to skill

Security audit

agnes-image-skill

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed Agnes image-generation wrapper, but its local file path handling can upload arbitrary readable files and overwrite arbitrary writable files if misused.

Review before installing. Use it only with trusted prompts and explicit image/output paths, avoid passing sensitive local paths, and prefer a hardened version that restricts inputs and outputs to approved directories and confirms uploads to the Agnes API.

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

Error
Location
generate.mjs:96
Finding

Unrestricted Local File Disclosure Through Image Input

Content
View full analysis
Remediation
View remediation
MAX_IMAGE_BYTES) { throw new Error('Image exceeds the maximum allowed size'); } return resolved; } ``` The implementation should additionally validate magic bytes before encoding the file. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
generate.mjs:223
Finding

Arbitrary File Overwrite Through Unvalidated Output Path

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (10)

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 · .gitignore (reported line 1)May include surrounding context.

text
.env

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 41)May include surrounding context.

md
cd C:/Users/hevin/.workbuddy/skills/agnes-image-skill

# 复制模板
cp .env.example .env

# 编辑 .env,把你的 key 填进去
# AGNES_API_KEY=sk-...

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 · generate.mjs (reported line 120)May include surrounding context.

js
cd C:/Users/hevin/.workbuddy/skills/agnes-image-skill

# 复制模板
cp .env.example .env

# 编辑 .env,把你的 key 填进去
# AGNES_API_KEY=sk-...

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 · generate.mjs (reported line 21)May include surrounding context.

js
function loadEnv() {
  const __dirname = dirname(fileURLToPath(import.meta.url));
  const envPaths = [
    join(__dirname, '.env'),
    join(process.cwd(), '.env'),
  ];
  for (const path of envPaths) {

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 · generate.mjs (reported line 22)May include surrounding context.

js
function loadEnv() {
  const __dirname = dirname(fileURLToPath(import.meta.url));
  const envPaths = [
    join(__dirname, '.env'),
    join(process.cwd(), '.env'),
  ];
  for (const path of envPaths) {

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill invokes a local Node.js runtime, reads API credentials from .env, and calls an external network endpoint, but the manifest declares no explicit tool scope or permissions. This creates a least-privilege gap: the agent may execute with broader capabilities than users or reviewers expect, increasing the risk of unintended network access or secret exposure through future modifications.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases are broad natural-language expressions like '帮我生成一张图', which can appear in ordinary conversation and may activate the skill unexpectedly. Misfires can cause unplanned script execution, outbound API calls, and consumption of the configured API key or service quota without clear user intent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger phrase "生成一张图" is very generic and overlaps with common user intents for image generation, making this skill likely to activate when users did not specifically request Agnes Image. In an agent ecosystem with multiple image skills, this can cause unintended routing, surprising external API use, and accidental disclosure of prompts or images to a third-party service.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

“当用户出现以下任意意图时触发”配合简短关键词列表,说明了可触发示例,但没有定义触发范围、优先级或不触发场景。尤其“图生图”“把这张图改成 XX 风格”在多技能环境中可能与其他图像编辑能力重叠。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file's natural-language interface is entirely in Chinese, including the header comments, help text examples, and later CLI error/output strings. This imposes a specific language on users without opt-in or any documented justification that the skill is region-specific, which matches the locale-policy concern for natural-language content.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.env_credential_access

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
generate.mjs:37