Back to skill

Security audit

Notion Md

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward Notion Markdown helper, but users should handle the Notion API key carefully and understand that create and append commands write to Notion.

Use a Notion integration token with the smallest required permissions and share only the target pages with it. Prefer an environment variable or secret manager; if using ~/.config/notion/api_key, restrict permissions to the user. Run --dry-run before create or append when working with important workspace content.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:40
Finding

Notion API Key Stored in a Potentially World-Readable Plaintext File

Content
View full analysis
~/.config/notion/api_key ``` ### Technical Analysis The documented setup procedure writes the Notion API key to a plaintext file without explicitly restricting either the directory or file permissions. Their resulting permissions depend on the user's current `umask` and any pre-existing filesystem permissions. For example, a common `umask` of `022` can cause the directory and file to be created with permissions equivalent to `0755` and `0644`, respectively. On a multi-user system, this may allow other local accounts or processes to read the credential. The instructions also do not address secure replacement, deletion, or rotation of the stored token. Exploitation requires local filesystem access under an account permitted to traverse the user's home directory and read the resulting file. This is not evidence that the project intentionally transmits or misuses credentials. ### Attack Path 1. A user follows the documented configuration instructions. 2. The shell creates `~/.config/notion` and `~/.config/notion/api_key` using permissions derived from the current `umask`. 3. Under permissive permissions, another local user or compromised process reads the API key: ```bash cat /home/victim/.config/notion/api_key ``` 4. The attacker uses the recovered token to authenticate to the Notion API. 5. The attacker accesses or modifies resources that the associated Notion integration is authorized to use. ### Impact Assessment Successful exploitation exposes the privileges assigned to the compromised Notion integration. Depending on its configured capabilities and shared resources, an attacker may be able to read, create, update, or delete Notion pages and databases available to that integration. The compromise does not i ...[truncated 244 chars]
Remediation
View remediation
~/.config/notion/api_key chmod 600 ~/.config/notion/api_key ``` Additional hardening measures: - Prefer an operating-system credential manager or dedicated secrets-management service over a plaintext file. - If environment-variable configuration is supported, warn users not to place the token in shell history, committed environment files, logs, or command-line arguments. - Validate the permissions of an existing configuration directory and key file before use, and reject files readable by group or other users. - Grant the Notion integration only the capabilities and page access required for its intended operation. - Document token revocation and rotation procedures for suspected exposure. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documented create and append commands cause real writes to a Notion workspace, but the skill does not clearly warn users that executing them will create or modify remote content. In an agent setting, this omission can lead to unintended data creation or alteration in a connected workspace, especially when users expect a local-format conversion tool rather than one with side effects.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 31)May include surrounding context.

md
### 1. Get Notion API Key

1. Go to https://www.notion.so/my-integrations
2. Create new integration
3. Copy the API key (starts with `ntn_`)

### 2. Configure API Key

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · dist/SKILL.md (reported line 31)May include surrounding context.

md
### 1. Get Notion API Key

1. Go to https://www.notion.so/my-integrations
2. Create new integration
3. Copy the API key (starts with `ntn_`)

### 2. Configure API Key

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill documentation instructs users to place a live Notion API key directly in a shell export command and alternatively write it to a plaintext file under ~/.config/notion/api_key, without any warning about shell history, process environment exposure, or file-permission hardening. This can lead to credential disclosure to other local users, backups, history files, logs, or tooling that captures environment variables.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.