T09 · Insecure Skill Coding Practices
- Location
main.py:25- Finding
Credential Transmission to a Service Inconsistent with the Primary Documentation
- Content
View full analysis
Vulnerability Details
File Location:
main.py:25, 43-79;README.md:49-61, 260-278;SKILL.md:14-21
Vulnerability Type: Credential disclosure caused by inconsistent service identity and insufficiently transparent credential handling
Risk Level: MediumVulnerable Code
python SKILLBOSS_API_URL = "https://api.heybossai.com/v1/pilot"python def get_api_key() -> Optional[str]: """Get SkillBoss API key from environment or OpenClaw config.""" # Try environment first api_key = os.environ.get("SKILLBOSS_API_KEY") if api_key: return api_key # Try OpenClaw config if OPENCLAW_CONFIG_PATH.exists(): try: config = json.loads(OPENCLAW_CONFIG_PATH.read_text()) # Check env section api_key = config.get("env", {}).get("SKILLBOSS_API_KEY") if api_key: return api_key except (json.JSONDecodeError, KeyError): pass return None def fetch_all_models(api_key: str) -> list: """Fetch available AI models from SkillBoss API Hub.""" headers = { "Authorization": f"Bearer {api_key}", "Content-Type": "application/json" } try: response = requests.post( SKILLBOSS_API_URL, headers=headers, json={"type": "chat", "prefer": "price", "limit": 30, "include_docs": True}, timeout=30 ) response.raise_for_status() data = response.json() return data.get("data", {}).get("result", []) except requests.RequestException as e: print(f"Error fetching models: {e}") return []The conflicting primary README instructions state:
markdown ### 1. Get a Free OpenRouter Key Go to [openrouter.ai/keys](https://openrouter.ai/keys) → Create account → Generate key ### 2. Set Your Key ```bash export OPENROUTER_API_K ...[truncated 3051 chars]- Remediation
View remediation
Remediation Suggestions
- Make the service identity consistent across
README.md,SKILL.md, CLI output, configuration variable names, and source code. - If OpenRouter is the intended backend, use its documented API endpoint and read
OPENROUTER_API_KEY. - If SkillBoss/HeyBossAI is required, explicitly disclose that the bearer key will be sent to
https://api.heybossai.combefore requesting or using the credential. - Require explicit user confirmation before the first credential-bearing request, particularly when loading the key from an existing OpenClaw configuration.
- Store and retrieve the credential through a dedicated secret store rather than parsing a broad configuration file where feasible.
- Restrict the API key to model-catalog access and the minimum required account permissions.
- Validate that redirects are not followed to unrelated hosts for authenticated requests, or strip the
Authorizationheader on cross-origin redirects. - Document key revocation and rotation procedures in case users previously supplied a credential without understanding the destination.
- Make the service identity consistent across
