Back to skill

Security audit

Ima All Ai

Security checks for vulnerabilities and agentic risk

Overview

This skill mostly matches its AI media-generation purpose, but it has review-worthy credential, local-file upload, and logging behaviors that are broader than its disclosures.

Install only after reviewing the code paths that handle credentials, local image uploads, and logs. Use scoped or test API keys, do not use --base-url except with a trusted official endpoint, avoid sending confidential prompts or local files, and delete/restrict ~/.openclaw/logs/ima_skills/ if prompt retention is unacceptable.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (6)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/ima_create.py:175
Finding

Unrestricted Local File Upload Through Image Input Handling

Content
View full analysis
str: """Upload a local image file to IMA CDN and return its public URL. If `source` is already an HTTPS URL it is returned as-is. Otherwise the file is uploaded via the two-step presigned URL flow and the resulting CDN URL (fdl) is returned. """ if source.startswith("https://") or source.startswith("http://"): return source if not os.path.isfile(source): raise FileNotFoundError(f"Input image not found: {source}") content_type = mimetypes.guess_type(source)[0] or "image/jpeg" suffix = source.rsplit(".", 1)[-1].lower() if "." in source else "jpeg" logger.info(f"Uploading local image: {source} ({content_type})") token_data = _get_upload_token(api_key, suffix, content_type) ful = token_data["ful"] fdl = token_data["fdl"] with open(source, "rb") as f: image_bytes = f.read() resp = requests.put( ful, data=image_bytes, headers={"Content-Type": content_type}, timeout=60, ) resp.raise_for_status() logger.info(f"Upload complete: {fdl}") return fdl ``` ```python for src in raw_inputs: if src.startswith("https://") or src.startswith("http://"): resolved_inputs.append(src) else: print(f"📤 Uploading local image: {os.path.basename(src)}", flush=True) try: cdn_url = prepare_image_url(src, apikey) resolved_inputs.append(cdn_url) print(f" ✅ Uploaded → {cdn_url}", flush=True) except Exception as e: logger.error(f"Image upload failed: {src} — {e}") print(f"❌ Failed to upload image {src}: {e}", file=sys.stderr) sys.exit(1) ``` ### Technical Analysis Th ...[truncated 1976 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/ima_create.py:1735
Finding

Bearer Credential Exfiltration Through Unrestricted API Base URL

Content
View full analysis
list: url = f"{base_url}/open/v1/product/list" params = {"app": app, "platform": platform, "category": category} headers = make_headers(api_key, language) resp = requests.get(url, params=params, headers=headers, timeout=30) ``` ```python url = f"{base_url}/open/v1/tasks/create" headers = make_headers(api_key) resp = requests.post(url, json=payload, headers=headers, timeout=30) ``` ```python url = f"{base_url}/open/v1/tasks/detail" headers = make_headers(api_key) resp = requests.post( url, json={"task_id": task_id}, headers=headers, timeout=30, ) ``` ```python p.add_argument("--base-url", default=DEFAULT_BASE_URL, help="API base URL") ``` ```python args = build_parser().parse_args() base = args.base_url ``` The authentication helper is: ```python def make_headers(api_key: str, language: str = "en") -> dict: return { "Authorization": f"Bearer {api_key}", "Content-Type": "application/json", "x-app-source": "ima_skills", "x_app_language": language, } ``` ### Technical Analysis The command-line option `--base-url` accepts an unrestricted string. The script concatenates this value with API paths and sends the IMA bearer credential through `make_headers()`. There is no validation that: - The scheme is HTTPS. - The destination hostname is exactly `api.imastudio.com`. - The port is expected. - The URL contains no embedded user information or other ambiguous components. - Redirects remain on the approved origin. As a result, any caller capa ...[truncated 1154 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/ima_create.py:144
Finding

API Credential Exposure in Upload-Service Query Parameters

