T09 · Insecure Skill Coding Practices
- Location
scripts/image_forge.py:194- Finding
Arbitrary Local File Disclosure Through the Image Edit Command
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
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.
scripts/image_forge.py:194Arbitrary Local File Disclosure Through the Image Edit Command
references/installation.md:5Unpinned Third-Party Package Execution in Installation Guidance
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def user_secret_path(home):
return os.path.join(home, ".config", "image-forge", "secrets.json")
def read_json(path):
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def user_secret_path(home):
return os.path.join(home, ".config", "image-forge", "secrets.json")
def read_json(path):
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def user_secret_path(home):
return os.path.join(home, ".config", "image-forge", "secrets.json")
def read_json(path):
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def user_secret_path(home):
return os.path.join(home, ".config", "image-forge", "secrets.json")
def read_json(path):
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def user_secret_path(home):
return os.path.join(home, ".config", "image-forge", "secrets.json")
def read_json(path):
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def user_secret_path(home):
return os.path.join(home, ".config", "image-forge", "secrets.json")
def read_json(path):
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def user_secret_path(home):
return os.path.join(home, ".config", "image-forge", "secrets.json")
def read_json(path):
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
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
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
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
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
))
return 0
if args.command == "generate":
env = dict(os.environ)
if args.model:
env["IMAGE_FORGE_MODEL"] = args.model
result = generate_image(
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
))
return 0
if args.command == "generate":
env = dict(os.environ)
if args.model:
env["IMAGE_FORGE_MODEL"] = args.model
result = generate_image(
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.
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.
- 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`.
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.
- 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.