T09 · Insecure Skill Coding Practices
- Location
SKILL.md:18- Finding
Notion API Token Stored Without Explicitly Restrictive File Permissions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 18-19
Vulnerability Type: Plaintext sensitive credential stored without enforced access controls
Risk Level: MediumVulnerable Code:
bash mkdir -p ~/.config/notion echo "ntn_your_key_here" > ~/.config/notion/api_keyTechnical Analysis
The setup instructions store a Notion API bearer token in a plaintext file but do not enforce restrictive permissions on either the configuration directory or the token file. The resulting permissions depend on the user's current
umaskand any pre-existing directory configuration.In an environment with a permissive
umask, shared home directory permissions, or an already accessible~/.config/notiondirectory, another local user or process may be able to read the token. Because the token is subsequently used as an HTTPAuthorization: Bearercredential, possession of it is sufficient to authenticate as the Notion integration.Attack Path
- A victim follows the documented setup instructions and writes a valid Notion integration token to
~/.config/notion/api_key. - The victim's environment applies permissive permissions to the directory or file because the instructions do not set an explicit mode.
- An untrusted local user or process reads the plaintext token file.
- The attacker submits requests to
https://api.notion.com/v1/with the stolen token in theAuthorization: Bearerheader. - The attacker reads or modifies resources shared with the compromised integration, subject to its configured Notion capabilities.
Impact Assessment
Successful exploitation exposes the privileges granted to the Notion integration. Depending on its capabilities and the resources shared with it, an attacker may be able to read sensitive pages and database records, create content, alter page properties, append blocks, or otherwise modify accessible workspace data.
The compromise is limited to resou ...[truncated 242 chars]
- A victim follows the documented setup instructions and writes a valid Notion integration token to
- Remediation
View remediation
Remediation Suggestions
Enforce owner-only permissions when creating the credential directory and file:
bash install -d -m 700 ~/.config/notion (umask 077; printf '%s\n' "$NOTION_API_KEY" > ~/.config/notion/api_key) chmod 600 ~/.config/notion/api_keyPrefer obtaining the credential from the declared
NOTION_API_KEYenvironment variable or a platform-supported secret manager rather than persisting it in plaintext. The documentation should also advise users to:- Avoid passing the secret directly as a command-line argument.
- Verify that the credential file is not included in backups, logs, or source control.
- Grant the Notion integration only the minimum required capabilities and page access.
- Rotate the token immediately if local disclosure is suspected.
