T09 · Insecure Skill Coding Practices
- Location
SKILL.md:219- Finding
Plaintext persistence of account passwords and bearer tokens
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 219–220 and 247–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 }The instructions subsequently recommend setting file mode
600on Linux and macOS. This permission setting limits access by other local users but does not encrypt the credentials.Technical Analysis
The Skill explicitly permits a reusable account password and bearer token to be stored in plaintext in
~/.publisher/config.json. A bearer token authorizes its holder without requiring additional proof of identity, while the stored password may allow an attacker to obtain new tokens after the existing token expires.File mode
600does not protect the secrets from malicious or compromised processes running under the same user account, filesystem backups, accidental file disclosure, Agent tools with home-directory access, or a broader compromise of the user account. Storing both the password and token also unnecessarily increases the number and lifetime of reusable authentication secrets exposed by one file.Attack Path
- The user consents to local credential storage, and 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 development tool, an overly broad Agent tool, an exposed backup, or accidental disclosure.
- The attacker reads the configuration file and extracts the password or bearer token.
- The attacker submits the bearer token to the publishing APIs or uses the password with ...[truncated 838 chars]
- The user consents to local credential storage, and the Agent writes the username, plaintext password, and bearer token to
- Remediation
View remediation
Remediation Suggestions
- Do not store account passwords or bearer tokens in plaintext JSON files.
- Store reusable credentials in the operating system's protected credential facility, such as macOS Keychain, Windows Credential Manager, or a Linux Secret Service implementation.
- Prefer short-lived, narrowly scoped access tokens and revocable refresh tokens instead of retaining the account password.
- If secure credential storage is unavailable, keep the token only in process memory and require reauthentication for subsequent sessions.
- Ensure tokens have short expiration periods, server-side revocation support, and the minimum scopes required for the requested operation.
- Continue applying restrictive filesystem permissions to any non-secret configuration, but do not treat mode
600as a substitute for protected secret storage. - Provide a logout or credential-removal operation that deletes locally retained authentication material and revokes server-side sessions.
