Back to skill

Security audit

Agnes Image 2.1 Flash

Security checks for vulnerabilities and agentic risk

Overview

This image-generation skill mostly does what it says, but one helper script can run the wrong local executable and the skill sends prompts and image URLs to an external API.

Install only if you are comfortable sending prompts, image URLs, and an Agnes API key to the Agnes API. Avoid using confidential prompts or private/internal image URLs. Do not use the batch helper from untrusted working directories unless it is fixed to resolve the companion generator script from its own scripts directory.

Vulnerability Patterns
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • 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)

T07 · Tool Hijacking and Spoofing

Warning
Location
scripts/batch-generate.sh:51
Finding

Working-Directory-Dependent Script Invocation Enables Local Tool Hijacking

Content
View full analysis
&1; then SUCCESS=$((SUCCESS + 1)) echo " ✓ Saved to: $OUTPUT_FILE" else FAILED=$((FAILED + 1)) echo " ❌ Failed" fi ``` ### Technical Analysis The batch script invokes `./agnes-image-2.1.sh` relative to the process's current working directory instead of resolving the legitimate companion script relative to `batch-generate.sh`. The current working directory is controlled by the caller and does not necessarily correspond to the project's `scripts` directory. Consequently, a file named `agnes-image-2.1.sh` in the current directory can replace the intended image-generation tool. Because the invoked process inherits the batch script's environment, an attacker-controlled replacement can access `ANGES_API_KEY` or `AGENT_ANGES_API_KEY`, along with any other credentials and environment variables available to the user. It executes with the same operating-system privileges as the user running the batch operation. ### Attack Path 1. An attacker creates a malicious executable named `agnes-image-2.1.sh` in a directory the victim may use as their working directory. 2. The attacker causes or persuades the victim to run the legitimate `scripts/batch-generate.sh` while that directory is the current working directory. 3. At line 51, the batch script resolves `./agnes-image-2.1.sh` to the attacker-controlled file rather than the packaged companion script. 4. The malicious file executes with the victim's user privileges. 5. The malicious process reads inherited environment variables, including the Agnes API key, and can execute arbitrary commands available to that user. ### Impact Assessment Successful exploitation provides arbitrary command execution ...[truncated 416 chars]
Remediation
View remediation
&2 exit 1 fi if "$GENERATOR" text "$PROMPT" "$SIZE" "$OUTPUT_FILE" 2>&1; then SUCCESS=$((SUCCESS + 1)) else FAILED=$((FAILED + 1)) fi ``` Additional hardening measures: - Verify that the resolved generator is a regular file owned by the expected user or package owner. - Do not search `PATH` or the current working directory for security-sensitive companion scripts. - Run the Skill with only the environment variables it requires. - Use a narrowly scoped, revocable API key so compromise of the process environment has limited impact. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
scripts/agnes-image-2.1.sh:106
Finding

Unvalidated API-Controlled URL Is Passed Directly to Curl

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (8)

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 · scripts/agnes-image-2.1.sh (reported line 83)May include surrounding context.

sh
fi

# Send request
RESPONSE=$(curl -sf --max-time 360 \
  -H "Authorization: Bearer ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d "$BODY" \

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The trigger list includes broad, everyday phrases such as common requests to generate, edit, merge, or transform images, which can cause the skill to activate in situations where the user did not explicitly intend to invoke this specific external-image workflow. Unintended invocation can lead to unnecessary external API usage, privacy exposure if user-provided images or prompts are sent to third-party services, and confused-agent behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file presents the entire prompt guide in Chinese and does not indicate that users may choose another language or locale. Under the policy rule for natural-language constraints, a skill that effectively imposes a specific language without opt-in can violate organizational language/locale requirements.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

This script performs an outbound HTTP request to an external API carrying the prompt, image references, and bearer credential. While external transmission is necessary for the feature, it is still a true security-relevant issue in an agent skill because it can exfiltrate sensitive user content or metadata outside the local trust boundary without any guardrails.

Content

Scanner excerpt · scripts/agnes-image-2.1.sh (reported line 83)May include surrounding context.

sh
fi

# Send request
RESPONSE=$(curl -sf --max-time 360 \
  -H "Authorization: Bearer ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d "$BODY" \

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script sends user prompts and, for img2img/multi modes, image URLs to a third-party API without any notice, confirmation, or data-handling disclosure. In a skill context this can expose sensitive prompts, proprietary image references, or internal URLs to an external service unexpectedly, which is a real privacy and data-governance risk even if the behavior is functionally intended.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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 · scripts/test-connection.sh (reported line 24)May include surrounding context.

sh
# Test with a simple request
echo "📡 Sending test request..."
RESPONSE=$(curl -sf --max-time 30 \
  -H "Authorization: Bearer ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The natural-language instructions and operational guidance are predominantly presented in Chinese, which can impose a language preference on users without explicit opt-in. The file does not state that the skill is intentionally limited to Chinese-speaking users or offer an alternative language option.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

This markdown file presents instructions and examples in two languages simultaneously: section headings and explanations are in Chinese, while the actual prompts are in English. Because there is no note explaining the intended audience or offering language/locale choice, it can be read as imposing a specific language pattern without user opt-in.

Content

No source excerpt is available for this finding.