T09 · Insecure Skill Coding Practices
- Location
SKILL.md:25- Finding
Bearer Token Requested Through the AI Conversation
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 25–27
Vulnerability Type: Plaintext credential exposure through conversational input
Risk Level: Mediummarkdown - **Token**: env var `$MAIMEMO_TOKEN` — obtain it from either: - App: 墨墨背单词 → 开放 API - Web: open `https://open.maimemo.com/open/api/v1/tokens/openapi`, log in to the MaiMemo account, ask the user to copy the Token and paste it back, then set it as `$MAIMEMO_TOKEN` - **Token expiry**: Tokens from the web source are valid for 7 days. If an API call indicates the token is expired/invalid (for example auth failure), tell the user to repeat the web login/copy/paste flow and update `$MAIMEMO_TOKEN`. - **Auth header**: `Authorization: Bearer $MAIMEMO_TOKEN`Technical Analysis
The skill explicitly instructs the agent to ask the user to paste a live MaiMemo bearer token into the conversation. Although the token is subsequently intended to be stored in the
MAIMEMO_TOKENenvironment variable, transmitting it through chat first exposes it to the model context and potentially to conversation history, application telemetry, debugging records, monitoring systems, or other log-retention infrastructure.A bearer token does not require additional proof of identity. Any party that obtains it can use the documented authorization header until the token expires or is revoked. The documented web-issued token remains valid for seven days, creating a meaningful exploitation window.
The credential provides access to authenticated API operations documented throughout the project, including private study-data queries and state-changing operations. No evidence indicates that the skill intentionally sends the token to an unrelated domain; the vulnerability is the insecure credential-acquisition workflow itself.
Attack Path
- A user invokes the skill without an existing
MAIMEMO_TOKENenvironment variable. - Following
SKILL.md, the agent directs the user to generate a MaiMemo Ope ...[truncated 1372 chars]
- A user invokes the skill without an existing
- Remediation
View remediation
Remediation Suggestions
- Remove the instruction asking users to paste tokens into the AI conversation.
- Require
MAIMEMO_TOKENto be configured out of band through a trusted local environment configuration, platform secret manager, or dedicated credential-entry interface that does not expose its value to the model. - Instruct the agent only to check whether the environment variable is available, never to request or display its contents.
- Ensure command output, error messages, debugging data, and telemetry redact the
Authorizationheader and token value. - Avoid shell tracing or verbose HTTP modes that could print authorization headers.
- If a token has already been pasted into a conversation, advise the user to revoke or rotate it immediately and configure the replacement through the secure channel.
- Prefer narrowly scoped and short-lived credentials if the MaiMemo platform supports them.
- Document a secure setup flow, for example: generate the token in MaiMemo, store it directly in the execution platform’s secret manager, verify only that
MAIMEMO_TOKENis present, and then invoke the API without echoing the credential.
