T09 · Insecure Skill Coding Practices
- Location
SKILL.md:18- Finding
Partial Notion API Key Disclosure in Configuration Check
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 18–21
Vulnerability Type: Credential information disclosure
Risk Level: MediumVulnerable Code
bash echo ${NOTION_API_KEY:0:8}...Technical Analysis
The configuration check prints the first eight characters of
NOTION_API_KEY. Because an AI agent may execute this command through a shell tool, the resulting credential prefix can be stored in tool output, terminal logs, execution telemetry, or conversation history.This disclosure is unnecessary because the workflow only needs to determine whether the variable is configured. It also conflicts with the subsequent instruction that the API key must not be exposed through chat logs.
The disclosed prefix alone does not provide authenticated Notion access, but it reveals credential material that should remain secret and may assist credential identification or correlation if combined with information from another leak.
Attack Path
- A user invokes the Skill to archive a WeChat article.
- The agent follows the mandatory configuration check in
SKILL.md. - The shell expands
NOTION_API_KEYand prints its first eight characters. - The output is captured in agent tool results, terminal logs, telemetry, or conversation records.
- A party with access to those records obtains part of the Notion credential and can correlate it with other leaked or discovered credential material.
Impact Assessment
This issue does not directly disclose the complete token and does not independently grant Notion API access. Its scope is limited to partial credential exposure. However, it unnecessarily weakens secret confidentiality and increases the impact of other information-disclosure incidents.
- Remediation
View remediation
Remediation Suggestions
Replace the value-printing check with a presence-only test:
bash if [ -n "$NOTION_API_KEY" ]; then echo "Notion API key is configured." else echo "Notion API key is missing." fiAdditional hardening measures:
- Never print, log, truncate, hash, or otherwise expose any portion of the API key.
- Ensure errors from Notion requests do not include authorization headers.
- Preserve the existing instruction that users must configure the key through the secret-management mechanism rather than sending it in chat.
- Redact known token formats such as
ntn_...from agent tool output and execution logs where supported.
