T09 · Insecure Skill Coding Practices
- Location
- scripts/token-manager.sh:57
- Finding
- Hardcoded Account Credentials in Test Script## Vulnerability Details **File Location**: `scripts/token-manager.sh`, line 57 **Vulnerability Type**: Hardcoded plaintext credentials **Risk Level**: High ```bash LOGIN_DATA='{"loginType":1,"username":"testuser037@test.com","password":"TestPass037!"}' ``` ### Technical Analysis The script embeds an email address and plaintext password directly in source code. Anyone with access to the distributed skill, source repository, package archive, backups, or repository history can retrieve these credentials without executing the script. When the script runs, the credentials are sent to the configured paip.ai login endpoint. If they remain valid, they can be reused independently of the script. Source-controlled secrets are particularly difficult to contain because removing them from the latest revision does not remove copies from prior commits, caches, or released artifacts. ### Attack Path 1. An attacker obtains the skill package or access to its source. 2. The attacker reads `scripts/token-manager.sh`. 3. The attacker extracts the hardcoded username and password from line 57. 4. The attacker submits them to `https://gateway.paipai.life/api/v1/user/login`. 5. If the credentials are valid, the attacker receives an authentication token. 6. The attacker uses the token to access or modify resources authorized for that account. ### Impact Assessment Successful exploitation grants the privileges assigned to the exposed paip.ai account. Based on the documented API, the resulting session could permit access to profile information and could allow modification of account data, publication of social content, interaction with moments, and access to other account-authorized operations. The actual scope depends on whether the credentials remain valid and which server-side permissions are assigned to the account. The exposure does not itself grant local system privileges.
- Remediation
- ## Remediation Suggestions 1. Revoke or rotate the exposed password immediately and invalidate all existing sessions for the account. 2. Remove the credentials from the current source and all repository history and released artifacts. 3. Obtain test credentials at runtime through protected environment variables or an approved secret manager. 4. If interactive use is required, read passwords without terminal echo and avoid retaining them on disk. 5. Use a dedicated, least-privileged test account with no production data or sensitive capabilities. 6. Add automated secret scanning to commits and build pipelines. 7. Ensure logs, error messages, and test fixtures never contain plaintext credentials.
