T09 · Insecure Skill Coding Practices
Error
- Location
- config/config.yaml:5
- Finding
- Hard-coded cloud API and privileged SSH credentials<![CDATA[ ## Vulnerability Details **File Location**: `config/config.yaml:5-19` **Vulnerability Type**: Hard-coded secrets and excessive privileges **Risk Level**: Critical ### Vulnerable Code ```yaml access_key_id: "LTAI5t9CE8Dp4KrpyEBQCkLq" access_key_secret: "m6yMqoSMwt8UaiMZROjD3iVVUrlHn1" region_id: "cn-hangzhou" # Analysis time range time_range: "last_1d" # Data aggregation granularity granularity: "hourly" # SSH configuration ssh_host: "8.136.137.42" ssh_user: "root" ssh_password: "Aliyun2026@!" ``` ### Technical Analysis The distributed configuration contains a reusable Alibaba Cloud access key and password-based root credentials for a public IP address. Anyone able to read the project files can recover these secrets without authentication. Bundling root credentials violates least-privilege requirements because the analysis only needs read-only YARN status information. It also conflicts with the Skill documentation, which recommends placeholders, file permissions of `0600`, and read-only accounts. No file-permission enforcement or external secret-management mechanism is implemented. The audit cannot confirm whether the credentials remain active. Nevertheless, their plaintext inclusion constitutes credential disclosure and requires immediate incident response. ### Attack Path 1. An attacker obtains the Skill package, source archive, deployment image, backup, or repository history. 2. The attacker reads `config/config.yaml` and extracts the cloud access key, root password, username, and public SSH address. 3. If the credentials remain active and network access is available, the attacker attempts authentication against the Alibaba Cloud API and SSH host. 4. Successful SSH authentication grants a root shell. Successful cloud authentication grants whatever permissions are attached to the exposed access key. 5. The attacker can then access resources, collect data, alter systems, or move laterally within the limits of the compromised accounts. ### ...[truncated 500 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Revoke and rotate the exposed Alibaba Cloud access key and SSH password immediately. 2. Review cloud audit logs and SSH authentication logs for unauthorized use. 3. Remove all secrets from the current source tree, version-control history, build artifacts, and backups where feasible. 4. Obtain secrets at runtime from a managed secret store, protected environment variables, or workload identity. 5. Replace the root account with a dedicated non-root account authorized only to run the required read-only YARN commands. 6. Replace password authentication with a passphrase-protected SSH key or short-lived SSH certificate. 7. Apply a narrowly scoped read-only policy to the cloud identity and prefer short-lived role credentials. 8. Enforce restrictive permissions such as `0600` for any local secret-bearing configuration. 9. Add secret scanning to commits and release pipelines to prevent recurrence. ]]>
