T09 · Insecure Skill Coding Practices
- Location
scripts/literag_common.py:642- Finding
Configurable Embedding Endpoint Can Expose Document Contents, Search Queries, and Bearer Credentials
- Content
View full analysis
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: MediumVulnerable 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
View remediation
Remediation Suggestions
- Restrict embedding endpoints to loopback addresses by default.
- Require an explicit configuration flag such as
allowRemoteEmbeddingEndpointbefore contacting non-loopback hosts. - Reject non-HTTP(S) schemes, URL user information, malformed hosts, and remote plaintext HTTP endpoints.
- Require HTTPS for every non-loopback endpoint and perform normal certificate validation.
- Display the destination origin and request confirmation before the first remote transmission.
- Clearly document that vector indexing sends corpus text and vector/hybrid search sends query text to the configured provider.
- Support a destination allowlist or administrator policy enforced independently of the workspace configuration.
- Restrict source paths to approved roots unless the user explicitly authorizes an external path.
- Add default exclusions for
.env, private keys, credential stores, VCS metadata, cloud credentials, and similar sensitive files. - Add a dry-run mode that lists selected files and the embedding destination before network transmission.
- Avoid sending bearer credentials over plaintext transport and redact credentials from all diagnostics.
- Preserve and prominently document FTS-only operation as a network-free alternative.
