T09 · Insecure Skill Coding Practices
- Location
src/token-compressor.js:17- Finding
Configurable Plaintext Endpoint Can Expose Sensitive Conversation Data
- Content
View full analysis
{ const body = JSON.stringify({ model: this.compressionModel, messages: [ { role: 'system', content: 'You are a text compression tool. Output only what is asked, nothing else. No explanations, no preamble.' }, { role: 'user', content: prompt } ], stream: false, options: { temperature: 0.1, // Low creativity — we want faithful compression num_predict: 512 // Cap output length } }); const req = http.request({ hostname: this.ollamaHost, port: this.ollamaPort, path: '/api/chat', method: 'POST', headers: { 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(body) }, timeout: 15000 // 15s max — if Ollama is slow, skip compression }, (res) => { let data = ''; res.on('data', chunk => data += chunk); res.on('end', () => { try { const parsed = JSON.parse(data); resolve(parsed.message?.content?.trim() || null); } catch { reject(new Error('Invalid Ollama response')); } }); }); req.on('error', reject); req.on('timeout', () => { req.destroy(); reject(new Error('Ollama timeout')); }); req.write(body); req.end(); }); } ``` ### Technical Analysis The endpoint hostname and port are accepted directly from caller-controlled configuration. The implementation does not verify that the resolved destination is a loopback address or an approved local Ollama service. Both `compressMessage()` and `compressHistory()` place potentially ...[truncated 2168 chars]- Remediation
View remediation
