T09 · Insecure Skill Coding Practices
- Location
- skills/smyx_common/scripts/config-dev.yaml:2
- Finding
- Minors' Video Data and Authentication Credentials Are Transmitted over Plaintext HTTP<![CDATA[ ## Vulnerability Details **File Location**: `skills/smyx_common/scripts/config.yaml:15`; `skills/smyx_common/scripts/config-dev.yaml:2-4`; `skills/smyx_analysis/scripts/skill.py:113-128`; `skills/smyx_common/scripts/util.py:548-561, 610-646` **Vulnerability Type**: Plaintext transmission of sensitive data **Risk Level**: Critical ### Vulnerable Code The default configuration activates the development environment: ```yaml # skills/smyx_common/scripts/config.yaml:15 env: dev ``` The selected development configuration replaces the public HTTPS endpoints with private-network HTTP endpoints: ```yaml # skills/smyx_common/scripts/config-dev.yaml:1-7 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 ``` Local child-monitoring files are read and prepared for upload: ```python # skills/smyx_analysis/scripts/skill.py:113-128 if (input_path.startswith("http://") or input_path.startswith("https://")): params.update({ "videoUrl": input_path }) else: _validate_file(input_path) # Automatically detect the MIME type mime_type, _ = mimetypes.guess_type(input_path) if mime_type is None: mime_type = 'application/octet-stream' # Read the file content with open(input_path, 'rb') as f: file_content = f.read() files = { 'file': (os.path.basename(input_path), file_content, mime_type) } ``` Identity registration is performed against the configured health endpoint: ```python # skills/smyx_common/scripts/util.py:548-561 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 = reques ...[truncated 3674 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove `env: dev` from all production and distributable Skill packages. 2. Require HTTPS for every authentication, upload, polling, history, and report endpoint. 3. Reject endpoints whose scheme is not `https`. 4. Apply an explicit allowlist of approved API origins instead of accepting arbitrary absolute URLs. 5. Block private, loopback, link-local, and metadata-service destinations unless a separately secured development mode is explicitly enabled. 6. Keep development configuration outside the released package or require an explicit development-only environment variable. 7. Use valid certificate verification and do not permit TLS verification to be disabled. 8. Rotate any credentials that may already have traversed the plaintext endpoints. 9. Obtain explicit informed consent before uploading recordings of minors, and document the destination, retention period, and deletion policy. 10. Minimize uploaded content where possible, such as extracting only necessary frames or features locally. 11. Add automated tests that fail when an active endpoint uses HTTP or resolves to an unapproved private address. ]]>
