Back to skill

Security audit

AI Image Generator & Splitter

Security checks for vulnerabilities and agentic risk

Overview

This is a real image-generation web app, but it exposes powerful local server controls and credential/data handling with insufficient safeguards.

Install only if you will run it on a trusted local machine and keep port 2688 inaccessible from other users, browsers, and networks. Treat entered API keys, platform tokens, prompts, reference images, generated images, and local paths as sensitive: the app stores keys in browser localStorage, logs some request data, and sends content to external AI/upload services. Review or harden the unauthenticated admin APIs before using it with confidential files or paid credentials.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • 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
Findings (8)

T09 · Insecure Skill Coding Practices

Error
Location
server/index.js:325
Finding

Unauthenticated Shell Command Injection in Folder-Opening Endpoint

Content
View full analysis
{ try { const { path: folderPath } = req.body; if (!folderPath) { return res.status(400).json({ success: false, error: 'Path cannot be empty' }); } if (!fs.existsSync(folderPath)) { return res.status(404).json({ success: false, error: 'Folder does not exist' }); } const { exec } = require('child_process'); let command; if (process.platform === 'win32') { command = `explorer "${folderPath}"`; } else if (process.platform === 'darwin') { command = `open "${folderPath}"`; } else { command = `xdg-open "${folderPath}"`; } res.json({ success: true, msg: 'Folder opened' }); exec(command, (error) => { if (error) { console.error('Failed to open folder:', error); } }); } catch (error) { console.error('Open-folder exception:', error); res.status(500).json({ success: false, error: error.message }); } }); ``` ### Technical Analysis The endpoint directly interpolates the attacker-controlled `folderPath` into a command executed through `child_process.exec()`. `exec()` invokes a command shell, so shell metacharacters contained in the path can terminate or alter the intended command. Surrounding the value with double quotes does not reliably prevent shell injection. The `fs.existsSync()` check is not a security boundary. An attacker can construct input containing an existing path followed by platform-specific shell syntax. The endpoint has no authentication or authorization. Opening a generated-work folder is a legitimate feature, but accepting arbitrary paths and invoking a shell exceeds the minimum privilege needed for that feature. ### Attack Path 1. The attacker reaches TCP port 2688. 2. The attacker sub ...[truncated 655 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
server/services/upload.js:43
Finding

Arbitrary Local File Read and External Upload

Content
View full analysis
Remediation
View remediation

T07 · Tool Hijacking and Spoofing

Error
Location
server/index.js:93
Finding

Unauthenticated Configuration Takeover Enables Credential and Data Redirection

Content
View full analysis
{ try { const config = req.body; const configPath = path.join(__dirname, '../config/set.json'); if (!config.server || !config.models || !config.llm) { return res.status(400).json({ success: false, error: 'Incomplete configuration structure' }); } fs.writeFileSync(configPath, JSON.stringify(config, null, 2), 'utf-8'); res.json({ success: true, msg: 'Configuration saved' }); } catch (error) { res.status(500).json({ success: false, error: error.message }); } }); ``` The attacker-controlled values are subsequently used with credentials: ```js const response = await this.sendRequest( config.server.url, requestData, { 'Authorization': `Bearer ${apiKey}` } ); ``` ```js const response = await axios.post( config.server.upload_url, formData, { headers: { 'Authorization': `Bearer ${platformToken}`, ...formData.getHeaders() } } ); ``` ```js const response = await axios.post( llmUrl, requestBody, { headers: { 'Authorization': `Bearer ${modelApiKey}`, 'Content-Type': 'application/json' } } ); ``` ### Technical Analysis Any network caller can replace the complete configuration file. Validation only checks for the presence of three top-level properties; it does not authenticate the caller or restrict endpoint protocols and hostnames. Generation, polling, upload, and LLM functions trust these configuration values and attach user-supplied Bearer credentials. An attacker can therefore replace legitimate service URLs with attacker-controlled endpoints and wait for a normal user operation to forward credentials, prompts, and images. This is a tool/API hijacking condition because legitimate-looking application actions are redi ...[truncated 1023 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
server/services/upload.js:258
Finding

