T09 · Insecure Skill Coding Practices
- Location
scripts/human_detection.py:24- Finding
Unrestricted API Endpoint Allows Disclosure of Device Authentication Material
- Content
View full analysis
Dict[str, str]: time_millis = get_time_millis() signature = generate_signature(uuid, app_key, app_secret, time_millis, move_card) return { "Content-Type": "application/json; charset=UTF-8", "uuid": uuid, "appKey": app_key, "timeMillis": time_millis, "signature": signature, "X-Request-Id": os.urandom(16).hex() } url = f"{JF_BASE_URL}/rtc/device/getconfig/{device_token}" headers = get_headers(uuid, app_key, app_secret, move_card) response = requests.post(url, headers=headers, json=body, timeout=30) ``` The same construction is used for credential-bearing requests at: - `scripts/human_detection.py:69-79` - `scripts/human_detection.py:97-103` - `scripts/human_detection.py:118-128` ### Technical Analysis The API destination is constructed directly from the `JF_ENDPOINT` environment variable without checking whether the hostname is one of the documented JFTech service endpoints. Consequently, any party capable of influencing the process environment can redirect API traffic to an arbitrary HTTPS server. Each redirected request discloses authentication-related information to that server: - The device access token is included in the URL path. - The user UUID and application key are included in request headers. - A timestamp and secret-derived signature are included in request headers. - Device configuration data is included in request bodies. TLS does not prevent this disclosure when the configured destination is controlled by the attacker and presents a valid certificate for its own hostname. The appl ...[truncated 2398 chars]- Remediation
View remediation
