Back to skill

Security audit

Memory Hybrid Stack

Security checks for vulnerabilities and agentic risk

Overview

This skill is purpose-built for a local memory stack, but it gives broad write/delete access to memory stores and uses unsafe credential-loading patterns that deserve review before installation.

Install only if you trust the memory-stack .env file and the agents/operators who can invoke this skill. Prefer least-privilege database and Redis accounts, keep Qdrant pointed at the intended local endpoint, review all mutating SQL/Redis/Qdrant calls before running them, and harden the scripts before production use by replacing shell source parsing, limiting exported secrets, and adding confirmation for destructive actions.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/facts_sql.sh:8
Finding

Executable Shell Configuration Enables Command Execution

Content
View full analysis
&2 exit 1 fi set -a # shellcheck disable=SC1090 source "$ENV_FILE" ``` `scripts/state_kv.sh:19-24`: ```bash ENV_FILE="${MEMORY_STACK_ENV:-$STACK_ROOT/.env}" if [[ -f "$ENV_FILE" ]]; then set -a # shellcheck disable=SC1090 source "$ENV_FILE" ``` `scripts/qdrant_request.sh:11-16`: ```bash ENV_FILE="${MEMORY_STACK_ENV:-$STACK_ROOT/.env}" if [[ -f "$ENV_FILE" ]]; then set -a # shellcheck disable=SC1090 source "$ENV_FILE" ``` ### Technical Analysis All three scripts load the stack configuration by using Bash's `source` command. An environment file sourced this way is executable shell code, not merely a collection of configuration values. It may contain command substitutions, function calls, redirections, or arbitrary commands. The `MEMORY_STACK_ENV` variable also permits callers to select a different file. Therefore, exploitation is possible if an attacker can modify the default `.env`, influence `MEMORY_STACK_ENV`, or otherwise cause a malicious file to be selected. Loading connection configuration is necessary for the Skill's declared functionality, but executing that configuration as shell code exceeds the minimum privilege required. The vulnerability is not evidence that the included `.env` is currently malicious. It creates a command-execution boundary that depends entirely on the integrity of an external file. ### Attack Path 1. An attacker obtains write access to the default memory-stack `.env`, or influences the environment used to launch the helper and sets `MEMORY_STACK_ENV` to an attacker-controlled ...[truncated 850 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/facts_sql.sh:13
Finding

Shared Environment File Exports Unrelated Secrets to Child Processes

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/state_kv.sh:29
Finding

Redis Password Is Passed Through Process Command-Line Arguments

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (6)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill exposes shell-capable workflows that can read and modify Postgres, Redis, and Qdrant, but it declares no explicit tool scope or permission boundary. That increases the chance an agent can invoke powerful local commands without clear governance, leading to unintended data access or destructive writes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation instructs the agent to auto-load credentials from .env and perform raw SQL, Redis set/delete, and Qdrant write/delete operations without prominent safety warnings or approval requirements. In this context, the skill directly targets durable and volatile memory stores, so misuse could overwrite facts, erase state, or expose sensitive connection details and memory contents.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This code file issues a curl request to a configurable endpoint and may send JSON payloads or file contents supplied by the caller, but there is no confirmation prompt, logging, or explanatory comment warning that data will be transmitted over the network. Because SQP-2 applies to code files and specifically covers network/HTTP calls that transmit user or system data, this lack of disclosure is in scope.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script performs state-changing Redis operations via SET and DEL, which can overwrite or remove stored data, but it provides no confirmation prompt, logging, or user-facing warning about these effects. In this file there are also no comments or docstrings disclosing that these commands modify or delete persisted state.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The script sources an environment file into the current shell, which can expose credentials or other sensitive configuration to subsequent logic, but there is no print, comment explaining the sensitivity, or other user-facing disclosure. SQP-2 covers access to sensitive environment variables or credentials in code files when there is no warning mechanism.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The script accesses the sensitive REDIS_PASSWORD environment variable and injects it into the redis-cli command, but the file contains no warning or explanatory text that credentials are being consumed. This matches the missing-user-warning criterion for sensitive environment variable access in code files.

Content

No source excerpt is available for this finding.