Server-Side Request Forgery Through Arbitrary URL Upload

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
server/index.js:135
Finding

Path Traversal in Prompt File Management APIs

Content
View full analysis
{ try { const file = req.query.file; if (!file || !file.endsWith('.prompt')) { return res.status(400).json({ success: false, error: 'Invalid filename' }); } const filePath = path.join(__dirname, '../config', file); if (!fs.existsSync(filePath)) { return res.status(404).json({ success: false, error: 'File does not exist' }); } const content = fs.readFileSync(filePath, 'utf-8'); res.json({ success: true, content, name: file }); } catch (error) { res.status(500).json({ success: false, error: error.message }); } }); ``` ```js app.post('/api/prompts/save', (req, res) => { try { const { oldName, newName, name, content, originalName } = req.body; const targetName = newName || name; const sourceName = oldName || originalName; if (!targetName || !targetName.endsWith('.prompt')) { return res.status(400).json({ success: false, error: 'Invalid filename' }); } const configDir = path.join(__dirname, '../config'); const filePath = path.join(configDir, targetName); if (sourceName && sourceName !== targetName) { const oldPath = path.join(configDir, sourceName); if (fs.existsSync(oldPath)) { fs.unlinkSync(oldPath); } } fs.writeFileSync(filePath, content || '', 'utf-8'); res.json({ success: true, msg: 'Saved', name: targetName }); } catch (error) { res.status(500).json({ success: false, error: error.message }); } }); ``` ```js app.post('/api/prompts/delete', (req, res) => { const { filename, name } = req.body; const targetName = filename || name; if (!targetName || !targetName.endsWith('.prompt')) { return res.status(400).json({ success: false ...[truncated 1338 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
public/js/app.js:401
Finding

Stored DOM Cross-Site Scripting in Gallery and Task Details

Content
View full analysis
{ // ... return `
${icon}
${statusText}
${work.prompt}
${infoText} ${dateStr}
`; }).join(''); ``` A second affected rendering path exists in `public/components/task-detail.html:61-128`: ```js const content = `

${t('taskDetail.prompt')}

${work.prompt || t('taskDetail.none')}
${work.error ? `
${work.error}
` : ''} ${work.path ? `
${work.path}
` : ''} `; $('#win-task-detail-content').html(content); ``` ### Technical Analysis Database-controlled values are interpolated into HTML templates and assigned through `innerHTML` or jQuery `.html()`. No HTML or JavaScript-context escaping is applied. Some values are also inserted inside inline event-handler strings, where quotes can break out of the intended argument context. Potentially dangerous fields include `pro ...[truncated 1232 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
server/index.js:12
Finding

Missing Access Control on Administrative and Privileged APIs

Content
View full analysis
{ // Replaces application configuration. }); app.post('/api/admin/delete/:id', async (req, res) => { await db.deleteWork(parseInt(req.params.id)); res.json({ success: true, msg: 'Deleted' }); }); app.post('/api/open-folder', (req, res) => { // Opens an arbitrary caller-supplied path. }); app.post('/api/shutdown', (req, res) => { res.json({ success: true, msg: 'Service is shutting down' }); setTimeout(() => process.exit(0), 1000); }); ``` ```js app.listen(PORT, () => { console.log(`Nano Banana V2 Server running at http://localhost:${PORT}`); }); ``` ### Technical Analysis No authentication or authorization middleware protects task data, configuration changes, prompt management, deletion, filesystem operations, uploads, or shutdown. Calling `app.listen(PORT)` without a hostname normally binds to unspecified addresses rather than explicitly restricting the service to loopback. The log message stating `localhost` does not enforce network isolation. Permissive CORS further enables arbitrary web origins to issue cross-origin requests where browser rules permit them. CORS is not itself authentication, but this configuration increases exposure. ### Attack Path 1. An attacker on a reachable network discovers port 2688. 2. The attacker calls the API directly without any credentials. 3. The attacker enumerates works and local paths through `/api/works` or `/api/work/:id`. 4. The attacker modifies configuration or prompt files, marks works deleted, performs uploads, opens paths, or invokes `/api/shutdown`. ...[truncated 554 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
public/js/app.js:1339
Finding

Sensitive Credentials and Image Data Exposed Through Logging

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (95)

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 · .gitignore (reported line 15)May include surrounding context.

text
npm-debug.log*

# Environment
.env
.env.local
.env.*.local

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

text
# Environment
.env
.env.local
.env.*.local

# IDE

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · public/components/ai-prompt.html (reported line 1)May include surrounding context.

html
<!-- AI提示词生成组件 -->
<div class="win-ai-prompt">
    <!-- API Key 未配置提示 -->
    <div class="win-info-box" id="ai-no-key" style="display: none; background: #fef3c7; border-color: #fcd34d;">

Hidden Instructions

High
Category
Prompt Injection
Confidence
60% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · public/css/style.css (reported line 1)May include surrounding context.

css
/* 鍏ㄥ眬鏍峰紡 */
:root {
    --primary-color: #0A2540;
    --accent-color: #00F5D4;

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The UI binds a visible button directly to POST /api/shutdown, allowing any user with access to the frontend to request service termination. This creates an easy denial-of-service path, especially if the backend endpoint lacks strong authentication or CSRF protection, and is unusually dangerous because service shutdown is administrative system control exposed through the client.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The popup manager fetches HTML from /components/${url}, injects it into the DOM with .html(html), and then explicitly executes every embedded <script> via eval($(this).text()). If an attacker can influence the loaded component path or the component contents, this becomes arbitrary JavaScript execution in the application's origin, enabling XSS, session theft, DOM compromise, or privileged actions on behalf of the user. In this skill context, a generic UI component loader makes the issue more dangerous because it normalizes dynamic remote content execution as a reusable primitive across the app.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The add-task flow reads API credentials and tokens from browser localStorage and sends them to the backend as part of the request payload. Storing secrets in localStorage increases exposure to any XSS or same-origin script compromise, and transmitting multiple stored secrets from a generic management page broadens the blast radius if the page or backend is abused.

Content

No source excerpt is available for this finding.

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · public/set.html (reported line 609)May include surrounding context.

html
</div>
        </div>
        
        <!-- Tab 切换 -->
        <div class="tabs">
            <button class="tab-btn active" onclick="switchTab('config')">📋 配置参数</button>
            <button class="tab-btn" onclick="switchTab('json')">📄 JSON 编辑</button>

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The /api/shutdown endpoint lets any caller terminate the server process remotely with no authentication or confirmation. This is a trivial denial-of-service condition and is especially dangerous because the app also enables CORS broadly, increasing the chance of abuse from other origins or local-network attackers.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This endpoint exposes process termination as a simple HTTP call with no safeguards. Any reachable attacker can stop the service on demand, making denial of service trivial and potentially interrupting in-progress tasks or corrupting state.

Content

No source excerpt is available for this finding.

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 · server/services/request.js (reported line 128)May include surrounding context.

js
`
    };
    
    return prompts[cutNum] || `#按要求生成以下内容
`;
  }

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs users to upload images, enter prompts, and configure third-party API keys for AceData and an LLM service, but it does not warn that prompts and uploaded images may be transmitted to external providers. This creates a real privacy and data-handling risk because users may submit sensitive images or confidential text without understanding that the content leaves the local machine.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documented API includes destructive and service-control actions such as deleting works and shutting down the service, but the skill documentation provides no warning, authorization expectations, or safety guidance around their use. In a locally hosted image-management tool, these capabilities can lead to accidental data loss or denial of service if exposed to other local users, browser scripts, or misconfigured network access.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The file’s natural-language instructions are entirely in Chinese, which effectively imposes a specific language on users or maintainers without any stated opt-in or alternative. The policy requires flagging language or locale constraints unless the skill explicitly offers a language choice or clearly justifies the restriction.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file title and all operative instructions are written in Chinese, and there is no indication that the skill offers a language choice or that Chinese is a required locale for a region-specific use case. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The title and instructions are written as a fixed Chinese-language rule set, with no indication that the user can choose another language or locale. This creates a natural-language policy concern because the skill appears to enforce a specific language without opt-in or justification.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
86% confidence
Finding

The configuration hard-codes external service endpoints for image generation and task handling, meaning prompts, images, or related metadata may be transmitted to third-party infrastructure. In an agent skill context, this creates a real data exposure risk if users are not explicitly informed or if sensitive content can be sent off-platform without consent or policy controls.

Content

Scanner excerpt · config/set.json (reported line 3)May include surrounding context.

json
{
  "server": {
    "url": "https://api.acedata.cloud/nano-banana/images",
    "task_url": "https://api.acedata.cloud/nano-banana/tasks",
    "upload_url": "https://platform.acedata.cloud/api/v1/files/",
    "port": 2688,

External Transmission

Medium
Category
Data Exfiltration
Confidence
85% confidence
Finding

A separate hard-coded external task endpoint indicates continued outbound communication to a third-party service for job status or processing. Even if operationally necessary, this is security-relevant because it expands the trust boundary and can leak user activity, identifiers, or generated content unless transparently disclosed and tightly controlled.

Content

Scanner excerpt · config/set.json (reported line 4)May include surrounding context.

json
{
  "server": {
    "url": "https://api.acedata.cloud/nano-banana/images",
    "task_url": "https://api.acedata.cloud/nano-banana/tasks",
    "upload_url": "https://platform.acedata.cloud/api/v1/files/",
    "port": 2688,
    "upload_timeout": 86400000

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill hard-codes Chinese-only behavior and formatting without any user language selection or opt-in. This can override user expectations, reduce transparency, and create prompt-control issues where the system enforces a language constraint unrelated to the user's request, which is a genuine policy and usability security concern though not a direct exploit vector.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation instructs users to configure API keys and use image-generation features, but it does not clearly warn that prompts, uploaded reference images, and possibly related metadata will be transmitted to external AI providers. This creates a transparency and privacy risk because users may submit sensitive content without informed consent about third-party processing.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

Multiple visible strings, comments, and default content are written directly in Chinese, including the main label, warning text, hint, and placeholder/default prompt. This can violate language/locale policy when the skill forces a specific language experience without giving the user a choice.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The component reads an API key from localStorage and includes it in the AJAX request body to /api/generate-prompt. Storing secrets in browser-accessible storage and retransmitting them from client-side code increases exposure to XSS, browser extension theft, shoulder-surfing/debug tooling leakage, and accidental disclosure through logs or intermediaries.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The component injects errorMsg into the DOM using $('#win-error-msg').html(...) without sanitization or escaping. If window._winErrorMsg or translated content can be influenced by an attacker, this becomes a DOM-based XSS sink, allowing arbitrary HTML or script execution in the user's browser.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The component explicitly tells users that API keys and tokens are stored in browser localStorage, and the script loads/saves those secrets there. localStorage is persistent and readable by any JavaScript running in the origin, so an XSS bug, malicious dependency, shared machine access, or browser extension can expose long-lived credentials. The skill context increases concern because these are real service credentials, not low-sensitivity preferences.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This HTML/JS file contains natural-language strings such as '任务详情组件', '加载中...', and '任务ID无效' directly in Chinese. Under the policy, forcing a specific language without offering user choice or documenting a justified locale restriction is a natural-language policy violation.

Content

No source excerpt is available for this finding.