T09 · Insecure Skill Coding Practices
- Location
SKILL.md:199- Finding
Automatic Transmission of Unredacted Crash Data to an External Service
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 199–234
Vulnerability Type: Sensitive information exposure through automatic error reporting
Risk Level: MediumVulnerable Code
javascript async function postErrorQuestion(error, context) { const title = `${error.name}: ${error.message.substring(0, 80)}`; const body = ` I encountered this error while ${context}: \`\`\` ${error.stack} \`\`\` **Environment:** - Node.js: ${process.version} - Platform: ${process.platform} Has anyone solved this before? `.trim(); try { const response = await client.post('/questions', { title, body, tags: ['error', 'help-needed', context.split(' ')[0]] }); const questionId = response.data.data.question.id; console.log(`📝 Posted error question: https://www.clawpenflow.com/questions/${questionId}`); return questionId; } catch (err) { console.error('Failed to post error question:', err.response?.data || err.message); } } // Usage in error handlers process.on('uncaughtException', (error) => { postErrorQuestion(error, 'running my application'); process.exit(1); });Technical Analysis
The documented integration registers a global
uncaughtExceptionhandler and sends the exception name, message, complete stack trace, runtime version, and operating-system platform to the external ClawpenFlow Q&A API. This occurs without redaction, an information-classification check, user review, or explicit approval for each disclosure.Stack traces and exception messages frequently contain sensitive information, including local filesystem paths, internal module names, service endpoints, database details, request parameters, user-controlled values, source-code fragments, account identifiers, and credentials accidentally incorporated into errors. Posting this information as a question may expose it not only to the ...[truncated 2517 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove automatic question publication from the global
uncaughtExceptionhandler. - Require explicit user review and confirmation before transmitting any diagnostic information to ClawpenFlow.
- Generate a minimal diagnostic summary rather than submitting the complete stack trace.
- Apply structured redaction to credentials, authorization headers, API keys, cookies, URLs with query strings, email addresses, user data, local paths, and other environment-specific values.
- Use an allowlist of fields approved for disclosure instead of trying only to block known secret patterns.
- Keep full error reports in access-controlled local logging or an approved private monitoring system; do not publish them to a Q&A platform.
- Clearly disclose the destination, visibility, retention policy, and exact data fields before obtaining user consent.
- Add limits on message size and normalize attacker-controlled exception content before presentation or transmission.
- If asynchronous reporting remains necessary, await completion with a short timeout and perform orderly shutdown rather than immediately calling
process.exit(1). - Add tests containing representative API keys, bearer tokens, filesystem paths, and personal data to verify that sanitization prevents disclosure.
- Remove automatic question publication from the global
