T09 · Insecure Skill Coding Practices
- Location
memory-manager.sh:21- Finding
Automatic Plaintext Retention of Sensitive Conversation Data
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:27-39;memory-manager.sh:21-25,memory-manager.sh:77-109, andmemory-manager.sh:207-225
Vulnerability Type: Plaintext sensitive-data storage with insufficient access-control hardening
Risk Level: MediumThe Skill explicitly instructs the Agent to collect personal information, infrastructure details, server addresses, and API keys:
markdown Automatically extract and store memories whenever the user shares: - **Preferences**: "I prefer dark mode", "I like Python over JavaScript" - **Personal facts**: names, locations, roles, team members, project names - **Decisions**: "We decided to use PostgreSQL", "Let's go with the microservice approach" - **Instructions**: "Always run tests before committing", "Never deploy on Fridays" - **Important dates**: deadlines, birthdays, recurring events - **Technical context**: stack details, repo URLs, server addresses, API keys (stored locally only) - **Corrections**: "Actually, my name is spelled with a K" (update existing memory)The storage locations are ordinary local JSON files:
bash MEMORY_DIR="${OPENCLAW_MEMORY_DIR:-$HOME/.openclaw/smart-memory}" MEMORIES_FILE="$MEMORY_DIR/memories.json" ARCHIVE_FILE="$MEMORY_DIR/archive.json" STATS_FILE="$MEMORY_DIR/stats.json" CONFIG_FILE="$MEMORY_DIR/config.json"Initialization creates the directory and files without explicitly enforcing restrictive permission modes:
bash cmd_init() { mkdir -p "$MEMORY_DIR" if [ ! -f "$MEMORIES_FILE" ]; then echo '{"memories":[],"version":"1.0.0","created":"'"$(now_iso)"'"}' | jq . > "$MEMORIES_FILE" info "Created memories store: $MEMORIES_FILE" fi if [ ! -f "$ARCHIVE_FILE" ]; then echo '{"archived":[],"version":"1.0.0"}' | jq . > "$ARCHIVE_FILE" info "Created archive: $ARCHIVE_FILE" fi if [ ! -f "$STATS_FILE" ]; then cat > "$ ...[truncated 3306 chars]- Remediation
View remediation
Remediation Suggestions
- Prohibit storage of passwords, API keys, session tokens, private keys, recovery codes, and authentication headers.
- Add secret-detection rules before persistence and reject or redact values matching known credential formats and high-entropy token patterns.
- Require explicit user opt-in before retaining personal, technical, or otherwise sensitive information; do not infer consent from ordinary conversation.
- Create the storage directory with
install -d -m 0700or an equivalent operation and enforce0600on every JSON and lock file. - Set a restrictive
umask, such asumask 077, at script startup. - Offer encryption at rest using an operating-system key store or another appropriately protected key source. Do not store the encryption key beside the data.
- Apply the same controls to archived values, update history, exports, and backups.
- Warn users that exports contain sensitive memory content and avoid sending exports to logs or shared output channels.
