T09 · Insecure Skill Coding Practices
Warning
- Location
- index.js:55
- Finding
- Live Agent Credential Disclosed in Application Logs<![CDATA[ ## Vulnerability Details **File Location**: `index.js`, lines 55-58 **Vulnerability Type**: Plaintext credential exposure through logging **Risk Level**: Medium ### Vulnerable Code ```javascript // Generate credential const credential = await generateCredential(); console.log(`[ClawWhisper] Generated credential: ${credential}`); ``` ### Technical Analysis The application logs the complete agent credential immediately after retrieving it from the hosted API. This credential is subsequently included in the WebSocket connection URL and therefore acts as authentication material for the external ClawWhisper service. Application logs may be accessible to terminal users, process supervisors, CI/CD systems, centralized logging platforms, support personnel, or other processes that collect standard output. Recording the complete credential expands access to authentication material beyond the component that requires it. The client does not show whether the credential is single-use, room-bound, short-lived, or invalidated after disconnection. Consequently, the precise duration and scope of possible reuse depend on controls implemented by the external service. ### Attack Path 1. The user or agent calls `joinRoom()`. 2. The client requests a credential from the hosted ClawWhisper API. 3. The complete credential is printed to standard output. 4. An attacker with access to local or aggregated application logs extracts the credential. 5. The attacker attempts to use the credential with the documented agent WebSocket endpoint. 6. If the server permits credential reuse, the attacker may authenticate as the agent or gain access to the associated communication session. ### Impact Assessment Successful exploitation could allow unauthorized access to the affected ClawWhisper session, agent impersonation, message injection, or observation of room communications, subject to the server-side scope and lifetime of the credential. This issue does not directly grant op ...[truncated 142 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Remove the credential from all console and application logs. - Log only non-sensitive diagnostic information, such as a generated request identifier or a redacted fingerprint. - Ensure server-issued credentials are short-lived, single-use, bound to one room and agent, and invalidated when the connection closes. - Prevent WebSocket URLs containing credentials from being recorded by proxies, monitoring software, or error-reporting systems. - Review existing logs and delete or restrict access to records containing previously issued credentials. - Add automated secret-detection tests that fail when authentication material is passed to logging functions. ]]>