Content
View full analysis
dict: """Step 1: Get presigned upload URL from IMA upload service.""" sign, ts, nonce = _gen_sign() r = requests.get( f"{IMA_IM_BASE}/api/rest/oss/getuploadtoken", params={ "appUid": api_key, "appId": APP_ID, "appKey": APP_KEY, "cmimToken": api_key, "sign": sign, "timestamp": ts, "nonce": nonce, "fService": "privite", "fType": "picture", "fSuffix": suffix, "fContentType": content_type, }, timeout=15, ) r.raise_for_status() return r.json()["data"] ``` ### Technical Analysis The complete IMA API key is inserted twice into the query string, as both `appUid` and `cmimToken`. HTTPS protects the request while it is in transit, but it does not prevent the URL from being retained after TLS termination. Query strings are commonly captured by: - Web-server access logs. - Reverse proxies and load balancers. - Application-performance monitoring systems. - Error-reporting and tracing systems. - Browser or debugging tooling. - Infrastructure operated by the remote service. The behavior is disclosed in `SKILL.md` and `SECURITY.md`, and it may be required by the current upload-service protocol. Nevertheless, using a reusable bearer credential in a URL is unsafe and exceeds the minimum exposure necessary for a secure upload-token exchange. ### Attack Path 1. A local media upload invokes `_get_upload_token()`. 2. The reusable API key is encoded into the GET request URL. 3. A server, proxy, tracing platform, or operator records the complete U ...[truncated 477 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/ima_create.py:245
Finding

Sensitive Prompts and Request Payloads Persisted in Operational Logs

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/ima_create.py:1776
Finding

Undeclared Automatic Access to OpenClaw Credential Store

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Mutable and Insufficiently Pinned Third-Party Dependencies

Content
View full analysis
=2.25.0 ``` ```bash # Install the knowledge base first git clone https://github.com/imastuido/ima-knowledge-ai.git # Then install the all-in-one skill git clone https://github.com/imastuido/ima-all-ai.git # Optional standalone TTS enhancement git clone https://github.com/imastuido/ima-tts-ai.git ``` ### Technical Analysis The Python dependency uses only a lower bound. There is no lockfile, exact reviewed version, or package hash, so future installations can resolve to code that was not part of this audit. The installation instructions also clone mutable repository default branches rather than immutable reviewed commits or signed release tags. The additional repositories were not included in the audited artifact and therefore cannot be assumed to share its security properties. No evidence shows that the current `requests` package or listed GitHub repositories are malicious. The finding concerns reproducibility and future supply-chain exposure rather than a confirmed malicious dependency. ### Attack Path 1. A user installs the project at a later date. 2. Package resolution selects a newer `requests` release, or `git clone` retrieves a changed repository HEAD. 3. The retrieved code differs from the version reviewed during this audit. 4. If an upstream source or account is compromised, malicious code can enter the installation. 5. The dependency executes with the privileges of the Agent process when imported or invoked. ### Impact Assessment The maximum impact is equivalent to arbitrary code execution under the Agent user's operating-system account if a mutable upstream dependency becomes compromised. There is no evid ...[truncated 99 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
Findings (29)

Tainted flow: 'task_id' from os.environ.get (line 1808, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/ima_create.py (reported line 907)May include surrounding context.

python
"Check the IMA dashboard for status."
            )

        resp = requests.post(url, json={"task_id": task_id},
                             headers=headers, timeout=30)
        resp.raise_for_status()
        data = resp.json()

Tp4

High
Category
MCP Tool Poisoning
Confidence
81% confidence
Finding

The code substantially supports the core claim of AI content creation across images, video, music, and TTS, and it does use KIE for images and IMA for other media as declared. However, the declared description overstates several major capabilities. The implementation is a task-creation CLI, not a comprehensive orchestration platform: it handles single generation jobs, model listing, parameter resolution, polling, uploads, retries, and local preference memory. It does not implement knowledge base support, ima-knowledge-ai integration, or broader workflow orchestration. Its 'intelligent model selection' is also not present in any meaningful sense; users specify a model ID or a saved preference is reused. Therefore the description is materially broader than the actual code behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents the skill as a multi-model AI content creation/orchestration platform spanning images, videos, music, and TTS via KIE and IMA APIs. The supplied code does not perform any media generation, model selection, API calls, workflow orchestration, or knowledge-base integration. Instead, it is a standalone logging module that creates directories and files under the user's home directory, configures rotating log handlers, emits console logs, and deletes old log files. While logging can be a supporting implementation detail, this chunk by itself is materially different from the declared purpose and includes filesystem write/delete behavior that is not mentioned in the description.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest states image generation uses KIE API and KIE_API_KEY as the primary credential, but the execution guidance and examples route image generation through the IMA API instead. This kind of security-disclosure inconsistency can cause users to provision the wrong credential, misunderstand which external service receives their prompts, and weaken review of where sensitive data is actually sent.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
**Data control:**
- ✅ **View stored data**: `cat ~/.openclaw/memory/ima_prefs.json`
- ✅ **Delete preferences**: `rm ~/.openclaw/memory/ima_prefs.json` (resets to defaults)
- ✅ **Delete logs**: `rm -rf ~/.openclaw/logs/ima_skills/` (auto-cleanup after 7 days anyway)

