T09 · Insecure Skill Coding Practices
Warning
- Location
- scripts/bundle.js:83320
- Finding
- Sensitive recipient and CRM data is exposed in process output<![CDATA[ ## Vulnerability Details **File Location**: `scripts/bundle.js:83084-83123` and `scripts/bundle.js:83320-83370` **Vulnerability Type**: Sensitive information exposure through application logs **Risk Level**: Medium ### Vulnerable Code Task inputs can retain complete candidate records and arbitrary metadata: ```javascript metadata: { source: "candidates-list", previousStep: args.previousStep, candidates: args.candidates, ...args.metadata } ``` The complete task input is included in the result: ```javascript return { taskInput, jobGroupId: result.jobGroupId, instanceId: result.instanceId, scriptId: result.scriptId, totalPhones: valid.length }; ``` The result, including `taskInput`, is then serialized to standard output: ```javascript executeOutboundTask(options).then((result) => { console.log("\n\u2705 \u4EFB\u52A1\u6267\u884C\u6210\u529F"); console.log("\n\u7ED3\u679C:"); console.log(JSON.stringify(result, null, 2)); process.exit(0); }).catch((error) => { console.error("\n\u274C \u4EFB\u52A1\u6267\u884C\u5931\u8D25:", error.message); process.exit(1); }); ``` ### Technical Analysis The returned `taskInput` contains complete telephone numbers and may contain candidate names, evaluation scores, CRM attributes, campaign data, and arbitrary caller-supplied metadata. Serializing the complete result with `JSON.stringify` writes all of this data to standard output without redaction or field-level filtering. Standard output is commonly retained by CI systems, agent execution transcripts, container logging drivers, orchestration platforms, terminal recording systems, and centralized monitoring services. These systems may have wider access permissions and longer retention periods than the original task data. The exposure is not limited to telephone numbers because the parsing logic preserves full source objects under fields such as `metadata.candidates` and spreads arbitrary metadata into the task object. ### Attack Path ...[truncated 1362 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove `taskInput` from the returned operational result. Return only non-sensitive status information: ```javascript return { jobGroupId: result.jobGroupId, instanceId: result.instanceId, scriptId: result.scriptId, totalPhones: valid.length }; ``` 2. Do not preserve complete upstream candidate or CRM records unless they are strictly required for execution. Use an allowlist of necessary metadata fields. 3. If telephone numbers must be displayed for troubleshooting, redact them: ```javascript function maskPhone(phone) { return phone.replace(/^(\d{3})\d{4}(\d{4})$/, "$1****$2"); } ``` 4. Separate user-facing results from diagnostic logs. Keep verbose logging disabled by default and require an explicit debugging option. 5. Apply structured log sanitization before serializing any object. Recursively remove fields such as `phone`, `phoneNumber`, `mobile`, `contacts`, `candidates`, and other organization-specific personal-data fields. 6. Configure execution environments to restrict access to logs and establish short retention periods for any logs that may already contain personal information. 7. Add automated tests asserting that task output and logs do not contain complete telephone numbers or arbitrary input metadata. ]]>
