T09 · Insecure Skill Coding Practices
Error
- Location
- scripts/echo-web.py:300
- Finding
- Automatic Disclosure of Private Note Content to Third-Party Services Without Effective Opt-In<![CDATA[ ## Vulnerability Details **File Location**: `scripts/echo-web.py:17-20, 300-307, 338-369, 394-403`; `scripts/ai_service.py:42-65, 165-186`; `config.example.yaml:12-16` **Vulnerability Type**: Unintended sensitive-data transmission and ineffective security configuration **Risk Level**: High ### Code Evidence `scripts/echo-web.py:17-20`: ```python NOTION_API_KEY = 'YOUR_MATON_API_KEY' NOTION_BASE_URL = 'https://gateway.maton.ai/notion/v1/' GOOGLE_CALENDAR_BASE_URL = 'https://gateway.maton.ai/google-calendar/calendar/v3/' ``` `scripts/echo-web.py:300-307`: ```python capsule_id = data.get('id', datetime.now().strftime('%Y%m%d%H%M%S%f')) created_at = datetime.now().isoformat() capsule_type = data.get('type', 'note') title = data.get('title', '') content = data.get('content', '') url = data.get('url', '') tags = data.get('tags', '') ``` `scripts/echo-web.py:341-369`: ```python if url: try: from ai_service import analyze_link ai_result = analyze_link(capsule_id, url) if ai_result.get('success'): auto_tags.extend(ai_result.get('suggested_tags', [])) except Exception as e: print(f"AI link analysis failed: {e}") elif capsule_type == 'idea' or (content and len(content) < 50): try: from ai_service import analyze_expansion ai_result = analyze_expansion(capsule_id, content) if ai_result.get('success'): auto_tags.extend(ai_result.get('suggested_tags', [])) except Exception as e: print(f"AI idea expansion failed: {e}") ``` `scripts/echo-web.py:394-403`: ```python notion_page_id, notion_url = sync_to_notion( capsule_id, capsule_type, title, content, tags ) if notion_url: send_telegram_notion_link(title, notion_url, capsule_type) ``` `scripts/ai_service.py:42-65`: ```python headers = { "Authorization": f"Bearer {XIAOXIAOZHAO_CONFIG['api_key']}", "Content-Type": "application/json" } messages = [{"role": "user", "content": prompt}] if syst ...[truncated 2639 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Load configuration from a defined configuration file or protected environment variables. 2. Default every external integration to disabled. 3. Enforce explicit checks such as: ```python if config["ai"]["enabled"]: ... if config["notion"]["enabled"]: ... ``` 4. Require clear user consent before transmitting existing or newly entered content. 5. Consider per-item controls so sensitive notes can remain local even when an integration is generally enabled. 6. Display the exact destination service and data fields before enabling synchronization. 7. Use official provider APIs where the documentation promises direct provider integration. 8. Store API keys in environment variables or a secrets manager, not source files. 9. Reject placeholder credentials at startup and avoid making requests when integrations are unconfigured. 10. Add automated tests proving that no outbound request occurs when an integration is disabled. ]]>
