Back to skill

Security audit

Aavegotchi Renderer Bypass

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its stated Aavegotchi rendering purpose, but it needs review because it can fetch renderer-supplied URLs and writes predictable files to /tmp by default.

Review before installing. Use only if you expect outbound calls to Goldsky and Aavegotchi, run it as an unprivileged user, and choose a private output directory instead of shared /tmp. The publisher should add domain allowlisting for image downloads and safer exclusive file creation before this is treated as low-risk.

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/render-gotchi-bypass.mjs:197
Finding
Renderer Response Permits Server-Side Request Forgery Through Unrestricted Asset URLs<![CDATA[ ## Vulnerability Details **File Location**: `scripts/render-gotchi-bypass.mjs`, lines 197–204 and 248–263 **Vulnerability Type**: Unrestricted server-side URL fetching **Risk Level**: Medium ### Vulnerable Code ```js async function downloadFile(url, filePath) { const response = await fetch(url); if (!response.ok) { throw new Error(`Failed to download ${url} (${response.status})`); } const bytes = Buffer.from(await response.arrayBuffer()); fs.writeFileSync(filePath, bytes); return filePath; } ``` ```js if (proxyUrls.PNG_Full) { const fullUrl = proxyUrls.PNG_Full.startsWith("http") ? proxyUrls.PNG_Full : `${DAPP_BASE}${proxyUrls.PNG_Full}`; artifacts.fullPngPath = path.join(options.outDir, `gotchi-${tokenId}-full.png`); await downloadFile(fullUrl, artifacts.fullPngPath); artifacts.fullPngUrl = fullUrl; } if (proxyUrls.PNG_Headshot) { const headshotUrl = proxyUrls.PNG_Headshot.startsWith("http") ? proxyUrls.PNG_Headshot : `${DAPP_BASE}${proxyUrls.PNG_Headshot}`; artifacts.headshotPngPath = path.join(options.outDir, `gotchi-${tokenId}-headshot.png`); await downloadFile(headshotUrl, artifacts.headshotPngPath); artifacts.headshotPngUrl = headshotUrl; } ``` ### Technical Analysis The renderer API controls the `proxyUrls.PNG_Full` and `proxyUrls.PNG_Headshot` values. Any value beginning with `http` is passed directly to `fetch` without validating its protocol, hostname, port, resolved IP address, or destination network. Node.js `fetch` follows redirects by default. Consequently, even an initially acceptable public URL can redirect the request to a loopback, private-network, link-local, or cloud metadata address. The implementation also performs no response content-type validation before saving the returned bytes. The external renderer request is necessary for the Skill's declared rendering functionality. However, allowing the renderer response to select arbitrary network destinations exceeds the minimum n ...[truncated 1772 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Parse every asset URL using `new URL()` rather than checking whether the string starts with `http`. 2. Require the `https:` protocol. 3. Maintain an explicit allowlist of trusted Aavegotchi asset hostnames. 4. Reject embedded usernames, passwords, nonstandard ports, and malformed URLs. 5. Resolve destination hostnames and reject loopback, private, link-local, multicast, and otherwise reserved IPv4 and IPv6 ranges. 6. Set `redirect: "manual"` and validate every redirect destination before following it. 7. Apply request timeouts and maximum download-size limits. 8. Validate that the response has an expected image content type before writing it. 9. Prefer having the trusted renderer return relative asset paths that are resolved only against a fixed, trusted base URL. Example hardening pattern: ```js const ALLOWED_ASSET_HOSTS = new Set([ "www.aavegotchi.com" ]); function validateAssetUrl(value) { const url = new URL(value, DAPP_BASE); if (url.protocol !== "https:") { throw new Error("Asset URL must use HTTPS."); } if (!ALLOWED_ASSET_HOSTS.has(url.hostname)) { throw new Error(`Untrusted asset host: ${url.hostname}`); } if (url.username || url.password || url.port) { throw new Error("Asset URL contains prohibited authority components."); } return url; } ``` DNS resolution and redirect validation must also be implemented to prevent DNS rebinding and redirect-based bypasses. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/render-gotchi-bypass.mjs:242
Finding
Predictable Files in Shared Temporary Directory Permit Symbolic-Link File Overwrite<![CDATA[ ## Vulnerability Details **File Location**: `scripts/render-gotchi-bypass.mjs`, lines 216 and 242–262 **Vulnerability Type**: Unsafe temporary-file creation and symbolic-link following **Risk Level**: Medium ### Vulnerable Code ```js fs.mkdirSync(options.outDir, { recursive: true }); ``` ```js const batchJsonPath = path.join(options.outDir, `gotchi-${tokenId}-render-batch.json`); fs.writeFileSync(batchJsonPath, JSON.stringify(batchResult.json, null, 2)); ``` ```js if (proxyUrls.PNG_Full) { const fullUrl = proxyUrls.PNG_Full.startsWith("http") ? proxyUrls.PNG_Full : `${DAPP_BASE}${proxyUrls.PNG_Full}`; artifacts.fullPngPath = path.join(options.outDir, `gotchi-${tokenId}-full.png`); await downloadFile(fullUrl, artifacts.fullPngPath); artifacts.fullPngUrl = fullUrl; } if (proxyUrls.PNG_Headshot) { const headshotUrl = proxyUrls.PNG_Headshot.startsWith("http") ? proxyUrls.PNG_Headshot : `${DAPP_BASE}${proxyUrls.PNG_Headshot}`; artifacts.headshotPngPath = path.join(options.outDir, `gotchi-${tokenId}-headshot.png`); await downloadFile(headshotUrl, artifacts.headshotPngPath); artifacts.headshotPngUrl = headshotUrl; } ``` The image download function performs the same unsafe write: ```js const bytes = Buffer.from(await response.arrayBuffer()); fs.writeFileSync(filePath, bytes); ``` The command-line default sets the output directory to the shared `/tmp` directory: ```js const args = { tokenId: null, inventoryUrl: null, outDir: "/tmp" }; ``` ### Technical Analysis Output filenames are deterministically derived from a public token ID: - `gotchi-<tokenId>-render-batch.json` - `gotchi-<tokenId>-full.png` - `gotchi-<tokenId>-headshot.png` By default, these files are created directly under the shared `/tmp` directory. `fs.writeFileSync` follows existing symbolic links and overwrites existing files unless exclusive creation flags are used. On a multi-user system, another local user can predict the filenames and create ...[truncated 1808 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Create a unique private directory for each execution with `fs.mkdtempSync`. 2. Set restrictive directory permissions, such as mode `0o700`. 3. Create output files atomically and exclusively so existing paths are rejected. 4. Use no-follow semantics where supported, or explicitly inspect paths with `lstat` before opening them. 5. Avoid running the Skill with elevated privileges. 6. If `--out-dir` is supplied, verify that it is trusted, is owned by the invoking user, and is not writable by untrusted users. 7. Do not silently overwrite existing output files. Example private-directory pattern: ```js const baseDir = options.outDir || "/tmp"; const runDir = fs.mkdtempSync(path.join(baseDir, "aavegotchi-render-"), { encoding: "utf8" }); fs.chmodSync(runDir, 0o700); ``` Files should then be opened using exclusive creation: ```js fs.writeFileSync(filePath, bytes, { flag: "wx", mode: 0o600 }); ``` Where available, use an API or open flags that prevent following symbolic links. Exclusive creation should be applied consistently to the JSON file and both image files. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (6)

Ae1

High
Category
analysis-evasion
Content
node scripts/render-gotchi-bypass.mjs --token-id 6741
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
node scripts/render-gotchi-bypass.mjs --token-id 6741
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Lp3

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding
The skill performs network actions but does not declare any tool scope or permission boundaries, which makes its capabilities opaque to users and policy enforcers. In an agent environment, undeclared network access increases the chance of unintended outbound requests and reduces the effectiveness of least-privilege controls.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill instructs saving raw API responses and rendered assets to local disk without warning the user or requiring explicit consent. Unannounced file writes can create privacy, storage, and data-handling risks, especially when writing to shared or sensitive locations like /tmp in multi-tenant or automated environments.

External Transmission

Medium
Category
Data Exfiltration
Content
1. Extract `tokenId` from direct input or inventory URL.
2. Query Goldsky Base core subgraph:
`https://api.goldsky.com/api/public/project_cmh3flagm0001r4p25foufjtt/subgraphs/aavegotchi-core-base/prod/gn`
3. Derive hash in renderer format:
`<Collateral>-<EyeShape>-<EyeColor>-<Body>-<Face>-<Eyes>-<Head>-<LeftHand>-<RightHand>-<Pet>`
4. Call `POST https://www.aavegotchi.com/api/renderer/batch` with:
Confidence
88% confidence
Finding
The skill directs transmission of user-supplied or derived data to external services at Goldsky and Aavegotchi without any explicit trust boundary, consent language, or domain restriction metadata. Even if the purpose is functional, external transmission exposes data and behavior to third parties and can be risky in agent systems where users may not expect remote lookups or POST requests.

External Transmission

Medium
Category
Data Exfiltration
Content
import path from "node:path";

const GOLDSKY_ENDPOINT =
  "https://api.goldsky.com/api/public/project_cmh3flagm0001r4p25foufjtt/subgraphs/aavegotchi-core-base/prod/gn";
const DAPP_BASE = "https://www.aavegotchi.com";

const COLLATERAL_MAP = {
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Static analysis

No suspicious patterns detected.