T09 · Insecure Skill Coding Practices
Error
- Location
- scripts/cwcommon.py:98
- Finding
- Hardcoded Bootstrap API Credential Enables Unauthorized Credential Issuance<![CDATA[ ## Vulnerability Details **File Location**: `scripts/cwcommon.py`, lines 98–102 **Vulnerability Type**: Hardcoded reusable credential **Risk Level**: High ### Vulnerable Code ```python respJson=apiRequest("issueapikey","dXdlZnlzcmJ2bndhbkZIRVVJVTdmd2oK Y25GR1JKV0VESmdodTQ3NnNoaAo=",{"requesterId": requesterId}) config["reqK"]=respJson[codecs.decode("ncvXrl","rot_13")] config["reqC"]=respJson[codecs.decode("ncvPerqragvny","rot_13")] ``` The supplied value decodes from Base64 into plaintext credential material. Base64 encoding does not provide confidentiality. The use of ROT13 for response-field names similarly obscures the credential-handling logic without providing a security boundary. ### Technical Analysis The Skill embeds a bootstrap credential directly in distributed source code and passes it through the `X-ApiKey` header when invoking the `issueapikey` endpoint. Any party able to access the Skill package can recover or directly reuse this value without executing the legitimate workflow. Because the credential is shared with every copy of the Skill, it cannot reliably identify or authorize an individual installation. Its exposure can enable unauthorized callers to request service credentials outside the intended user-controlled execution path. The precise privileges of credentials returned by the service are not defined in the audited files. Confirmed accessible operations include the documented Cryptowerk proof APIs; broader service privileges must not be assumed without server-side authorization details. ### Attack Path 1. An attacker obtains a copy of the publicly distributed Skill. 2. The attacker extracts the hardcoded string from `scripts/cwcommon.py`. 3. The attacker either uses the string as written or Base64-decodes it to inspect the underlying credential material. 4. The attacker sends a POST request to: `https://aiagent.cryptowerk.com/platform/API/v8/issueapikey` 5. The attacker supplies the embedded value in the `X-ApiKey` ...[truncated 841 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Immediately revoke and rotate the embedded bootstrap credential. 2. Remove all reusable credentials from source code and published Skill packages. 3. Require users to supply credentials through an operating-system credential manager, protected environment injection, or another dedicated secret-management mechanism. 4. If automatic enrollment is required, replace the shared credential with short-lived, single-use enrollment tokens bound to a specific user, installation, or authorization session. 5. Apply strict server-side scopes so issued credentials can access only the documented registration, seal retrieval, and verification APIs. 6. Enforce expiration, rate limits, issuance quotas, audit logging, and rapid revocation. 7. Add automated secret scanning to the release process and repository CI checks. 8. Remove unnecessary obfuscation such as ROT13 field names because it impedes review without protecting secrets. ]]>
