T09 · Insecure Skill Coding Practices
- Location
- skills/smyx_common/scripts/config-dev.yaml:1
- Finding
- Authentication Credentials and User Media Are Transmitted over Plaintext HTTP<![CDATA[ ## Vulnerability Details **File Location**: `skills/smyx_common/scripts/config.yaml:3-15`, `skills/smyx_common/scripts/config-dev.yaml:1-6`, `skills/smyx_common/scripts/util.py:610-646` **Vulnerability Type**: Plaintext transmission of sensitive information **Risk Level**: High ### Vulnerable Code ```yaml # skills/smyx_common/scripts/config.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 ``` ```yaml # skills/smyx_common/scripts/config-dev.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 ``` ```python # skills/smyx_common/scripts/util.py headers.setdefault("X-Access-Token", ApiEnum.TOKEN) headers.setdefault("X-Api-Key", ApiEnum.API_SECRET_KEY) headers.setdefault("Authorization", ApiEnum.OPEN_TOKEN) data = data or {} params = params or {} options = options or {} ConstantEnum.CURRENT__TENTANT_CODE and data.setdefault( 'tenantCode', ConstantEnum.CURRENT__TENTANT_CODE ) ConstantEnum.DEFAULT__SKILL_HUB_NAME and data.setdefault( 'skillHubName', ConstantEnum.DEFAULT__SKILL_HUB_NAME ) ConstantEnum.DEFAULT__SKILL_PLATFORM_NAME and data.setdefault( 'skillPlatform', ConstantEnum.DEFAULT__SKILL_PLATFORM_NAME ) if current__user_name: data.setdefault('pnaUserName', current__user_name) response = requests.request( method, url, *args, json=data, params=params, headers=headers, timeout=int(timeout), **argss ) ``` ### Technical ...[truncated 2435 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Change the distributed default environment from `dev` to a production configuration using HTTPS exclusively. 2. Remove private development endpoints from production Skill packages. 3. Reject API base URLs that do not use `https://`; do not merely warn and continue. 4. Apply an explicit allowlist of trusted API hosts before attaching authentication headers. 5. Keep TLS certificate verification enabled and use a controlled CA bundle if private infrastructure requires it. 6. Separate development settings from deployable artifacts and load them only through an explicit, local developer opt-in. 7. Rotate all tokens that may have been sent through the plaintext endpoints. 8. Update the privacy documentation so that it accurately reflects runtime behavior. 9. Add automated tests that fail when an active endpoint uses HTTP or when credentials would be attached to an unapproved host. ]]>
