Back to skill

Security audit

Notion API 2026 01 15

Security checks for vulnerabilities and agentic risk

Overview

This Notion API skill is mostly purpose-aligned, but it should be reviewed because it stores a long-lived Notion token insecurely and includes powerful content-changing examples without strong safeguards.

Review before installing. Use a least-privilege Notion integration, share only the pages or data sources needed, store the token in a keychain or at least with owner-only permissions, and require explicit confirmation before move, lock, update, or erase-content operations.

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:14
Finding

Notion API Token Stored Without Restrictive File Permissions

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 14–19
Vulnerability Type: Plaintext credential storage with potentially permissive filesystem permissions
Risk Level: Medium

bash
1. Create an integration at https://notion.so/my-integrations
2. Copy the API key (starts with `ntn_` or `secret_`)
3. Store it:
```bash
mkdir -p ~/.config/notion
echo "ntn_your_key_here" > ~/.config/notion/api_key

text

### Technical Analysis

The setup instructions place a Notion bearer token in a plaintext file without explicitly restricting permissions on either the configuration directory or the token file. Their effective permissions therefore depend on the user's current `umask` and any preexisting directory permissions.

On a multi-user system with an insufficiently restrictive configuration, another local account or compromised process may be able to read the token. A Notion API token is a reusable bearer credential: possession is sufficient to authenticate as the integration without an additional password or challenge.

The issue does not expose a real hardcoded credential in the project—the displayed token is a placeholder—but following the documented command with a real token can create insecure credential storage.

### Attack Path

1. A user follows the documented setup procedure and replaces the placeholder with a valid Notion integration token.
2. The shell creates `~/.config/notion/api_key` using permissions derived from the user's `umask`; the instructions do not enforce owner-only access.
3. Another local user or a process operating under a different security context reads the file where filesystem permissions permit it.
4. The attacker copies the bearer token.
5. The attacker submits authenticated requests to `https://api.notion.com/v1/` using `Authorization: Bearer <stolen-token>`.
6. The attacker accesses or modifies resources shared with the compromised integration, subject to that int
...[truncated 599 chars]
Remediation
View remediation

Remediation Suggestions

Enforce owner-only permissions when creating both the directory and credential file:

bash
install -d -m 700 "$HOME/.config/notion"
(
  umask 077
  printf '%s\n' "ntn_your_key_here" > "$HOME/.config/notion/api_key"
)
chmod 600 "$HOME/.config/notion/api_key"

Additional hardening measures:

  • Prefer an operating-system credential manager or dedicated secret-management service over a plaintext file.
  • Do not place the token directly in shell command history. Read it silently from the terminal or provision it through a secure secret channel.
  • Verify existing permissions with stat and reject use if the file is accessible by group or other users.
  • Keep the integration least-privileged and share only required Notion pages or data sources with it.
  • Rotate the token immediately if unauthorized filesystem access is suspected.
  • Ensure credential files are excluded from source control, backups with broad readership, logs, and diagnostic bundles.
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 (15)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
Here is the complete `SKILL.md` file updated for the January 15, 2026 API state.

Session Persistence

Medium
Category
Rogue Agent
Confidence
89% confidence
Finding

The skill instructs users to persist a long-lived API key in plaintext under ~/.config/notion/api_key. Storing bearer tokens unencrypted on disk increases the risk of credential theft by other local users, malware, backups, shell history mistakes, or accidental disclosure, especially because the token grants API access to shared Notion resources.

Content

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

Setup

  1. Create an integration at https://notion.so/my-integrations
  2. Copy the API key (starts with ntn_ or secret_)
  3. Store it:
bash

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

bash
NOTION_KEY=$(cat ~/.config/notion/api_key)
curl -X GET "[https://api.notion.com/v1/](https://api.notion.com/v1/)..." \
  -H "Authorization: Bearer $NOTION_KEY" \
  -H "Notion-Version: 2025-09-03" \
  -H "Content-Type: application/json"

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

