T09 · Insecure Skill Coding Practices
- Location
skill/api_server.py:374- Finding
Publicly Known Authentication Token Protects a Plaintext Device-Control Service
- Content
View full analysis
Vulnerability Details
File Location:
skill/api_server.py:374-387,skill/api_server.py:588;skill/client.py:40-49;config/settings.yaml:6-23;SKILL.md:675-689
Vulnerability Type: Hardcoded credential, insecure transport, and unsafe network exposure
Risk Level: HighVulnerable Code
skill/api_server.py:374-387:javascript const AUTH_TOKEN = "clawmobile-secret-token-change-in-production"; const server_state = { running: false, current_task: null, start_time: Date.now() }; function authenticate(req) { let authHeader = req.headers["authorization"]; if (!authHeader || !authHeader.startsWith("Bearer ")) { return false; } let token = authHeader.substring(7); return token === AUTH_TOKEN; }skill/api_server.py:588:javascript server.listen(8765);skill/client.py:40-49:python def __init__(self, host: str = "localhost", port: int = 8765, token: str = None): self.base_url = f"http://{host}:{port}" self.token = token or "clawmobile-secret-token-change-in-production" self.timeout = 300 # 5 minutes default def _get_headers(self) -> Dict[str, str]: """Get request headers with authentication""" return { "Content-Type": "application/json", "Authorization": f"Bearer {self.token}" }config/settings.yaml:6-23:yaml api: base_url: "http://localhost:8765" timeout: 30000 max_retries: 3 retry_delay: 1000 server: host: "0.0.0.0" port: 8765 workers: 4 debug: false auth: token_env: "CLAWMOBILE_API_TOKEN" default_token: "clawmobile-secret-token-change-in-production" token_header: "Authorization" token_prefix: "Bearer"Technical Analysis
The generated AutoX.js server authenticates requests with a static bearer token published in the repository. The Python client silently uses the same token wh ...[truncated 2131 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove all fallback and example secrets from executable code. Refuse to start the service if no explicit token is configured.
- Generate a cryptographically random token during setup, using at least 128 bits of entropy.
- Store the token in a protected secret store or environment variable rather than committed configuration.
- Bind the service to
127.0.0.1by default. Require an explicit opt-in before listening on external interfaces. - Use ADB port forwarding or another authenticated local tunnel for host-to-device communication.
- Require TLS for any remote network mode so bearer credentials and task contents are encrypted in transit.
- Compare authentication tokens with a constant-time comparison function.
- Add request rate limiting, failed-authentication throttling, request logging, and token rotation support.
- Clearly reject placeholder tokens such as
your-autox-token-hereand the current published default.
