T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:15
- Finding
- Craft API Capability Persisted in Plaintext Shell Configuration## Vulnerability Details **File Location**: `SKILL.md`, lines 15-17 **Vulnerability Type**: Plaintext storage of a sensitive API capability **Risk Level**: Medium ### Vulnerable Code Snippet ```bash 3. Set env var: `export CRAFT_API_URL='https://connect.craft.do/links/YOUR_LINK/api/v1'` Add to shell profile for persistence. ``` ### Technical Analysis The documentation directs users to place a Craft Connect API URL in a persistent shell profile. The link may function as a bearer capability: possession of the complete URL can be sufficient to invoke the associated Craft API without separate credentials. Shell profiles store values as plaintext and may be exposed through account compromise, overly permissive file permissions, backups, diagnostic archives, terminal-sharing workflows, or tools that collect shell configuration. Exporting the value also propagates it to child processes, unnecessarily increasing the number of processes that can access the credential. This finding is limited to the insecure credential-handling instruction. The actual `scripts/craft` implementation is absent from the supplied project and therefore could not be inspected. ### Attack Path 1. A user follows the setup instructions and writes the complete `CRAFT_API_URL` value into a shell profile. 2. An attacker or untrusted local process obtains read access to that profile, a backup containing it, or the environment of a process that inherited the exported variable. 3. The attacker extracts the Craft Connect URL. 4. The attacker sends requests to the Craft API using that URL as the access capability. 5. Depending on the permissions assigned to the Craft Connect link, the attacker reads or searches documents and may create, modify, or delete documents, blocks, and tasks. This path requires access to the stored profile, an inherited process environment, or another artifact containing the URL; the documentation alone does not provide remote access ...[truncated 563 chars]
- Remediation
- ## Remediation Suggestions 1. Do not recommend storing the complete Craft Connect URL directly in a shell profile. 2. Store the URL in the macOS Keychain or another dedicated secret manager and retrieve it only when the CLI runs. 3. If an environment variable is unavoidable, inject it only for the individual command rather than exporting it globally to all child processes. 4. Ensure any fallback credential file is excluded from version control and backups where appropriate, and restrict its permissions to the owning user, such as mode `0600`. 5. Document how users can revoke and rotate a Craft Connect link after suspected disclosure. 6. Advise users to grant the minimum Craft permissions and scope required for their intended operations. 7. Avoid printing the full URL in logs, error messages, shell tracing output, command history, or diagnostic reports.
