T03 · Remote Payload Retrieval and Execution
- Location
src/bridge.js:54- Finding
Unverified Remote Installer Download and Execution
- Content
View full analysis
Vulnerability Details
File Location:
src/bridge.js:54-69andsrc/bridge.js:135-144
Vulnerability Type: Remote payload retrieval and execution
Risk Level: CriticalVulnerable Code
js const config = getConfig(); const installerUrl = installerUrlForPlatform(config); const installer = await downloadInstaller(installerUrl, installerFileName()); const env = { ...process.env, AIDE_NOTE_API_KEY: config.apiKey, AIDE_NOTE_RELAY_HOST: config.bridgeRelayHost || 'api.aidenote.cn', AIDE_NOTE_TUNNEL_BASE_URL: config.bridgeTunnelBaseUrl || 'https://cdn.aidenote.cn/tunnel', // Note: AIDE_NOTE_TOKEN_ENDPOINT is intentionally not passed. OPENCLAW_LOCAL_PORT: String(config.openClawLocalPort || 18789) }; const output = await run(installerCommand(), installerArgs(installer), { env, timeout: 120000 });js async function downloadInstaller(url, fileName) { const response = await fetch(url); if (!response.ok) { throw new Error(`Failed to download installer: HTTP ${response.status}`); } const script = await response.text(); const dir = await mkdtemp(join(tmpdir(), 'aidenote-openclaw-')); const file = join(dir, fileName); await writeFile(file, script, { mode: 0o700 }); return file; }The downloaded file is subsequently executed using either Bash or PowerShell:
js function installerCommand() { return process.platform === 'win32' ? 'powershell.exe' : 'bash'; } function installerArgs(installer) { if (process.platform === 'win32') { return ['-NoProfile', '-ExecutionPolicy', 'Bypass', '-File', installer]; } return [installer]; }Technical Analysis
The bridge setup tool downloads executable script content from a remote URL and immediately runs it. The code does not verify a cryptographic digest, digital signature, pinned version, or expected content. The installer URL is also configurable, wi ...[truncated 1465 chars]
- Remediation
View remediation
Remediation Suggestions
- Bundle the installer with the Skill so that the executed code is included in security review.
- If remote retrieval is unavoidable, use immutable, versioned URLs and verify a hard-coded SHA-256 or stronger digest before execution.
- Prefer a publisher signature verified against a pinned public key.
- Require HTTPS and enforce an exact allowlist of trusted schemes, hosts, ports, and paths.
- Reject redirects to untrusted origins.
- Remove PowerShell
-ExecutionPolicy Bypass. - Display the verified installer version and obtain explicit user confirmation before execution.
- Run installation with the lowest possible privileges and in a restricted environment.
- Clean up temporary installer files after use.
