T05 · Unauthorized Access and Privilege Escalation
Warning
- Location
- SKILL.md:6
- Finding
- Unnecessary Exposure of a Privileged HubSpot Access Token<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:6-10` **Vulnerability Type**: Violation of least privilege through an unnecessary credential requirement **Risk Level**: Medium ### Vulnerable Code ```yaml metadata: openclaw: requires: env: - HUBSPOT_ACCESS_TOKEN primaryCredential: HUBSPOT_ACCESS_TOKEN credentialNotes: "Required for HubSpot API access to configure scoring properties and workflows. For Salesforce, set SALESFORCE_ACCESS_TOKEN instead." ``` ### Technical Analysis The skill declares `HUBSPOT_ACCESS_TOKEN` as a required environment variable and its primary credential. However, the audited project does not read this environment variable, invoke the HubSpot API, or perform any network communication. Its executable functionality only processes local CSV and JSON files. Injecting a privileged CRM credential into an execution environment when it is not required violates the principle of least privilege. Although the current script contains no mechanism that transmits or otherwise abuses the token, exposing it to the skill environment unnecessarily expands the credential's attack surface. A future malicious modification, compromised dependency, diagnostic dump, or other process sharing the environment could potentially read it. ### Attack Path 1. An operator activates the skill. 2. The runtime injects `HUBSPOT_ACCESS_TOKEN` because the skill metadata declares it as required. 3. The token becomes available in the skill's process environment despite no current functionality needing it. 4. If the skill, one of its dependencies, or another process with access to that environment is subsequently compromised, the token can be read. 5. The attacker can then use the token against HubSpot APIs within the permissions granted to that token. The audited version does not contain the final token-reading or exfiltration step, so exploitation requires an additional compromise or malicious modification. ### Impact Assessme ...[truncated 433 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove `HUBSPOT_ACCESS_TOKEN` from `requires.env` and remove `primaryCredential` from this instruction-only skill. 2. Separate local scoring functionality from any future HubSpot API integration. 3. If API functionality is added later, request credentials only when the API operation is explicitly invoked. 4. Create a dedicated HubSpot private application with only the minimum scopes needed for the requested operation. 5. Avoid exposing tokens to subprocesses, logs, generated reports, exception messages, or unrelated dependencies. 6. Document token rotation and revocation procedures and prefer short-lived credentials where supported. ]]>
