Back to skill

Security audit

3daistudio integration

Security checks for vulnerabilities and agentic risk

Overview

This 3D-generation skill is mostly coherent, but it needs review because it can spend paid API credits and downloads provider-supplied URLs without validating where they point.

Install only if you are comfortable giving the skill your 3D AI Studio API key and letting agent-run generation commands spend account credits. Require explicit approval before each paid generation, use a limited-output directory, and review or harden the downloader so it only fetches HTTPS assets from trusted 3D AI Studio/CDN hosts with size and format limits.

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

Warning
Location
3daistudio.py:96
Finding
Unvalidated Server-Provided Asset URL Enables Arbitrary Resource Retrieval<![CDATA[ ## Vulnerability Details **File Location**: `3daistudio.py`, lines 96–106 **Vulnerability Type**: Server-Side Request Forgery (SSRF) and unsafe remote file retrieval **Risk Level**: Medium ### Vulnerable Code ```python entry = preferred or results[0] asset_url = entry.get("asset") or entry.get("asset_url") if not asset_url: print("No asset URL in results.") print(json.dumps(entry, indent=2)) return print(f" Downloading from: {asset_url}") req = urllib.request.Request(asset_url) with urllib.request.urlopen(req, timeout=60) as r: with open(output_path, "wb") as f: f.write(r.read()) ``` ### Technical Analysis The application obtains `asset_url` from a remote API response and passes it directly to `urllib.request.urlopen()` without validating: - The URL scheme - The destination hostname - The resolved IP address - Redirect destinations - The response content type - The response size The 3D AI Studio API or an intermediary controlling its response can therefore instruct the client to request an arbitrary URL from the agent's network context. Depending on the URL handlers and network environment available to Python, destinations could include loopback services, private-network services, link-local cloud metadata endpoints, or local resources. This network access is not required at arbitrary destinations. The declared functionality only requires downloading generated assets from trusted 3D AI Studio infrastructure or an explicitly approved CDN. Consequently, unrestricted handling of API-supplied URLs exceeds the minimum network privileges needed by the Skill. The downloaded response is written directly to the user-selected output path without checking that it is a valid 3D model. This also allows the remote service to substitute arbitrary content for the expected model. The application does not automatically execute the downloaded file, which limits the immediate code-execution impact. The separately flagged Base64 behavior ...[truncated 2141 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Restrict URL schemes** - Accept only `https`. - Explicitly reject `file`, `ftp`, `data`, and other schemes. 2. **Allowlist trusted asset hosts** - Permit downloads only from documented 3D AI Studio and approved CDN hostnames. - Compare normalized hostnames exactly; do not use insecure suffix matching. 3. **Validate resolved addresses** - Resolve the hostname before connecting. - Reject loopback, private, link-local, multicast, reserved, and unspecified IPv4 and IPv6 ranges. - Protect against DNS rebinding by ensuring the validated address is the address used for the connection. 4. **Validate redirects** - Disable automatic redirects or validate every redirect destination using the same scheme, hostname, and IP checks. - Apply a small redirect limit. 5. **Constrain the response** - Enforce a maximum download size while streaming rather than calling unrestricted `r.read()`. - Validate the expected content type where the provider supplies a stable type. - Verify the downloaded format or archive structure before treating it as a model. - Remove partial output if validation or download fails. 6. **Use safe output handling** - Write to a temporary file in the destination directory. - Validate the completed file and then atomically rename it to the requested output path. - Avoid overwriting existing files unless the user explicitly approves it. A hardened design should obtain either a trusted-host HTTPS URL or an asset identifier that is downloaded through a fixed, authenticated API endpoint rather than accepting an unrestricted URL from the response. ]]>
Vulnerability Patterns
  • 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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (7)

Tainted flow: 'req' from os.environ.get (line 43, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Content
def api_get(path):
    url = BASE_URL + path
    req = urllib.request.Request(url, headers=HEADERS)
    with urllib.request.urlopen(req, timeout=30) as r:
        return json.loads(r.read().decode())
Confidence
90% confidence
Finding
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Tainted flow: 'req' from os.environ.get (line 43, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Content
def api_get(path):
    url = BASE_URL + path
    req = urllib.request.Request(url, headers=HEADERS)
    with urllib.request.urlopen(req, timeout=30) as r:
        return json.loads(r.read().decode())
Confidence
90% confidence
Finding
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Tainted flow: 'req' from os.environ.get (line 43, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Content
print(f"  Downloading from: {asset_url}")
    req = urllib.request.Request(asset_url)
    with urllib.request.urlopen(req, timeout=60) as r:
        with open(output_path, "wb") as f:
            f.write(r.read())
    print(f"  Saved to: {output_path}")
Confidence
90% confidence
Finding
The code downloads a file from asset_url returned by the remote API without validating the scheme, host, or content size. If the upstream service is compromised or returns unexpected URLs, this could enable server-side request forgery-like outbound requests or downloading untrusted content to an arbitrary local path supplied by the user.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The agent workflow section recommends directly running paid generation commands without repeating that each invocation consumes account credits. In agent contexts, this omission can lead to autonomous or repeated executions that incur unexpected financial charges, especially when users only read the workflow section and not earlier prerequisite sections.

Intent-Code Divergence

Medium
Confidence
91% confidence
Finding
The guide instructs users to treat a .glb output as a ZIP archive and extract OBJ data from it, which conflicts with the stated output format and typical GLB semantics. If false, this can cause downstream automation to mishandle files, fail open on file-type assumptions, or encourage unsafe parsing logic based on incorrect documentation.

Lp3

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding
The skill requires access to an API key via environment variables and makes outbound network requests, but the manifest does not declare any explicit tool scope such as permissions or allowed-tools. This creates a least-privilege and transparency issue: a host agent may permit execution without clearly surfacing that the skill can read secrets and contact external services, increasing the risk of unintended secret exposure or unauthorized data egress.

Description-Behavior Mismatch

Low
Confidence
94% confidence
Finding
The manifest description is narrowly about generating 3D models from images and text prompts using the 3D AI Studio API. The `balance` command calls the account wallet endpoint and prints account billing information, which is an additional account-management capability rather than part of conversion itself.

Static analysis

No suspicious patterns detected.