### ⚠️ Advanced Users: Fork & Modify

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
**Data control:**
- ✅ **View stored data**: `cat ~/.openclaw/memory/ima_prefs.json`
- ✅ **Delete preferences**: `rm ~/.openclaw/memory/ima_prefs.json` (resets to defaults)
- ✅ **Delete logs**: `rm -rf ~/.openclaw/logs/ima_skills/` (auto-cleanup after 7 days anyway)

### ⚠️ Advanced Users: Fork & Modify

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
**Data control:**
- ✅ **View stored data**: `cat ~/.openclaw/memory/ima_prefs.json`
- ✅ **Delete preferences**: `rm ~/.openclaw/memory/ima_prefs.json` (resets to defaults)
- ✅ **Delete logs**: `rm -rf ~/.openclaw/logs/ima_skills/` (auto-cleanup after 7 days anyway)

### ⚠️ Advanced Users: Fork & Modify

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
**Data control:**
- ✅ **View stored data**: `cat ~/.openclaw/memory/ima_prefs.json`
- ✅ **Delete preferences**: `rm ~/.openclaw/memory/ima_prefs.json` (resets to defaults)
- ✅ **Delete logs**: `rm -rf ~/.openclaw/logs/ima_skills/` (auto-cleanup after 7 days anyway)

### ⚠️ Advanced Users: Fork & Modify

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

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

md
### ⚠️ Advanced Users: Fork & Modify

