T09 · Insecure Skill Coding Practices
Error
- Location
- skills/smyx_common/scripts/config-dev.yaml:1
- Finding
- Sensitive media, identity data, and authentication tokens are transmitted over unencrypted HTTP<![CDATA[ ## Vulnerability Details **File Location**: `skills/smyx_common/scripts/config.yaml:1-15`, `skills/smyx_common/scripts/config-dev.yaml:1-7`, `skills/smyx_common/scripts/util.py:550-646`, `skills/smyx_analysis/scripts/skill.py:105-133` **Vulnerability Type**: Cleartext transmission of sensitive information **Risk Level**: High ### Relevant Code The default configuration explicitly selects the development environment: ```yaml ApiEnum: api-key: null api-secret-key: null base-url-health: https://lifeemergence.com/jeecg-boot-xzgz base-url-open-api: https://open.lifeemergence.com/smyx-open-api base-url-open-h5: http://livemonitor.lifeemergence.com database-url: null ConstantEnum: app--id: x1a3s4nwy1s2r4se current--tentant-code: XIAN_ZHAO_GAN_ZHI default--skill-platform-name: ARK_CLAW feishu-app--id: cli_a93d769369badcb1 feishu-app--secret: null is-debug: false env: dev ``` The selected development configuration overrides the HTTPS endpoints with private-network HTTP endpoints: ```yaml ApiEnum: base-url-open-api: "http://192.168.1.234:9601/smyx-open-api" base-url-open-h5: "http://192.168.1.234:4100" base-url-health: "http://192.168.1.234:7070/jeecg-boot-xzgz" ConstantEnum: is-debug: true ``` Identity information is sent to the HTTP health endpoint to create or retrieve an account: ```python def _get_or_create_user(username): _url = ApiEnum.BASE_URL_HEALTH + "/sys/phoneLogin" open_id = username _data = { "silent": 1, "register": 1, "openId": open_id, "mobile": username, "source": ConstantEnum.DEFAULT__SKILL_HUB_NAME } try: _response = requests.post(_url, json=_data) if _response.status_code == 200: _response_json = _response.json() if _response_json and _response_json.get("success"): return _response_json and _response_json.get("result") ``` The returned tokens are attached to subsequent requests: ```pyth ...[truncated 3672 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Change the distributed default from `env: dev` to a production configuration. 2. Require HTTPS for every authentication, analysis, polling, report, and export endpoint. 3. Reject non-HTTPS endpoint configuration at startup, except under an explicit test-only flag that cannot be enabled in normal installations. 4. Do not use private development IP addresses in released Skill packages. 5. Keep TLS certificate verification enabled and fail closed on certificate errors. 6. Rotate all tokens that may have been transmitted using this configuration. 7. Add automated tests asserting that every resolved service URL uses `https://`. 8. Consider certificate or public-key pinning where the deployment model permits it. 9. Minimize token scope and lifetime, and use separate narrowly scoped credentials for analysis and report listing. 10. Inform users before uploading private camera media to a remote processor and document retention, deletion, and access-control policies. ]]>
