Back to skill

Security audit

Notion

Security checks for vulnerabilities and agentic risk

Overview

This is a straightforward Notion API helper skill, but users should protect the Notion token and be careful with commands that create or update workspace content.

Before installing, treat the Notion API key as a secret: store it with owner-only permissions, avoid exposing it in logs or screenshots, and grant the Notion integration access only to pages or data sources it needs. Run POST and PATCH examples only when you intend to create or change live Notion content, preferably testing on non-production pages first.

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## Vulnerability Details **File Location**: `SKILL.md`, lines 14–15 **Vulnerability Type**: Insecure plaintext credential storage **Risk Level**: Medium **Vulnerable Code**: ```bash mkdir -p ~/.config/notion echo "ntn_your_key_here" > ~/.config/notion/api_key ``` ### Technical Analysis The documented setup writes a Notion bearer token to a plaintext file without explicitly restricting the permissions of either the configuration directory or the credential file. The resulting permissions depend on the user's current `umask` and any permissions already assigned to `~/.config/notion`. On a multi-user system with permissive settings, another local account or compromised process may be able to read the token. Because subsequent API examples use this file as an authentication source, possession of its contents is sufficient to impersonate the Notion integration. ### Attack Path 1. A user follows the documented setup and stores a valid Notion API token in `~/.config/notion/api_key`. 2. The user's `umask` or pre-existing directory permissions leave the credential file accessible to another local principal. 3. A local attacker or compromised process reads the token from the file. 4. The attacker supplies the token in an `Authorization: Bearer` header to `https://api.notion.com`. 5. The attacker reads or modifies Notion resources shared with the integration, subject to its configured capabilities. ### Impact Assessment Successful exploitation exposes the privileges granted to the Notion integration. Depending on its capabilities and shared resources, an attacker may search, read, create, or update Notion pages, data sources, properties, and blocks. The scope is limited to content accessible to the integration; this does not inherently grant broader operating-system privileges.
Remediation
## Remediation Suggestions Create the configuration directory and credential file with explicit owner-only permissions: ```bash install -d -m 700 ~/.config/notion umask 077 printf '%s\n' "ntn_your_key_here" > ~/.config/notion/api_key chmod 600 ~/.config/notion/api_key ``` Prefer an operating-system credential store or secrets manager instead of a plaintext file where practical. Grant the integration only the capabilities it requires, share only necessary Notion resources with it, avoid printing the token in logs or shell traces, and rotate the token immediately if unauthorized access is suspected.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (2)

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The setup instructions direct users to store a live Notion API key in plaintext under ~/.config/notion/api_key and immediately use it in shell commands, but they do not warn that the token is sensitive, grants access to shared Notion content, and must not be exposed in logs, screenshots, repositories, or multi-user systems. In a skill file intended for operational use, omission of credential-handling guidance increases the risk of accidental disclosure or insecure storage practices.

Missing User Warnings

Medium
Confidence
86% confidence
Finding
The skill documents multiple state-changing operations such as creating pages, creating data sources, updating page properties, and appending blocks, but does not clearly warn users that these requests will modify or create persistent content in their Notion workspace. In an agent-skill context, lack of a mutation warning can lead to unintended data changes, especially if a user or automated agent runs example commands against production content.

Static analysis

No suspicious patterns detected.