T09 · Insecure Skill Coding Practices
- Location
tools/pinecone-memory.mjs:259- Finding
Incomplete Secret Redaction Allows Sensitive Data to Be Uploaded to Pinecone
- Content
View full analysis
0) { const index = getIndex(pc, indexName); const ns = getNamespace(index, namespace); const statsBefore = await statIndex(index, namespace); const beforeCount = Number(statsBefore.namespaceRecordCount || 0); const batchSize = 50; for (let i = 0; i < records.length; i += batchSize) { const batch = records.slice(i, i + batchSize); await upsertRecords(ns, batch); } ``` ### Technical Analysis The Skill processes local Markdown memory files and transmits their contents to an external Pinecone index. Its security control consists of three regular expressions that only recognize narrow variations of `api_key`, `token`, and `password` followed by `:` or `=`. This approach does not reliably detect many common sensitive-data formats, including: - PEM private keys and other multiline credentials. - Authorization headers and bearer tokens. - Cloud access keys and secret keys. - Session cookies. - Database and service connection strings. - Credentials represented as JSON, YAML, Markdown tables, or natural-language ...[truncated 2152 chars]- Remediation
View remediation
