T09 · Insecure Skill Coding Practices
Warning
- Location
- scripts/literag_common.py:642
- Finding
- Configurable Embedding Endpoint Can Expose Document Contents, Search Queries, and Bearer Credentials## Vulnerability Details **File Location**: `scripts/literag_common.py:125-196`, `scripts/literag_common.py:642-666`, `scripts/literag_common.py:826-831`, `scripts/literag_common.py:848-866`, `scripts/literag_common.py:1059-1061` **Vulnerability Type**: Unrestricted transmission of potentially sensitive data to a configurable network endpoint **Risk Level**: Medium ### Vulnerable Code Configuration permits arbitrary source paths and an arbitrary embedding endpoint: ```python def load_config(config_path: str | Path) -> AppConfig: config_path = Path(config_path).expanduser().resolve() workspace_root = detect_workspace_root(config_path) raw = json.loads(config_path.read_text(encoding="utf-8")) defaults = raw.get("defaults", {}) chunking = defaults.get("chunking", {}) retrieval = defaults.get("retrieval", {}) fts = retrieval.get("fts", {}) vector = retrieval.get("vector", {}) hybrid = retrieval.get("hybrid", {}) ranking = defaults.get("ranking", raw.get("ranking", {})) embedding = raw.get("embedding", {}) libraries = [] for lib in raw.get("libraries", []): lib_chunking = lib.get("chunking", {}) lib_retrieval = lib.get("retrieval", {}) lib_vector = lib_retrieval.get("vector", {}) lib_hybrid = lib_retrieval.get("hybrid", {}) lib_ranking = lib.get("ranking", {}) source_paths = [] for source in lib.get("paths", []): source_paths.append( { "path": str(resolve_path(source["path"], base_dir=config_path.parent)), "include": source.get("include") or ["**/*"], "exclude": source.get("exclude") or [], } ) libraries.append( LibraryConfig( id=lib["id"], name=lib.get("name", lib["id"]), sqlite_path=resolve_path( ...[truncated 10217 chars]
- Remediation
- ## Remediation Suggestions 1. Restrict embedding endpoints to loopback addresses by default. 2. Require an explicit configuration flag such as `allowRemoteEmbeddingEndpoint` before contacting non-loopback hosts. 3. Reject non-HTTP(S) schemes, URL user information, malformed hosts, and remote plaintext HTTP endpoints. 4. Require HTTPS for every non-loopback endpoint and perform normal certificate validation. 5. Display the destination origin and request confirmation before the first remote transmission. 6. Clearly document that vector indexing sends corpus text and vector/hybrid search sends query text to the configured provider. 7. Support a destination allowlist or administrator policy enforced independently of the workspace configuration. 8. Restrict source paths to approved roots unless the user explicitly authorizes an external path. 9. Add default exclusions for `.env`, private keys, credential stores, VCS metadata, cloud credentials, and similar sensitive files. 10. Add a dry-run mode that lists selected files and the embedding destination before network transmission. 11. Avoid sending bearer credentials over plaintext transport and redact credentials from all diagnostics. 12. Preserve and prominently document FTS-only operation as a network-free alternative.
