Back to skill

Security audit

ofox-image-core

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent Ofox image API client, but it can make paid API calls with a configured key without a code-enforced approval step.

Review this before installing if you will set OFOX_API_KEY. Use --dry-run first, verify the model, count, size, and estimated cost, and only allow a non-dry-run call after you explicitly approve it. Keep OFOX_API_BASE_URL unset unless you intentionally trust the alternate host, and remember that edit uploads the selected local image to Ofox.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
references/ofox-image.sh:2190
Finding

Billable API requests do not technically enforce prior user approval

Content
View full analysis

Vulnerability Details

File Location: references/ofox-image.sh:2190-2209 and references/ofox-image.sh:2849-2868
Vulnerability Type: Missing authorization gate for billable operations
Risk Level: Medium

Relevant requirement (SKILL.md:217-220):

markdown
## Before you spend: quote it, get a yes, then spend it

**Never send a generation request until the user has seen a cost table and
said yes.**

Generation request path (references/ofox-image.sh:2190-2209):

bash
print_estimate "$model" "${n:-1}" "$quality" "$size"

if [ -n "$dry_run" ]; then
  echo "DRY RUN — nothing was submitted and nothing was billed." >&2
  echo "Re-run without --dry-run to generate." >&2
  echo "STATUS dry_run"
  echo "MODEL $model"
  echo "QUALITY $quality"
  [ -n "$size" ] && echo "SIZE $size"
  ...
  return 0
fi

# --- the one and only network call ---

echo "Requesting image generation from Ofox (model=$model)..." >&2
local tmp_body http_code curl_rc body
tmp_body=$(mktemp)
http_code=$(curl -sS -o "$tmp_body" -w '%{http_code}' \
  --connect-timeout "$CONNECT_TIMEOUT" --max-time "$GENERATE_MAX_TIME" \
  -X POST "$API_BASE/images/generations" \
  -H "Authorization: Bearer $OFOX_API_KEY" \
  -H "Content-Type: application/json" \
  -d "$payload")

Edit request path (references/ofox-image.sh:2849-2868):

bash
print_edit_estimate "$model" "${n:-1}" "$quality" "$input_measured"

if [ -n "$dry_run" ]; then
  [ -n "$url_file" ] && rm -f "$url_file"
  echo "DRY RUN — nothing was submitted and nothing was billed." >&2
  echo "Re-run without --dry-run to edit." >&2
  echo "STATUS dry_run"
  ...
  return 0
fi

# --- the one and only network call ---

