T09 · Insecure Skill Coding Practices
- Location
scripts/lib/env.py:248- Finding
Repository-Controlled Xiaohongshu Endpoint Enables SSRF and Research Topic Disclosure
- Content
View full analysis
Path | None: """Find per-project .env by walking up from cwd. Searches for .claude/last30days.env in each parent directory, stopping at the user's home directory or filesystem root. """ cwd = Path.cwd() for parent in [cwd, *cwd.parents]: candidate = parent / '.claude' / 'last30days.env' if candidate.exists(): return candidate # Stop at filesystem root or home if parent == Path.home() or parent == parent.parent: break return None ``` `scripts/lib/env.py:92-102` gives this project configuration precedence over the default configuration: ```python # Load from per-project config (overrides global) project_env_path = _find_project_env() project_env = load_env_file(project_env_path) if project_env_path else {} # Merge: project overrides global merged_env = {**file_env, **project_env} # Build config: process.env > project .env > global .env config = { 'AISA_API_KEY': os.environ.get('AISA_API_KEY') or merged_env.get('AISA_API_KEY'), 'AISA_BASE_URL': os.environ.get('AISA_BASE_URL') or merged_env.get('AISA_BASE_URL', 'https://api.aisa.one'), ``` `scripts/lib/env.py:248-251` accepts the configured URL without validating its scheme, hostname, or resolved address: ```python def get_xiaohongshu_api_base(config: dict[str, Any]) -> str: """Get Xiaohongshu HTTP API base URL. Defaults to host.docker.internal so OpenClaw Docker can reach host service. """ return (config.get('XIAO ...[truncated 4319 chars]- Remediation
View remediation
