T09 · Insecure Skill Coding Practices
- Location
SKILL.md:219- Finding
Plaintext Persistent Storage of Account Password and Bearer Token
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 219-256
Vulnerability Type: Plaintext sensitive credential storage
Risk Level: HighVulnerable Code
text 2. If `~/.publisher/config.json` exists, read the stored username/password and log in again to refresh the token.json { "baseUrl": "https://ai-pub.pushwebly.com", "username": "alice", "password": "plain-text-password", "authorization": "Bearer <TOKEN>", "userId": 1 }text On Linux/macOS, set mode `600` after writing. On 401, refresh the token once by logging in again, then retry the failed operation once.Technical Analysis
The Skill instructs the Agent to persist both a reusable account password and an active bearer token in
~/.publisher/config.json. These credentials are stored without encryption.File mode
600limits access to the owning operating-system account, but it does not protect the credentials from malicious processes running as that user, compromised development tools, unintended backups, filesystem disclosure, or accidental copying. Persisting both the password and bearer token also increases exposure unnecessarily: either credential may be sufficient to access the publishing account.The password can be used to obtain new tokens after an existing token expires or is revoked. An unexpired bearer token can be used directly without possessing the password.
Attack Path
- The user authorizes local credential storage after logging in or registering.
- The Agent writes the username, plaintext password, and bearer token to
~/.publisher/config.json. - An attacker obtains same-user filesystem access through malware, a compromised extension, an exposed backup, or another process operating under the user's account.
- The attacker reads the configuration file.
- The attacker uses the bearer token directly or submits the stored username and password to the ...[truncated 718 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not persist the account password after authentication.
- Store credentials in the operating system's protected credential facility, such as macOS Keychain, Windows Credential Manager, or Linux Secret Service.
- Prefer short-lived access tokens backed by narrowly scoped, revocable refresh tokens.
- Store only the minimum credential material necessary for the publishing operation.
- If a file-based fallback is unavoidable:
- Encrypt credential values using a key protected by the operating system.
- Create the file atomically with restrictive permissions rather than changing permissions after creation.
- Validate file ownership and reject symbolic links before reading or writing it.
- Exclude the file from backups and diagnostic bundles where possible.
- Redact passwords and authorization headers from logs, command output, exceptions, and user-facing messages.
- Provide an explicit logout or credential-removal operation that revokes tokens and securely removes locally stored authentication data.
