T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:18
- Finding
- Azure DevOps PAT Stored in Plaintext Configuration<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 18–35 **Vulnerability Type**: Plaintext storage of sensitive credentials **Risk Level**: Medium ### Vulnerable Code ```markdown **If values are missing from `~/.openclaw/openclaw.json`, the agent should:** 1. **ASK** the user for the missing PAT and/or organization name 2. Store them in `~/.openclaw/openclaw.json` under `skills.entries["azure-devops"]` ### Example Config ```json5 { skills: { entries: { "azure-devops": { apiKey: "YOUR_PERSONAL_ACCESS_TOKEN", // AZURE_DEVOPS_PAT env: { AZURE_DEVOPS_ORG: "YourOrganizationName" } } } } } ``` ``` ### Technical Analysis The Skill instructs the Agent to solicit an Azure DevOps Personal Access Token and persist it in `~/.openclaw/openclaw.json`. The instructions do not require encryption, integration with an operating-system credential store, restrictive file permissions, minimal token scopes, or token expiration. Although the Skill later states that the PAT must not be logged or exposed in responses, that safeguard does not protect the credential at rest. A regular configuration file may be accessible to other local users or processes, copied into backups, included in diagnostic archives, or disclosed through accidental configuration sharing. ### Attack Path 1. The Skill detects that the Azure DevOps PAT is absent from the configuration. 2. The Agent asks the user to provide a valid PAT. 3. The Agent writes the PAT into `~/.openclaw/openclaw.json` as the `apiKey` value. 4. A local process, user, backup system, diagnostic collector, or malicious program obtains read access to the configuration file. 5. The exposed token is extracted and submitted to the official Azure DevOps API. 6. The attacker performs operations permitted by the PAT until it expires or is revoked. ### Impact Assessment An attacker who obtains the PAT can act with all Azure DevOps privileges assigned to that to ...[truncated 428 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Store the PAT in an operating-system credential manager or supported secret-management service instead of a regular JSON configuration file. 2. Prefer short-lived credentials or federated authentication where the environment supports them. 3. If file-based storage is unavoidable: - Store the secret separately from general configuration. - Require owner-only permissions such as `0600`. - Verify the file owner before reading or writing it. - Exclude the file from source control, backups, logs, and diagnostic bundles. 4. Request only the minimum Azure DevOps scopes necessary for the requested operation. 5. Document token expiration and rotation procedures. 6. Never echo the token in commands, logs, error messages, or Agent responses. 7. Avoid asking users to paste credentials into conversational content when a secure secret-entry mechanism is available. ]]>
