T03 · Remote Payload Retrieval and Execution
Error
- Location
- scripts/skill_update.mjs:207
- Finding
- Unauthenticated Remote Self-Update Allows Replacement of Executable Skill Files<![CDATA[ ## Vulnerability Details **File Location**: `scripts/_api_client.mjs:161-193`, `scripts/skill_update.mjs:207-224, 234-325`, `skill.json:6-9` **Vulnerability Type**: Unauthenticated remote code update **Risk Level**: Critical ### Vulnerable Code ```js // scripts/_api_client.mjs:161-193 function maybeHandleSkillUpdateMeta(meta = {}) { const latestVersion = meta?.skill_latest_version; const updateRequired = Boolean(meta?.skill_update_required); const updateAvailable = updateRequired || Boolean(meta?.skill_update_available); if (!latestVersion && !updateAvailable) { return; } const message = meta?.skill_update_message || `creator-scraper-cv has a newer version: current=${SKILL_META.version}, latest=${latestVersion || 'unknown'}`; console.error(JSON.stringify({ skill_update: { required: updateRequired, current_version: SKILL_META.version, latest_version: latestVersion || null, min_supported_version: meta?.skill_min_supported_version || null, message, update_command: 'node scripts/skill_update.mjs --yes', }, }, null, 2)); if (process.env.CV_SKILL_AUTO_UPDATE === 'true') { const result = spawnSync(process.execPath, [join(SCRIPT_DIR, 'skill_update.mjs'), '--yes'], { encoding: 'utf8', stdio: 'inherit', }); if (result.status !== 0) { console.error(JSON.stringify({ skill_update_error: 'Auto update failed. Please run node scripts/skill_update.mjs --yes manually.', exit_code: result.status, })); } } } ``` ```js // scripts/skill_update.mjs:207-224 async function fetchJSON(url) { const response = await fetch(url); if (!response.ok) { throw new Error(`Failed to fetch manifest: HTTP ${response.status} ${response.statusText}`); } return response.json(); } async function fetchText(url) { const response = await fetch(url); if (!response.ok) { throw new Error(`Failed to fetch file: HTTP ${response.status} ${response.sta ...[truncated 4132 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove automatic executable updates from API-response processing. 2. Require an explicit, interactive update approval separate from ordinary Skill operations. 3. Authenticate manifests with an asymmetric digital signature and an immutable publisher public key embedded in the installed package. 4. Require a valid digest for every managed file and reject incomplete manifests. 5. Parse all URLs and enforce HTTPS with an exact hostname and repository-path allowlist. 6. Disable redirects, or validate every redirect destination against the same allowlist. 7. Require payload URLs to use the same authenticated origin as the manifest. 8. Download the complete release into a staging directory and validate all paths, hashes, signatures, file counts, and metadata before modifying the live installation. 9. Install updates atomically and implement automatic rollback if any operation fails. 10. Prefer package-manager releases, immutable release artifacts, or signed archives rather than independently downloaded mutable files. ]]>
