T09 · Insecure Skill Coding Practices
- Location
pmm_watch.sh:497- Finding
Plaintext memory previews and full-content fallback bypass client-side encryption
- Content
View full analysis
/dev/null) if [ -n "$enc_result" ] && [[ "$enc_result" == __ENC__:* ]]; then encrypted_content="$enc_result"; client_encrypted="true" fi fi local content_hash; content_hash=$(echo -n "$content" | sha256sum | cut -d' ' -f1) local content_preview; content_preview=$(echo "$content" | head -c 200) local res; res=$(pmm_curl "POST" "api.php?route=yaochi/memory/create" "$(jq -n \ --arg t "$title" --arg c "$encrypted_content" --arg cat "$category" \ --arg tags "$tags" --argjson imp "$importance" --argjson pub 0 \ --arg ch "$content_hash" --argjson ce "$client_encrypted" \ --arg cp "$content_preview" \ '{title:$t, content:$c, domain:$cat, tags:$tags, importance:$imp, is_public:$pub, content_hash:$ch, client_encrypted:$ce, content_preview:$cp}')" 2>/dev/null || true) ``` The watcher uses the same pattern: ```bash local encrypted_content="$content" client_encrypted="false" if [ -n "$ENC_KEY_CACHE" ]; then local enc_result; enc_result=$(pmm_encrypt_content "$content" 2>/dev/null) if [ -n "$enc_result" ] && [[ "$enc_result" == __ENC__:* ]]; then encrypted_content="$enc_result"; client_encrypted="true" fi fi local enc_preview; enc_preview=$(echo "$content" | head -c 200) local data; data=$(jq -n \ --arg t "$title" --arg c "$encrypted_content" --arg cp "$enc_preview" \ --arg ch "$new_hash" --argjson imp 9 --argjson pub 0 ...[truncated 2743 chars]- Remediation
View remediation
