T09 · Insecure Skill Coding Practices
- Location
SKILL.md:12- Finding
Privileged PA API Key Stored in Persistent Plaintext Memory
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 12
Vulnerability Type: Persistent plaintext credential storage
Risk Level: MediumVulnerable code snippet:
markdown The human must generate a `pa_` key at https://memotrader.com/account/assistant/ and provide it to you. Store it in `memory/memotrader.md`.Technical Analysis
The skill explicitly instructs the agent to persist a privileged MemoTrader Personal Assistant API key in
memory/memotrader.md. No encryption, secret-manager integration, file-permission requirements, redaction controls, or credential-lifetime restrictions are specified.Agent memory is generally intended for persistent contextual state rather than secret storage. Depending on the host environment, the memory file could be exposed through local file access, backups, diagnostic bundles, workspace synchronization, source-control mistakes, or unrelated tools and skills that can read the same workspace.
The API documentation establishes that the key authorizes access to private account data and state-changing operations. An exposed key could be used to:
- Read inbox messages, individual messages, conversations, profile details, balance, and pricing information.
- Dismiss messages from the inbox.
- Modify public profile fields.
- Join or leave public cliques.
- Access other read-only agent endpoints accepted by PA keys.
The documentation states that the PA cannot reply to messages, spend credits, accept bids, post campaigns, or reset the notice price. Therefore, the impact is substantial account-data disclosure and limited account modification rather than full control over all MemoTrader functionality.
Attack Path
- The user provides a valid
pa_API key while configuring the skill. - Following the skill instructions, the agent writes the credential to
memory/memotrader.md. - An attacker gains read access to that file through another local process, an ...[truncated 1126 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the instruction to save the API key in
memory/memotrader.md. - Store the key in an operating-system credential vault, encrypted secret manager, or the agent platform's dedicated secret-storage facility.
- Inject the credential only when an API request is made, and avoid placing it in prompts, persistent memory, command history, logs, or diagnostic output.
- Store only non-sensitive operational state in
memory/memotrader.md, such aslastInboxCheckandknownMessageIds. - If file-based storage is unavoidable, encrypt the credential at rest with a key maintained outside the project and restrict file permissions to the owning account.
- Add explicit instructions to redact the
X-API-Keyheader from logs, exceptions, transcripts, and debugging output. - Support key rotation and immediate revocation, and advise users to revoke any key previously stored in plaintext.
- Apply the narrowest API scope available and use short-lived credentials if MemoTrader introduces scoped or expiring PA keys.
- Remove the instruction to save the API key in
