Back to skill

Security audit

pic-gen

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent AI image generation skill, but users should treat prompts and API keys as sensitive because they are sent to external providers and may be stored locally.

Install only if you are comfortable sending image prompts to the selected provider. Prefer environment variables for API keys, avoid pasting secrets into chat or command history, do not commit config/models.yaml after adding keys, and use --download only to a trusted output directory.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/update_config.py:29
Finding

API Keys Are Stored in Plaintext and Accepted Through Command-Line Arguments

Content
View full analysis
dict: """Update the API key for the selected model.""" config = load_config() if model not in config.get("models", {}): return {"error": f"Unknown model: {model}; supported models: qwen, banana, dalle"} config["models"][model]["api_key"] = key config["models"][model]["enabled"] = True save_config(config) return {"success": True, "model": model, "message": f"{model} API key updated"} ``` ```python setkey = sub.add_parser("set-key", help="Set an API key") setkey.add_argument("model", choices=["qwen", "banana", "dalle"], help="Model name") setkey.add_argument("key", help="API Key") ``` The shipped configuration provides plaintext fields into which credentials are written: ```yaml models: qwen: enabled: true api_key: "" banana: enabled: false api_key: "" dalle: enabled: false api_key: "" ``` ### Technical Analysis The configuration manager serializes API keys directly into `config/models.yaml`. It also writes the complete configuration, including credentials, to the predictable temporary path `config/models.yaml.tmp` before replacing the final file. Neither the temporary file nor the final configuration file is explicitly created with owner-only permissions. Their ...[truncated 2477 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate_qwen.py:161
Finding

Provider-Controlled Image URLs Are Downloaded Without Destination or Size Validation

Content
View full analysis
list: """Download images locally.""" os.makedirs(output_dir, exist_ok=True) files = [] for i, url in enumerate(urls): try: resp = requests.get(url, timeout=30) if resp.status_code == 200: ext = "png" filepath = os.path.join(output_dir, f"pic_gen_{int(time.time())}_{i+1}.{ext}") with open(filepath, "wb") as f: f.write(resp.content) files.append(filepath) except Exception as e: files.append({"index": i, "error": str(e)}) return files ``` Banana downloader: ```python def download_images(urls: list, output_dir: str) -> list: os.makedirs(output_dir, exist_ok=True) files = [] for i, url in enumerate(urls): try: resp = requests.get(url, timeout=30) if resp.status_code == 200: ext = "png" filepath = os.path.join(output_dir, f"pic_gen_flux_{int(time.time())}_{i+1}.{ext}") with open(filepath, "wb") as f: f.write(resp.content) files.append(filepath) except Exception as e: files.append({"index": i, "error": str(e)}) return files ``` DALL-E downloader: ```python def download_images(urls: list, output_dir: str) -> list: os.makedirs(output_dir, exist_ok=True) files = [] for i, url in enumerate(urls): try: resp = requests.get(url, timeout=30) if resp.status_code == 200: ext = "png" filepath = os.path.join(output_dir, f"pic_ge ...[truncated 3352 chars]
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 (28)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger list includes broad phrases like 'draw a...', 'generate image of...', and especially 'AI art', which can overlap with ordinary conversation and cause the skill to activate unintentionally. In this skill, unintended activation is more concerning because the documented flow includes prompting for API keys and modifying local configuration files, increasing the chance of accidental sensitive actions or confusing control flow.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill title and interaction policy are written as a Chinese-only user experience, describing the bot conversation flow in Chinese without indicating that users may choose another language. This creates a locale/language constraint without opt-in or justification as a region-specific tool.

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 · references/dalle.md (reported line 10)May include surrounding context.

调用方式

bash
curl https://api.openai.com/v1/images/generations \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{

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 · references/flux.md (reported line 11)May include surrounding context.

Banana:

bash
curl -X POST https://api.banana.dev/start/fetch/v4/{your-model-key} \
  -H "Content-Type: application/json" \
  -d '{
    "modelInputs": {

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · references/flux.md (reported line 11)May include surrounding context.

Banana:

bash
curl -X POST https://api.banana.dev/start/fetch/v4/{your-model-key} \
  -H "Content-Type: application/json" \
  -d '{
    "modelInputs": {

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The file's docstring, help text, and status/error messages are written only in Chinese, which imposes a fixed language/locale on users. There is no opt-in, language selection mechanism, or documentation that this skill is intentionally limited to a Chinese-speaking environment.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
87% confidence
Finding

The hardcoded Banana API endpoint indicates intentional communication with an external service. In this skill context, that increases privacy and compliance risk because all prompts necessarily leave the local system, even though the transport is HTTPS and there is no evidence of overtly malicious behavior.

Content

Scanner excerpt · scripts/generate_banana.py (reported line 78)May include surrounding context.

python
"Content-Type": "application/json"
    }

    url = f"https://api.banana.dev/start/fetch/v4/{model_key}"

    try:
        response = requests.post(url, headers=headers, json=payload, timeout=60)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script sends the user-supplied prompt and generation parameters to Banana's external API without any explicit disclosure or consent mechanism. In a skill context, prompts may contain sensitive business, personal, or proprietary information, so silent exfiltration to a third party creates a real privacy and data-handling risk.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

This code transmits user-controlled prompt content to an external HTTPS endpoint (api.banana.dev). While remote API use is expected for an image-generation client, it is still a genuine data exfiltration boundary: sensitive prompts and metadata leave the local environment and are processed by a third party.

Content

Scanner excerpt · scripts/generate_banana.py (reported line 81)May include surrounding context.

python
url = f"https://api.banana.dev/start/fetch/v4/{model_key}"

    try:
        response = requests.post(url, headers=headers, json=payload, timeout=60)
        data = response.json()

        if response.status_code != 200:

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The docstring says '仅支持英文提示词', which is a natural-language policy constraint forcing a specific language. The file does not offer a language choice or explain a justified regional/compliance reason for this restriction.

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 · references/dalle.md (reported line 10)May include surrounding context.

md
if not api_key:
        return {"error": "OpenAI API Key 未设置,请在 config/models.yaml 中配置 dalle.api_key"}

    url = "https://api.openai.com/v1/images/generations"
    headers = {
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json"

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_dalle.py (reported line 43)May include surrounding context.

python
if not api_key:
        return {"error": "OpenAI API Key 未设置,请在 config/models.yaml 中配置 dalle.api_key"}

    url = "https://api.openai.com/v1/images/generations"
    headers = {
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json"

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% 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_dalle.py (reported line 67)May include surrounding context.

python
}

    try:
        response = requests.post(url, headers=headers, json=payload, timeout=60)
        data = response.json()

        if response.status_code != 200:

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% 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_qwen.py (reported line 90)May include surrounding context.

python
}

    try:
        response = requests.post(url, headers=headers, json=payload, timeout=60)
        data = response.json()

        if response.status_code != 200:

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This Python file contains natural-language descriptions and help text exclusively in Chinese, beginning with the module docstring and continuing through user-facing argument descriptions. Under the language/locale policy, forcing a specific language without user opt-in or a documented region-specific justification is a policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The comments and implementation state that DALL-E 3 prompts should be in English and automatically translate Chinese user input into English. This imposes a language choice on the user rather than offering it as an option, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The file's primary natural-language description is entirely in Chinese, which imposes a specific language context on users without any opt-in or indication that the skill is intentionally region-specific. Under the policy, locale or language constraints should either be optional or clearly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file contains natural-language guidance that imposes an English-only language constraint. Under the policy, forcing a specific language without user opt-in can be a language/locale policy violation, and the document does not offer alternatives or explain a justified region-specific need.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This is a natural-language policy issue because it explicitly directs users to use English only. The file does not provide an opt-in language choice or a documented justification beyond the statement itself.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file is natural-language documentation, and its content consistently forces a specific language for all users. Under the policy rule, language-specific behavior should either provide user choice or clearly document a justified regional scope.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document is entirely written in Chinese and does not mention that language selection is optional or that the reference is intended only for Chinese-speaking users. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The file title and all instructional content are presented in Chinese, and there is no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking audience. This can conflict with language/locale policy expectations when no opt-in or justification is provided.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The dependency is specified with a lower bound only, which allows future builds to resolve to different versions over time. This weakens reproducibility and can unintentionally introduce vulnerable or breaking releases through normal dependency resolution or supply-chain compromise.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
requests>=2.28.0
pyyaml>=6.0
banana-dev>=1.0.0

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); CVE-2024-47081 (Requests vulnerable to .netrc credentials leak via malicious URLs); CVE-2024-35195 (Requests `Session` object does not verify requests after making first request wi) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
91% confidence
Finding

Requests has multiple known advisories, and because the manifest does not pin an exact version, it is impossible to determine whether deployed environments will receive a vulnerable release. In a skill context, HTTP client libraries often handle authentication, redirects, proxies, and remote content, so version ambiguity can expose secrets or network interactions to known flaws.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
98% confidence
Finding

PyYAML is declared without an exact version, so installations may pull different releases depending on when and where the skill is installed. Because PyYAML has a history of security-sensitive parsing and deserialization issues, leaving it unpinned increases the chance of accidentally deploying an affected version.

Content

Scanner excerpt · requirements.txt (reported line 2)May include surrounding context.

text
requests>=2.28.0
pyyaml>=6.0
banana-dev>=1.0.0