T09 · Insecure Skill Coding Practices
Error
- Location
- skills/smyx_common/scripts/config.yaml:4
- Finding
- Sensitive Surveillance Media and Authentication Credentials Transmitted over Plaintext HTTP<![CDATA[ ## Vulnerability Details **File Location**: `skills/smyx_common/scripts/config.yaml:4-6,15`; `skills/smyx_common/scripts/config-dev.yaml:2-4`; `skills/smyx_analysis/scripts/skill.py:122-130`; `skills/smyx_common/scripts/util.py:610-612,646-647` **Vulnerability Type**: Plaintext transmission of sensitive data **Risk Level**: High ### Vulnerable Code `skills/smyx_common/scripts/config.yaml:4-6,15`: ```yaml 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 env: dev ``` `skills/smyx_common/scripts/config-dev.yaml:2-4`: ```yaml 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" ``` `skills/smyx_analysis/scripts/skill.py:122-130`: ```python # 读取文件内容 with open(input_path, 'rb') as f: file_content = f.read() files = { 'file': (os.path.basename(input_path), file_content, mime_type) } ``` `skills/smyx_common/scripts/util.py:610-612,646-647`: ```python headers.setdefault("X-Access-Token", ApiEnum.TOKEN) headers.setdefault("X-Api-Key", ApiEnum.API_SECRET_KEY) headers.setdefault("Authorization", ApiEnum.OPEN_TOKEN) ``` ```python response = requests.request(method, url, *args, json=data, params=params, headers=headers, timeout=int(timeout), **argss) ``` ### Technical Analysis The packaged default configuration selects the development environment through `env: dev`. The configuration loader then applies `config-dev.yaml`, whose API, health, and web endpoints use unencrypted HTTP. When local video analysis is requested, the Skill reads the entire surveillance file and passes it to the remote analysis operation. The common request utility adds access tokens, API keys, authorization tokens, identity metadata, and request data before sending the request. It does not reject plainte ...[truncated 2009 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Change the packaged default environment to production and ensure all production endpoints use HTTPS. 2. Remove development configuration from release artifacts, or require an explicit developer-only opt-in that cannot be enabled by ordinary Skill input. 3. Reject any non-HTTPS remote URL in `RequestUtil.http_request` unless it resolves to an explicitly approved loopback test endpoint. 4. Do not permit authentication headers or sensitive media to be sent when the destination scheme is HTTP. 5. Enforce normal TLS certificate and hostname validation; do not introduce `verify=False`. 6. Use a strict allowlist of approved API hostnames to prevent credentials from being forwarded to unintended destinations. 7. Rotate any credentials that may previously have traversed plaintext endpoints. 8. Add automated tests and release checks that fail when packaged configuration contains plaintext service URLs or selects a development environment. 9. Minimize credential scope and lifetime so intercepted tokens cannot access unrelated API operations. ]]>