echo "Requesting image edit from Ofox (model=$model)..." >&2
local tmp_body http_code curl_rc body
tmp_body=$(mktemp)
http_code=$(curl -sS -o "$tmp_body" -w '%{http_code}' \
  --connect-timeout "$CON
...[truncated 2383 chars]
Remediation
View remediation

Remediation Suggestions

Enforce the financial authorization gate in executable code rather than relying only on Skill instructions:

  1. Make dry-run output include a cryptographically random, short-lived quote identifier bound to the validated model, endpoint, prompt hash, quantity, quality, size, extra fields, estimated cost, and API-base origin.
  2. Require a matching option such as --approve-quote <id> before any billable POST.
  3. Reject approvals when request parameters differ from the approved quote or when the quote has expired.
  4. For interactive use, require a confirmation prompt that displays the final endpoint, model, quantity, and estimate immediately before submission.
  5. For trusted non-interactive automation, use a separately named option and require an explicit spending policy, including per-request and cumulative limits.
  6. Preserve the existing --dry-run behavior, parameter validation, and maximum quantity checks as defense-in-depth.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (70)

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · CHANGELOG.md (reported line 18)May include surrounding context.

md
`--extra-form K=V` goes straight into curl's `-F`, where a **value** starting
`@` uploads that local file and one starting `<` sends that file's contents as
the field value. `--extra-form "mask=@$HOME/.ssh/id_rsa"` therefore worked:
any file the user could read, uploaded to whatever `API_BASE` points at. The
field name was never the issue, so the rule is on the value.

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/api-params.md (reported line 261)May include surrounding context.

md
`--extra-form K=V` goes straight into curl's `-F`, where a **value** starting
`@` uploads that local file and one starting `<` sends that file's contents as
the field value. `--extra-form "mask=@$HOME/.ssh/id_rsa"` therefore worked:
any file the user could read, uploaded to whatever `API_BASE` points at. The
field name was never the issue, so the rule is on the value.

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/ofox-image.sh (reported line 2683)May include surrounding context.

sh
`--extra-form K=V` goes straight into curl's `-F`, where a **value** starting
`@` uploads that local file and one starting `<` sends that file's contents as
the field value. `--extra-form "mask=@$HOME/.ssh/id_rsa"` therefore worked:
any file the user could read, uploaded to whatever `API_BASE` points at. The
field name was never the issue, so the rule is on the value.

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/test/keyguard.test.sh (reported line 19)May include surrounding context.

sh
`--extra-form K=V` goes straight into curl's `-F`, where a **value** starting
`@` uploads that local file and one starting `<` sends that file's contents as
the field value. `--extra-form "mask=@$HOME/.ssh/id_rsa"` therefore worked:
any file the user could read, uploaded to whatever `API_BASE` points at. The
field name was never the issue, so the rule is on the value.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description is for the main Ofox image-execution library: it should validate image request parameters, invoke generation or editing API calls, decode base64 image results, save output files, and report usage/cost. The supplied code chunk does none of that. Instead, it is a maintenance helper script that refreshes an offline model/pricing snapshot by fetching the public models list and writing models-snapshot.json. This is materially different in primary purpose and behavior. While the script is related to the same Ofox ecosystem and may support the larger skill indirectly, this specific code chunk does not match the declared functionality of the skill itself.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The description claims this skill is the actual shared execution layer for Ofox image generation/editing requests. However, the provided code chunk is specifically a test file (references/test/dryrun.test.sh) whose purpose is regression testing pricing, model resolution, fallback reporting, anchor-file integrity, and documentation drift. While it is related to the same Ofox image functionality, its primary behavior is materially different from the declared user-facing/library behavior: it does not implement generate/edit operations, base64 decode/save output images, or act as the synchronous API wrapper itself. Instead it invokes and inspects another script (ofox-image.sh) and associated metadata. This is a meaningful description-versus-code mismatch, even though the code is within the same project/domain.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description is for the main Ofox image API library skill, whose purpose is to execute generate/edit requests and handle image outputs plus usage/cost reporting. The supplied code chunk, however, is specifically a test script (references/test/imagecost.test.sh) that exercises only the pricing/model-selection portions of the library. It explicitly avoids submitting requests and focuses on verifying billing formulas, model-rate handling, and fallback behavior. That is a materially different purpose from the declared behavior of the skill, so this chunk does not accurately represent the described functionality.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description is for a production/shared library skill that interfaces with the Ofox image API to generate or edit images. The supplied code chunk is instead a test harness focused on validating security properties of another script, references/test/keyguard.test.sh targeting ../ofox-image.sh. While it is related to the same domain and mentions Ofox, its primary purpose is materially different: it performs negative/guard tests, local temp-file setup, and curl behavior checks. Those are not merely supporting implementation details of the described skill; they are a separate testing capability. Because the chunk neither implements the core described API behavior nor behaves like the declared library layer, this is a description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The description claims this skill is the operational execution layer for Ofox image generation/editing requests. However, the provided code chunk is specifically a test file (targetsize.test.sh) whose purpose is to verify size/aspect-ratio logic, cropping guarantees, error handling, and documentation. While it is related to the same broader skill area, its primary behavior is materially different: it sources functions from ofox-image.sh, runs dry-run validations against an unroutable API base, synthesizes local images with ffmpeg, and asserts expected outputs. None of the core declared runtime behaviors—sending one synchronous API request, decoding returned base64 image data, saving returned images, or reporting real usage/cost—are implemented here as the main function. This is therefore a description-behavior mismatch for the supplied code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The description says this skill is the shared execution layer for making real Ofox image API calls for generation/editing, with client-side validation, result decoding, file saving, and usage/cost reporting. The provided code chunk does not do that; it is explicitly a test script (validation.test.sh) for another target script, focused on validating accepted/rejected parameter combinations and model-list behavior while avoiding billable requests. While this is related to the same domain, its primary purpose is materially different from the declared library functionality, so this is a description-behavior mismatch for the supplied code chunk.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- **The script never reads a dotenv file.** `references/ofox-image.sh` resolves

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- **The script never reads a dotenv file.** `references/ofox-image.sh` resolves

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- **The script never reads a dotenv file.** `references/ofox-image.sh` resolves

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- **The script never reads a dotenv file.** `references/ofox-image.sh` resolves

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- **The script never reads a dotenv file.** `references/ofox-image.sh` resolves

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- **The script never reads a dotenv file.** `references/ofox-image.sh` resolves

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- **The script never reads a dotenv file.** `references/ofox-image.sh` resolves

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- **The script never reads a dotenv file.** `references/ofox-image.sh` resolves

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- **The script never reads a dotenv file.** `references/ofox-image.sh` resolves

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- **The script never reads a dotenv file.** `references/ofox-image.sh` resolves

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- **The script never reads a dotenv file.** `references/ofox-image.sh` resolves

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- **The script never reads a dotenv file.** `references/ofox-image.sh` resolves

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- **The script never reads a dotenv file.** `references/ofox-image.sh` resolves

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- **The script never reads a dotenv file.** `references/ofox-image.sh` resolves

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
Three models are documented in depth in `references/api-params.md` and

Static analysis

Detected: suspicious.potential_exfiltration

Shell script base64-encodes a local file and sends it over the network.

Critical
Code
suspicious.potential_exfiltration
Location
references/ofox-image.sh:549