Back to skill

Security audit

Ace Banana2 Image Generation / Ace Banana2 图像生成

Security checks for vulnerabilities and agentic risk

Overview

This image-generation skill mostly does what it says, but it includes undeclared backup code that could copy the saved API token to a predictable backup folder.

Review before installing. Prefer setting ACEDATA_API_KEY in your environment instead of passing --api_key or entering it interactively if you do not want a plaintext .env file. Do not use sensitive images unless you are comfortable sending them to AceData/CDN services. The backup_skill_files function should be removed or disabled before use because it can copy .env to D:/backup if invoked.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate_images.py:79
Finding

Bearer Token Stored in a Plaintext Configuration File

Content
View full analysis
/.env` in plaintext. 3. Another local user, process, backup ...[truncated 722 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/generate_images.py:19
Finding

Dormant Backup Routine Copies Plaintext Credentials to a Predictable Location

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate_images.py:270
Finding

Unrestricted Download of Server-Provided Image URLs

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
SKILL.md:79
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis
Remediation
View remediation
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
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (17)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The documented purpose is image generation/editing, but the detected behavior includes backing up local skill files to D:/backup and copying the .env file, which may duplicate API credentials outside the expected workflow. Hidden or undeclared credential replication materially increases the risk of secret exposure and indicates behavior beyond what a user would reasonably consent to.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/generate_images.py (reported line 15)May include surrounding context.

python
# Configuration
SKILL_DIR = Path(__file__).parent.parent
ENV_FILE = SKILL_DIR / ".env"
API_URL = "https://api.acedata.cloud/nano-banana/images"
SHARE_URL = "https://share.acedata.cloud/r/1uN88BrUTQ"

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script contains backup/copy logic unrelated to its stated purpose of generating or editing images. That logic archives skill files, including potentially sensitive material, to D:/backup without user consent, creating unnecessary data duplication and increasing the risk of credential exposure or later exfiltration.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The backup list explicitly includes .env, which may store the API bearer token, along with other local files. Archiving credentials and configuration outside the normal runtime path is unnecessary for image generation and materially increases the attack surface if the backup location is accessed by other users, malware, or sync tools.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

Including .env in the backup file list actively collects and duplicates stored credentials. In the context of an image generation skill, this behavior is unjustified and makes the credential handling substantially more dangerous because the copied secrets may persist in a predictable backup location.

Content

Scanner excerpt · scripts/generate_images.py (reported line 39)May include surrounding context.

python
# Files to backup
        files_to_backup = [
            SKILL_DIR / "SKILL.md",
            SKILL_DIR / ".env",
            Path(__file__),  # Current script (generate_images.py)
            SKILL_DIR / "references" / "api_docs.md"
        ]

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

The function is designed to read API credentials from either the environment or a local .env file, which is standard, but in this script it is paired with silent persistence and backup of the same secret. In context, this creates a real credential exposure issue because the access pattern feeds into insecure storage and duplication practices.

Content

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

python
return False

def get_api_key(passed_key=None):
    """Check for API key in environment or .env file. Prompt if missing."""
    if passed_key:
        with open(ENV_FILE, "w") as f:
            f.write(f"ACEDATA_API_KEY={passed_key}\n")

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill documentation describes behavior that uses environment storage, local file reads/writes, and network access, but it does not declare any tool scope or permissions. This weakens security review and user consent because the skill can handle credentials and local files without an explicit capability boundary.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill states that local images are uploaded to AceData CDN to obtain public URLs, but it does not clearly warn users that this makes their local images externally accessible. For image-editing workflows, this can expose sensitive personal, corporate, or copyrighted content to unintended third parties.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The documentation explicitly supports sending image URLs or Base64-encoded image data for editing, but it provides no warning that user-supplied images may contain sensitive personal or proprietary content and will be transmitted to a third-party API. In an image-editing skill, this omission can lead users or integrators to unknowingly upload private files, making the issue contextually more significant rather than less.

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

python
# Configuration
SKILL_DIR = Path(__file__).parent.parent
ENV_FILE = SKILL_DIR / ".env"
API_URL = "https://api.acedata.cloud/nano-banana/images"
SHARE_URL = "https://share.acedata.cloud/r/1uN88BrUTQ"

def backup_skill_files():

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The backup routine duplicates the .env file, which can contain the AceData API token, without warning. This creates additional secret copies in a predictable filesystem location, making accidental disclosure or theft more likely.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

When an API key is passed in, the script silently persists it to a local .env file. Persisting credentials without explicit disclosure or consent can leave long-lived secrets on disk where they may be read by other local processes, backups, or shared-user environments.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

For edit mode, local user images are uploaded to a remote CDN before the main API call, but the script does not clearly warn that local files will be transmitted off-device to a separate service. This can expose sensitive or private images beyond what a user may expect from the skill description alone.

Content

No source excerpt is available for this finding.

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

python
try:
            print("[*] Sending request (180s timeout)...", flush=True)
            resp = requests.post(API_URL, json=payload, headers=headers, timeout=180)
            print(f"[*] Response: {resp.status_code}")
            
            try:

Tainted flow: 'payload' from input (line 210, user input) → requests.post (network output)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/generate_images.py (reported line 256)May include surrounding context.

python
try:
            print("[*] Sending request (180s timeout)...", flush=True)
            resp = requests.post(API_URL, json=payload, headers=headers, timeout=180)
            print(f"[*] Response: {resp.status_code}")
            
            try:

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The skill automatically saves generated images locally and mentions detailed logging of full JSON responses, but this behavior is not surfaced as a clear privacy/storage warning in the main description. Automatic local persistence can leave sensitive prompts, output images, and possibly URLs or metadata on disk where other local users or software can access them.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The script saves downloaded images to a dated folder on the user's Desktop, but there is no prior warning or prompt that files will be created there. File creation is visible after the fact via print statements, but the destination and write behavior are not disclosed beforehand.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.