T08 · Insecure Dependencies
- Location
scripts/ingest-shared-rag.sh:4- Finding
Execution of Mutable External Code Without Integrity Verification
- Content
View full analysis
Vulnerability Details
File Location:
scripts/ingest-shared-rag.sh:4-8,scripts/query-shared-rag.sh:9-14, andSKILL.md:8-9, 22-31
Vulnerability Type: T08: Insecure Dependencies
Risk Level: MediumVulnerable code in
scripts/ingest-shared-rag.sh:bash RAG_DIR="/home/Mike/.openclaw/workspace/rag-pinecone-starter" cd "$RAG_DIR" source .venv/bin/activate python ingest.pyVulnerable code in
scripts/query-shared-rag.sh:bash RAG_DIR="/home/Mike/.openclaw/workspace/rag-pinecone-starter" QUESTION="$*" cd "$RAG_DIR" source .venv/bin/activate python query.py "$QUESTION"Related instructions in
SKILL.md:markdown Use the central RAG project at: `/home/Mike/.openclaw/workspace/rag-pinecone-starter`markdown ## Requirements - `PINECONE_API_KEY` must be set in `rag-pinecone-starter/.env` - Python venv exists at `rag-pinecone-starter/.venv`Technical Analysis
Both shell wrappers transfer execution to a fixed external workspace that is not included in the audited project and is not protected by any version pinning, checksum, signature, ownership validation, or permission check.
The command
source .venv/bin/activateexecutes the contents of an external shell file inside the current shell process. A virtual-environment activation script can contain arbitrary shell commands, so modification of that file is sufficient to execute attacker-controlled code. The wrappers then invoke the external and mutableingest.pyorquery.pyfile through a relative path.Consequently, the effective behavior of this Skill can change without any modification to the reviewed artifact. The absent external files cannot be classified as malicious based on the available evidence, but trusting and executing them without integrity controls creates an unsafe local supply-chain boundary.
The query argument itself is passed as the safely quoted `"$QUESTION ...[truncated 1940 chars]
- Remediation
View remediation
Remediation Suggestions
-
Package the required Python entry points with the Skill so that all executable behavior can be reviewed and versioned together.
-
If the external project must remain separate, pin it to an approved version and verify a cryptographic hash or signature before every execution.
-
Do not source the virtual-environment activation script. Invoke the intended interpreter directly:
bash "$RAG_DIR/.venv/bin/python" "$RAG_DIR/ingest.py"bash "$RAG_DIR/.venv/bin/python" "$RAG_DIR/query.py" "$QUESTION" -
Use absolute paths for every executed file and validate that the project directory, interpreter, and Python entry points are owned by a trusted account and are not writable by untrusted users or groups.
-
Fail closed when ownership, permissions, expected versions, or integrity checks do not match the approved configuration.
-
Run the RAG code under a dedicated least-privilege account or sandbox with access only to required documents, network endpoints, and credentials.
-
Store the Pinecone credential with restrictive permissions and limit its service-side privileges to the necessary index and operations.
-
Document that ingestion and query data may be processed by an external service, including applicable data-handling, authorization, and confidentiality requirements.
-
