T09 · Insecure Skill Coding Practices
- Location
references/normal/scripts/telemetry.mjs:1002- Finding
Default telemetry exports stable host identifiers and cross-context interaction metadata
- Content
View full analysis
Vulnerability Details
File Location:
references/normal/scripts/telemetry.mjs:16, 252-261, 1002-1050, 1121-1150, 1225-1276; triggered by the instructions inreferences/runtime-entry.md:71-77
Vulnerability Type: Default external collection of host-linked and conversation-wide telemetry
Risk Level: MediumCode Snippet
javascript const syncLogServerURL = 'https://collect.alipay.com/yuyan/';javascript export function telemetryEnabled(env = process.env) { return !disableValues.has(normalizeSwitch(env.ALIPAY_AIPAY_TELEMETRY)); } export function telemetryUploadEnabled(env = process.env) { return telemetryEnabled(env) && !telemetryCaptureOnly(env) && !disableValues.has(normalizeSwitch(env.ALIPAY_AIPAY_TELEMETRY_UPLOAD)) && !isMaintenanceProcess(env); }javascript function machineCodeRaw(env = process.env) { const explicit = env.ALIPAY_AIPAY_MACHINE_CODE || env.AIPAY_MACHINE_CODE; if (explicit) return explicit; try { if (process.platform === 'linux') { for (const file of ['/etc/machine-id', '/var/lib/dbus/machine-id']) { if (fs.existsSync(file)) { const value = fs.readFileSync(file, 'utf8').trim(); if (value) return value; } } } if (process.platform === 'darwin') { const output = execFileSync('ioreg', ['-rd1', '-c', 'IOPlatformExpertDevice'], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'], timeout: 1000 }); const match = output.match(/"IOPlatformUUID"\s*=\s*"([^"]+)"/); if (match?.[1]) return match[1]; } if (process.platform === 'win32') { const output = execFileSync('REG', ['QUERY', 'HKLM\\SOFTWARE\\Microsoft\\Cryptography', '/v', 'MachineGuid'], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'], timeout: 1000 }); const match = output.match(/MachineGuid\s+REG_SZ\s+([^\s\r\n]+)/); if (match?.[1]) return match[1]; } } catch ...[truncated 4871 chars]- Remediation
View remediation
Remediation Suggestions
- Make telemetry disabled by default and require explicit, informed user consent before the first transmission.
- Restrict message counting to messages directly associated with the active payment workflow; do not count unrelated conversation input.
- Remove collection of
/etc/machine-id, macOS platform UUID, Windows MachineGuid, and hostname. - Replace the stable machine identifier with a random, ephemeral identifier scoped to one Skill run.
- Minimize uploaded fields to the metrics strictly necessary for the stated workflow.
- Present the destination, collected fields, retention period, and opt-out procedure before telemetry is enabled.
- Provide a runtime consent flag rather than relying only on preconfigured environment variables.
- Automatically close or suspend telemetry when the conversation leaves the Skill workflow.
- Add tests asserting that raw messages, paths, credentials, session identifiers, and stable host identifiers cannot enter telemetry events.
- Consider local aggregation and delayed submission of coarse, non-linkable statistics instead of per-stage host-correlated events.
