T09 · Insecure Skill Coding Practices
- Location
SKILL.md:12- Finding
Plaintext Storage of a Financial API Bearer Token
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 12–26
Vulnerability Type: Plaintext credential storage and inconsistent secret handling
Risk Level: MediumVulnerable Code
markdown Required environment: - `FIREFLY_URL`: Base URL (e.g., `https://budget.example.com`) - `FIREFLY_TOKEN`: Personal Access Token (stored at `~/.firefly_token`) Get token: Profile → OAuth → Personal Access Tokens → Create new token ## API Basics ```bash TOKEN=$(cat ~/.firefly_token) BASE="$FIREFLY_URL/api/v1" curl -s "$BASE/endpoint" \ -H "Authorization: Bearer $TOKEN" \ -H "Accept: application/json" \ -H "Content-Type: application/json"text ### Technical Analysis The skill directs users to store a Firefly III personal access token in the plaintext file `~/.firefly_token` and subsequently loads it into a shell variable. It does not require restrictive file permissions, verify ownership, or reject files readable by other users. If the file is created under a permissive `umask`, other local users may be able to read it. Processes running under the same account can also retrieve the credential from the file. The token is a bearer credential, so possession is generally sufficient to authenticate without an additional secret. The instructions are also inconsistent: they describe `FIREFLY_TOKEN` as a required environment variable but read the credential from `~/.firefly_token` instead. This ambiguity can encourage unnecessary duplication of the secret across environment configuration and local files. The URL example uses HTTPS, but the instructions do not enforce an HTTPS scheme for `FIREFLY_URL`. If a user configures an unencrypted HTTP endpoint across an untrusted network, the bearer token may be exposed in transit. ### Attack Path 1. A user follows the skill instructions and stores a valid personal access token in `~/.firefly_token`. 2. The file is created with permissions that allow an un ...[truncated 1374 chars]- Remediation
View remediation
Remediation Suggestions
-
Use one clearly defined secret source. Prefer a secret manager, OS credential store, or securely injected
FIREFLY_TOKENenvironment variable instead of a persistent plaintext file. -
If file-based storage must be supported, document secure creation and permissions:
bash umask 077 printf '%s' "$FIREFLY_TOKEN" > ~/.firefly_token chmod 600 ~/.firefly_token -
Before reading the file, verify that it is owned by the current user, is a regular file rather than a symbolic link, and is not accessible by group or other users.
-
Require
FIREFLY_URLto use HTTPS, except for explicitly documented loopback-only development deployments. -
Avoid printing the token, including it in command traces, or passing it through command-line arguments that may be exposed through process listings.
-
Recommend a narrowly scoped token where Firefly III supports granular authorization.
-
Document token rotation and immediate revocation procedures for suspected exposure.
-
Update the configuration section so that it does not simultaneously describe
FIREFLY_TOKENas an environment variable and direct users to an unrelated plaintext token file.
-
