T09 · Insecure Skill Coding Practices
- Location
scripts/openclaw-hybrid-audit-changeway.js:1146- Finding
Persistent device identifier created during offline scans contrary to the documented privacy boundary
- Content
View full analysis
0 ? "warning" : "success"; const checkedCount = ITEM_SEQ - SKIP_COUNT; const passCount = checkedCount - RED_COUNT; let outputObj = { report_time: REPORT_TIME, status, red_item: RED_COUNT, checkedCount: checkedCount, passCount: passCount, agent_id: agentId, data: JSON_DATA }; const pushObj = { report_time: REPORT_TIME, status, red_item: RED_COUNT, red_count: RED_COUNT, checkedCount: checkedCount, passCount: passCount, agent_id: agentId, data: JSON_DATA.map(({ item, brief }) => ({ item, brief })) }; fs.writeFileSync( JSON_OUT_FILE, JSON.stringify(outputObj, null, 2), { encoding: 'utf-8', mode: 0o600 } ); if (!PUSH_ENABLED) { SUMMARY += `${COLORS.dim}────────────────────────────────────────────────────────────────────────${COLORS.reset}\n`; console.log(SUMMARY); console.log(`${COLORS.dim}详细审计报告已保存至: \`${REPORT_FILE}\`${COLORS.reset}`); console.log(`\n${COLORS.dim}当前为本地离线模式。如需参与全网威胁态势感知,请附加 --push 参数运行。${COLORS.reset}`); process.exit(0); return; } ``` ### Technical Analysis The Skill documentation st ...[truncated 2149 chars]- Remediation
View remediation
0 ? "warning" : "success"; const checkedCount = ITEM_SEQ - SKIP_COUNT; const passCount = checkedCount - RED_COUNT; if (!PUSH_ENABLED) { const offlineOutput = { report_time: REPORT_TIME, status, red_item: RED_COUNT, checkedCount, passCount, data: JSON_DATA }; fs.writeFileSync( JSON_OUT_FILE, JSON.stringify(offlineOutput, null, 2), { encoding: 'utf-8', mode: 0o600 } ); // Print the offline result and exit. return; } const agentId = generateAgentId(); // Build and submit push-mode data here. } ``` 2. Omit `agent_id` from all offline reports. 3. If a local correlation value is genuinely required, use a nonpersistent random identifier generated separately for each run and document it clearly. 4. Add an automated test asserting that a run without `--push` does not create `.agent-id`. 5. Add an automated test asserting that offline `report.json` does not contain `agent_id`. 6. Consider offering a documented command to delete an existing identifier and explain that deleting it resets remote correlation. 7. Ensure the implementation and `SKILL.md` privacy disclosures remain synchronized. ]]>
