Back to skill

Security audit

Image Forge

Security checks for vulnerabilities and agentic risk

Overview

ImageForge mostly matches its stated image-generation purpose, but its edit command can upload any readable local file as an image source.

Review before installing. Use this only if you trust NextAI Code with your prompts and intended source images, pin or verify any npx installer/update command, and do not let the edit command run on arbitrary paths. Avoid direct mode for untrusted instructions and confirm that every --image path is a real image you intend to upload.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/image_forge.py:194
Finding

Arbitrary Local File Disclosure Through the Image Edit Command

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
references/installation.md:5
Finding

Unpinned Third-Party Package Execution in Installation Guidance

Content
View full analysis
Remediation
View remediation
add . --skill image-forge --full-depth ``` 2. Document the expected npm package name, publisher, source repository, and reviewed version. 3. Verify package integrity through a lockfile, npm integrity metadata, or a published checksum. 4. Prefer a locally installed, verified executable instead of allowing `npx` to fetch code implicitly. 5. Use `--offline` or `--no-install` where supported after installing the audited dependency through a locked process. 6. Pin and audit the installer's transitive dependencies. 7. In automated environments, use an approved internal registry or package mirror with provenance enforcement. 8. Document how users can inspect the resolved version and package source before execution. 9. Avoid update guidance that executes an unspecified latest version; update commands should also be pinned or provenance-checked. 10. Add a warning that `npx` may execute downloaded package code with the current user's privileges. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Rogue AgentSelf-Modification, Session Persistence
Findings (36)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

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

md
def user_secret_path(home):
    return os.path.join(home, ".config", "image-forge", "secrets.json")


def read_json(path):

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · references/openai-compatible-images.md (reported line 101)May include surrounding context.

md
def user_secret_path(home):
    return os.path.join(home, ".config", "image-forge", "secrets.json")


def read_json(path):

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · references/troubleshooting.md (reported line 98)May include surrounding context.

md
def user_secret_path(home):
    return os.path.join(home, ".config", "image-forge", "secrets.json")


def read_json(path):

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/image_forge.py (reported line 62)May include surrounding context.

python
def user_secret_path(home):
    return os.path.join(home, ".config", "image-forge", "secrets.json")


def read_json(path):

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/test_image_forge.py (reported line 91)May include surrounding context.

python
def user_secret_path(home):
    return os.path.join(home, ".config", "image-forge", "secrets.json")


def read_json(path):

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/test_image_forge.py (reported line 99)May include surrounding context.

python
def user_secret_path(home):
    return os.path.join(home, ".config", "image-forge", "secrets.json")


def read_json(path):

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/test_image_forge.py (reported line 271)May include surrounding context.

python
def user_secret_path(home):
    return os.path.join(home, ".config", "image-forge", "secrets.json")


def read_json(path):

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/image_forge.py (reported line 943)May include surrounding context.

python
if prompted is None:
            return None
        prompted = prompted.strip()
        return prompted or None
    if sys.stdin.isatty():
        prompted = getpass.getpass("ImageForge API key: ")
        return prompted.strip() or None

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/image_forge.py (reported line 946)May include surrounding context.

python
if prompted is None:
            return None
        prompted = prompted.strip()
        return prompted or None
    if sys.stdin.isatty():
        prompted = getpass.getpass("ImageForge API key: ")
        return prompted.strip() or None

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/image_forge.py (reported line 1126)May include surrounding context.

python
))
            return 0
        if args.command == "generate":
            env = dict(os.environ)
            if args.model:
                env["IMAGE_FORGE_MODEL"] = args.model
            result = generate_image(

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/image_forge.py (reported line 1143)May include surrounding context.

python
))
            return 0
        if args.command == "generate":
            env = dict(os.environ)
            if args.model:
                env["IMAGE_FORGE_MODEL"] = args.model
            result = generate_image(

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill invokes shell commands, reads and writes local files, accesses environment variables, and ultimately performs networked API actions, but it declares no explicit tool scope or permission boundaries. In an agent ecosystem, this increases the chance the skill is granted broader capabilities than necessary, making misuse or unexpected command execution harder to constrain or audit.

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

md
- Prefer `scripts/image_forge.py` over hand-written HTTP commands.
- Use only the fixed NextAI Code API base: `https://www.nextai-code.com/v1`. Never use or suggest another API URL.
- Default model is `gpt-image-2` unless the user configures another NextAI-supported model.
- Default output directory is the project root; write only `.png` image files and do not create output sidecar `.json` files.
- If `preflight` reports missing API key or model, start the local `setup-server` yourself; do not ask the user to run setup commands.
- Never continue with local layout, local drawing, screenshots, or any non-ImageForge fallback when ImageForge is unconfigured.
- Never turn a vague request into an API call without the Image Brief Gate unless Direct mode applies; the command must include either `--brief '<approved brief>'` or `--direct`.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
- Use only the fixed NextAI Code API base: `https://www.nextai-code.com/v1`. Never use or suggest another API URL.
- Default model is `gpt-image-2` unless the user configures another NextAI-supported model.
- Default output directory is the project root; write only `.png` image files and do not create output sidecar `.json` files.
- If `preflight` reports missing API key or model, start the local `setup-server` yourself; do not ask the user to run setup commands.
- Never continue with local layout, local drawing, screenshots, or any non-ImageForge fallback when ImageForge is unconfigured.
- Never turn a vague request into an API call without the Image Brief Gate unless Direct mode applies; the command must include either `--brief '<approved brief>'` or `--direct`.
- Editing must support one source image plus a text instruction; multi-image edit attempts must degrade clearly if the backend rejects them.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.