T09 · Insecure Skill Coding Practices
- Location
index.js:143- Finding
Path Traversal in Document Persistence and Deletion
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a local document indexer, but its search claims are misleading and crafted document IDs could write or delete JSON files outside its storage folder.
Review before installing. Use it only with trusted document IDs and an isolated STORE_PATH with limited filesystem permissions. Do not rely on it for true semantic search unless the embedding implementation is replaced, and avoid indexing sensitive documents until persistence and deletion behavior are clearly documented and path validation is fixed.
index.js:143Path Traversal in Document Persistence and Deletion
The skill claims semantic search using local vector embeddings, but the implementation reportedly uses deterministic hash-based synthetic vectors and lexical/hash-derived matching instead of true embeddings. This can mislead users into trusting retrieval quality and security/privacy properties that do not exist, causing incorrect results, faulty downstream decisions, and unsafe use in knowledge, compliance, or safety-sensitive workflows.
Without declared permissions the skill's intent is opaque and cannot be validated.
Indexing persists the full document and generated vector to local storage through _persistDocument(), which writes a JSON file containing content and metadata. Although initialization is logged, there is no user-facing warning at the write point and no comment/docstring explaining that indexing stores document data on disk under STORE_PATH.
The code provides delete() and clear() methods that irreversibly remove stored JSON files from disk via fs.unlinkSync, but there is no confirmation prompt, warning log, or explanatory comment/docstring disclosing this destructive behavior. For code files, file deletions should have some visible user disclosure unless such behavior is clearly communicated elsewhere in the skill description, which is not present in this file.
The stated purpose is semantic search over local vector embeddings for knowledge base indexing and similarity matching. In practice, the store computes vectors from a simple hash of raw text, so the actual behavior is lexical/deterministic hashing rather than embedding-based semantic search, creating a clear description-to-behavior mismatch.
The manifest describes a vector store that uses local vector embeddings for semantic search and similarity matching. However, _generateVector derives vectors deterministically from a simple text hash and sine function, which is not an embedding model and does not implement meaning-based semantic representations as described.
The skill reads STORE_PATH and other environment-based configuration that controls where persisted data is stored, but the file does not explain this behavior to users. While accessing these variables is not inherently unsafe, code-file guidance calls for disclosure when environment-based behavior affects user data handling or storage.
No suspicious patterns detected.