Back to skill

Security audit

Doc Illustration

Security checks for vulnerabilities and agentic risk

Overview

The skill has a legitimate image-generation purpose, but it should be reviewed because it can send API keys, prompts, briefs, and reference images to configurable OpenAI-compatible endpoints without tight scoping.

Review before installing. Use it only for documents and images you are allowed to send to the selected image provider, prefer the official OpenAI endpoint for sensitive work, verify OPENAI_BASE_URL before running, and keep generated JSON sidecars out of shared repos if prompts or briefs contain private information.

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

Error
Location
scripts/generate_doc_illustration.py:118
Finding

Arbitrary API Endpoint Can Receive Credentials and Sensitive User Content

Content
View full analysis
tuple[str | None, str | None]: api_key = os.getenv("OPENAI_API_KEY") base_url = os.getenv("OPENAI_BASE_URL") if api_key: return api_key, base_url ``` At `scripts/generate_doc_illustration.py:242-248`, both the credential and unrestricted endpoint are passed to the OpenAI client: ```python def build_client(api_key: str | None, base_url: str | None) -> OpenAI: kwargs: dict[str, Any] = {} if api_key: kwargs["api_key"] = api_key if base_url: kwargs["base_url"] = base_url return OpenAI(**kwargs) ``` At `scripts/generate_doc_illustration.py:326-328`, the resulting client is used for live generation: ```python api_key, base_url = get_api_settings(require_key=True) model_name = resolve_model_name(base_url) client = build_client(api_key, base_url) ``` The documented policy also permits unknown providers. At `references/openai-image-workflow.md:27-31`: ```markdown ## Provider-specific model mapping - Official OpenAI base URL: use `gpt-image-2` - `https://aihubmix.com/v1`: use `gpt-image-2` - `https://api.ofox.ai/v1`: use `openai/gpt-image-2` - Unknown providers: default to `gpt-image-2` unless the provider documents a namespaced variant ``` ### Technical Analysis `OPENAI_BASE_URL` crosses a security trust boundary because it determines which remote server receives authenticated image-generation requests. The script does not validate the URL scheme, hostname, port, or provider identity before combining t ...[truncated 2819 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (12)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill instructs reading environment variables, reading reference files, and invoking a local script, but it declares no explicit tool scope or permissions boundary. That mismatch can cause an agent runtime to grant broader file/env access than users expect, increasing the chance of unintended secret exposure or filesystem access during execution.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The description is broad enough to trigger on many common documentation, design, and code-explanation tasks, which increases the odds the skill is invoked in contexts where users did not specifically request external image generation. In this skill's context, overbroad matching is more dangerous because invocation can lead to reading local files and sending derived content to third-party model providers.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
93% confidence
Finding

The skill explicitly supports sending prompts and possibly reference images to external providers, including non-official endpoints, which creates a real data exfiltration path for technical documents, repo architecture details, or sensitive design notes. In this context the risk is elevated because the skill is intended to transform internal engineering content into images, so confidential material may be transmitted outside the trusted environment.

Content

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

md
## Model selection

- Use `gpt-image-2` for official OpenAI and for `https://aihubmix.com/v1`.
- Use `openai/gpt-image-2` for `https://api.ofox.ai/v1`.
- Default back to `gpt-image-2` unless a provider requires a namespaced model name.

## References

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill enables implicit invocation with no visible trigger constraints, so an agent may call it automatically based on broad semantic matching rather than explicit user intent. Because this skill can generate and transform document-derived content, unintended invocation could expose sensitive document text, design notes, or repository context to the model or external image-generation workflow when the user did not explicitly request illustration generation.

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 · references/openai-image-workflow.md (reported line 15)May include surrounding context.

md
- Read `OPENAI_BASE_URL` from the current shell environment second.
- If `OPENAI_API_KEY` is missing and the script is attached to a TTY, prompt securely for a temporary key.
- If `OPENAI_API_KEY` is missing and the script is not attached to a TTY, fail with a clear `export OPENAI_API_KEY=...` example.
- Do not write credentials to disk.
- Do not modify `~/.zshrc` or any `.env` file automatically.

## Provider-safe defaults

External Transmission

Medium
Category
Data Exfiltration
Confidence
84% confidence
Finding

The workflow supports sending prompts and possibly reference images to third-party OpenAI-compatible providers such as aihubmix and ofox, which constitutes external transmission of potentially sensitive user content. In this skill's document-illustration context, inputs may include internal engineering docs, architecture visuals, or design specs, so routing them to alternate providers without explicit trust, consent, or data-classification checks increases confidentiality risk.

Content

Scanner excerpt · references/openai-image-workflow.md (reported line 30)May include surrounding context.

md
- Official OpenAI base URL: use `gpt-image-2`
- `https://aihubmix.com/v1`: use `gpt-image-2`
- `https://api.ofox.ai/v1`: use `openai/gpt-image-2`
- Unknown providers: default to `gpt-image-2` unless the provider documents a namespaced variant

## Request modes

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The workflow explicitly requires saving a JSON sidecar containing the full brief, prompt, reference image list, and output paths, but provides no warning, minimization, or redaction guidance for sensitive content. In this skill context, prompts and referenced document metadata may contain proprietary architecture details, internal design notes, or other confidential information that would persist locally and be exposed to other users, backups, or source control if mishandled.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script defaults --language to zh-en, and the generated prompt later instructs the model to prefer Chinese/English labels. This imposes a specific language/locale behavior by default rather than offering a neutral default or requiring explicit user choice.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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/generate_doc_illustration.py (reported line 140)May include surrounding context.

python
if not base_url:
        return "gpt-image-2"
    normalized = base_url.rstrip("/").lower()
    if normalized.startswith("https://api.ofox.ai/v1"):
        return "openai/gpt-image-2"
    return "gpt-image-2"

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The prompt explicitly tells the model to use concise Chinese/English labels and includes a language mode setting, which constitutes a natural-language locale constraint. Because this behavior is enforced in the prompt rather than presented as an opt-in choice, it can violate language/locale policy expectations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The instruction to prefer concise bilingual labels imposes a language behavior by default. Because it does not ask for user preference or explain a justified locale constraint, it conflicts with the policy requiring language or locale choice unless clearly documented.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The markdown instructs that outputs should include 'concise Chinese/English labels' as a default behavior. This imposes a language choice without indicating that the user can opt in, opt out, or select another locale, which fits the language/locale policy violation category.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.