bash
NOTION_KEY=$(cat ~/.config/notion/api_key)
curl -X GET "[https://api.notion.com/v1/](https://api.notion.com/v1/)..." \
  -H "Authorization: Bearer $NOTION_KEY" \
  -H "Notion-Version: 2025-09-03" \
  -H "Content-Type: application/json"

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

bash
NOTION_KEY=$(cat ~/.config/notion/api_key)
curl -X GET "[https://api.notion.com/v1/](https://api.notion.com/v1/)..." \
  -H "Authorization: Bearer $NOTION_KEY" \
  -H "Notion-Version: 2025-09-03" \
  -H "Content-Type: application/json"

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

bash
NOTION_KEY=$(cat ~/.config/notion/api_key)
curl -X GET "[https://api.notion.com/v1/](https://api.notion.com/v1/)..." \
  -H "Authorization: Bearer $NOTION_KEY" \
  -H "Notion-Version: 2025-09-03" \
  -H "Content-Type: application/json"

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

bash
NOTION_KEY=$(cat ~/.config/notion/api_key)
curl -X GET "[https://api.notion.com/v1/](https://api.notion.com/v1/)..." \
  -H "Authorization: Bearer $NOTION_KEY" \
  -H "Notion-Version: 2025-09-03" \
  -H "Content-Type: application/json"

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

bash
NOTION_KEY=$(cat ~/.config/notion/api_key)
curl -X GET "[https://api.notion.com/v1/](https://api.notion.com/v1/)..." \
  -H "Authorization: Bearer $NOTION_KEY" \
  -H "Notion-Version: 2025-09-03" \
  -H "Content-Type: application/json"

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

bash
NOTION_KEY=$(cat ~/.config/notion/api_key)
curl -X GET "[https://api.notion.com/v1/](https://api.notion.com/v1/)..." \
  -H "Authorization: Bearer $NOTION_KEY" \
  -H "Notion-Version: 2025-09-03" \
  -H "Content-Type: application/json"

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

bash
NOTION_KEY=$(cat ~/.config/notion/api_key)
curl -X GET "[https://api.notion.com/v1/](https://api.notion.com/v1/)..." \
  -H "Authorization: Bearer $NOTION_KEY" \
  -H "Notion-Version: 2025-09-03" \
  -H "Content-Type: application/json"

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

bash
NOTION_KEY=$(cat ~/.config/notion/api_key)
curl -X GET "[https://api.notion.com/v1/](https://api.notion.com/v1/)..." \
  -H "Authorization: Bearer $NOTION_KEY" \
  -H "Notion-Version: 2025-09-03" \
  -H "Content-Type: application/json"

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

bash
NOTION_KEY=$(cat ~/.config/notion/api_key)
curl -X GET "[https://api.notion.com/v1/](https://api.notion.com/v1/)..." \
  -H "Authorization: Bearer $NOTION_KEY" \
  -H "Notion-Version: 2025-09-03" \
  -H "Content-Type: application/json"

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

bash
NOTION_KEY=$(cat ~/.config/notion/api_key)
curl -X GET "[https://api.notion.com/v1/](https://api.notion.com/v1/)..." \
  -H "Authorization: Bearer $NOTION_KEY" \
  -H "Notion-Version: 2025-09-03" \
  -H "Content-Type: application/json"

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

bash
NOTION_KEY=$(cat ~/.config/notion/api_key)
curl -X GET "[https://api.notion.com/v1/](https://api.notion.com/v1/)..." \
  -H "Authorization: Bearer $NOTION_KEY" \
  -H "Notion-Version: 2025-09-03" \
  -H "Content-Type: application/json"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill documents an operation that explicitly sets "erase_content": true when applying a template to an existing page, but it does not provide a strong warning, confirmation step, backup guidance, or safer alternative. In a skill intended for automation, this can lead to accidental destructive changes and irreversible data loss if a user or downstream agent follows the example blindly.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.