If you need to modify this skill for your use case:
1. **Fork the repository** (don't modify the original)
2. **Update your fork** with your changes
3. **Test thoroughly** with limited API keys

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill declares broad capabilities including environment-variable access, filesystem writes, and outbound network usage, but does not explicitly constrain tool scope with permissions or allowed-tools. In agent environments, that omission increases the chance of over-privileged execution and makes it harder for users or reviewers to understand and enforce the intended trust boundary.

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 · SKILL.md (reported line 366)May include surrounding context.

md
## Overview

Call IMA Open API to create AI-generated content. All endpoints require an `ima_*` API key. The core flow is: **query products → create task → poll until done**.

---

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The documentation prescribes x_app_language: en / zh and states it defaults to en if omitted, with the concrete example hardcoding x_app_language: en. This can cause the skill to force a language/locale choice in API interactions without first offering the user a language preference or opt-in.

Content

No source excerpt is available for this finding.

Unbounded Resource Access

Medium
Category
Excessive Agency
Confidence
84% confidence
Finding

The documented polling model emphasizes looping until all media complete and explicitly warns against looping forever, but it does not clearly require a hard timeout/cancellation boundary in all cases. In practice, unbounded polling against remote tasks can cause resource exhaustion, stuck agent executions, and unnecessary repeated external requests if the service never reaches a terminal state.

Content

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

md
| Single-poll instead of loop | Poll until `resource_status == 1` for ALL medias |
| Missing `app` / `platform` in parameters | Required fields — use `ima` / `web` |
| `category` mismatch | `parameters[].category` must match top-level `task_type` |
| `resource_status == 2` not handled | Check for failure, don't loop forever |
| `status == "failed"` ignored | `resource_status=1` + `status="failed"` means actual failure |
| `n > 1` and only checking first media | All `n` media items must reach `resource_status == 1` |

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
78% confidence
Finding

The document asserts that --user-id is never sent to servers, yet instructs passing it into a bundled script whose implementation is not provided here. Because the trust claim cannot be verified from this file and the parameter enters executable code, reviewers cannot confirm that potentially identifying information is not transmitted or logged remotely.

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/ima_create.py (reported line 80)May include surrounding context.

python
APP_KEY     = "32jdskjdk320eew"   # public shared client-id, not a secret

# ─── KIE API (Image Generation) ──────────────────────────────────────────────
KIE_API_BASE = "https://api.kie.ai/api/v1"
IMAGE_TASK_TYPES = {"text_to_image", "image_to_image"}

# Poll interval (seconds) and max wait (seconds) per task type

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

The script sends user prompts and optional callback metadata to the external KIE API for image generation. This is an intentional data transmission, but it is security-relevant because potentially sensitive user content leaves the local environment and there is no explicit consent gate, minimization, or warning at the transmission point.

Content

Scanner excerpt · scripts/ima_create.py (reported line 247)May include surrounding context.

python
url = f"{KIE_API_BASE}/jobs/createTask"
    logger.info(f"Creating KIE image task: model={model}, prompt={prompt[:50]}...")

    resp = requests.post(url, json=payload, headers=headers, timeout=30)
    resp.raise_for_status()
    result = resp.json()

Tainted flow: 'params' from requests.post (line 300, network input) → requests.get (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/ima_create.py (reported line 275)May include surrounding context.

python
params = {"task_id": task_id}

    while time.time() - start < max_wait:
        resp = requests.get(url, params=params, headers=headers, timeout=15)
        resp.raise_for_status()
        result = resp.json()

Tainted flow: 'params' from requests.post (line 300, network input) → requests.get (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/ima_create.py (reported line 302)May include surrounding context.

python
params = {"task_id": task_id}

    while time.time() - start < max_wait:
        resp = requests.get(url, params=params, headers=headers, timeout=15)
        resp.raise_for_status()
        result = resp.json()

Tainted flow: 'params' from requests.post (line 300, network input) → requests.get (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/ima_create.py (reported line 330)May include surrounding context.

python
logger.info(f"Query product list: category={category}, app={app}, platform={platform}")
    
    try:
        resp = requests.get(url, params=params, headers=headers, timeout=30)
        resp.raise_for_status()
        data = resp.json()

External Transmission

Medium
Category
Data Exfiltration
Confidence
94% confidence
Finding

The create_task call transmits prompts, input media URLs, model parameters, and account-linked metadata to the IMA API. In a skill context, this is expected functionality, but it still constitutes external exfiltration risk if users provide confidential text, internal image URLs, or local files that are uploaded first.

Content

Scanner excerpt · scripts/ima_create.py (reported line 839)May include surrounding context.

python
f"credit={credit}, attribute_id={attribute_id}")

    try:
        resp = requests.post(url, json=payload, headers=headers, timeout=30)
        resp.raise_for_status()
        data = resp.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/ima_create.py (reported line 907)May include surrounding context.

python
"Check the IMA dashboard for status."
            )

        resp = requests.post(url, json={"task_id": task_id},
                             headers=headers, timeout=30)
        resp.raise_for_status()
        data = resp.json()

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The image task path advertises image_to_image support, but main() calls create_kie_image_task without passing any resolved input image. This can cause the skill to ignore user-provided reference images and send incomplete or unintended requests to the external API, producing incorrect outputs and potentially transmitting prompts under false assumptions about how user media is used.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The natural-language strings in the module docstring are entirely in Chinese and do not indicate that language choice is optional or region-specific. Under the policy, forcing a specific language without user opt-in is a locale/language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill description is presented in Chinese only, with no indication that users may choose another language or that the skill is intended solely for a Chinese-language audience. This can violate language/locale policy guidance when a specific language is imposed without user opt-in or justification.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

The dependency is specified as requests>=2.25.0, which allows any future version and does not guarantee reproducible installs. This makes supply-chain risk and accidental installation of vulnerable or breaking versions harder to control, especially in a skill that likely performs network calls to external AI APIs.

Content

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

text
# Python dependencies for ima-all-ai skill
# Install with: pip install -r requirements.txt

requests>=2.25.0