T09 · Insecure Skill Coding Practices
- Location
scripts/agent-mesh.sh:121- Finding
Arbitrary Python Code Execution Through Environment-Controlled String Interpolation
- Content
View full analysis
/dev/null } ``` The local identity is similarly inserted into generated Python source: ```bash MY_EMAIL_PREFIX="$(detect_my_email_prefix)" ``` ```bash python3 << EOF import json try: with open("$REGISTRY_FILE") as f: data = json.load(f) for a in data['agents']: if a['emailPrefix'] == "$MY_EMAIL_PREFIX": print(f"Registry entry: {a['name']}({a.get('redName','-')}) | {a.get('ip','?')}") import os tokens_file = "$TOKENS_FILE" if os.path.exists(tokens_file): with open(tokens_file) as tf: tokens = json.load(tf).get('tokens', {}) if "$MY_EMAIL_PREFIX" in tokens: print(f"Token configured ({tokens['$MY_EMAIL_PREFIX'][:8]}...,{tokens_file})") else: print(f"⚠️ Token not found in {tokens_file} ") else: print(f"⚠️ Tokens file not found: {tokens_file}") break else: print(f"⚠️ $MY_EMAIL_PREFIX not in registry.json (edit references/registry.json or implement sync)") except Exception as e: print(f"❌ Read error: {e}") EOF ``` The broadcast implementation also embeds the identity directly: ```bash python3 -c " import json, os with open('$REGISTRY_FILE') as f: data = json.load(f) tokens = {} if os.path.exists('$TOKENS_FILE'): try: tokens = jso ...[truncated 2189 chars]- Remediation
View remediation
