Back to skill

Security audit

Notion API Integration

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed Notion API helper that uses a user-provided Notion token and local notes, with no hidden executable behavior found.

Install only if you are comfortable giving the agent access to the Notion pages connected to your integration and letting it keep local operational notes under ~/Clawic/data. Use a least-privilege Notion integration, keep write_mode at confirm-writes or dry-run for sensitive work, and grant comment, user-email, update, or insert capabilities only when needed.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
Findings (51)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
4. **Every list endpoint is paginated; loop or lose data.** `page_size` maxes at 100. Loop while `has_more`, passing `next_cursor`. Budget it up front: a 4,000-row data source is 40 requests, ≈14s at 3 requests/second — a number you state before running, not discover after (`pagination.md`).
5. **Pace by design, retry only the exceptions.** The limit is ~3 requests per second per integration, averaged, with short bursts tolerated; a 429 carries `Retry-After` in seconds. Time = total requests ÷ `rate_limit_rps`. Writes are one request per page: 5,000 pages ≈ 28 minutes at 3/s *before* retries. The limit is integration-wide, so your cron job and your migration share it (`bulk.md`).
6. **Writes are per-object and never transactional.** There is no batch page endpoint; a job that dies halfway leaves half the pages. Every bulk write checkpoints its cursor and appends its id mapping as it goes, so the rerun resumes instead of duplicating. Idempotency = store the external id in a Notion property and filter on it before creating (`bulk.md`).
7. **Destructive calls state their blast radius first.** `archived: true` (`in_trash` in newer versions) sends a page to the trash, recoverable by the user; `DELETE /v1/blocks/{id}` removes content; removing a `select` option strips it from every page that had it, silently and irreversibly. Emit the affected count before the call, and honour `write_mode`.
8. **The page object is a summary, not the page.** Content lives in blocks, fetched separately and recursively via `has_children`. Relation, rollup and people properties are capped at 25 entries inside a page object — the rest needs `GET /v1/pages/{page_id}/properties/{property_id}`, itself paginated. Code that treats a page retrieve as "the whole page" drops exactly the biggest records (`properties.md`, `blocks.md`).

## Failure Signatures

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
| | Internal | Public (OAuth) |
|---|---|---|
| Who uses it | One workspace, the one that created it | Any workspace that installs it |
| Credential | A long-lived token from the integration settings page | An access token per workspace, obtained by authorization code exchange |
| Access granted by | A workspace member connecting pages to it | The user picking pages during the OAuth consent screen |
| Right choice for | Scripts, migrations, internal automation — almost everything | A product other people install |

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · auth.md (reported line 14)May include surrounding context.

md
| | Internal | Public (OAuth) |
|---|---|---|
| Who uses it | One workspace, the one that created it | Any workspace that installs it |
| Credential | A long-lived token from the integration settings page | An access token per workspace, obtained by authorization code exchange |
| Access granted by | A workspace member connecting pages to it | The user picking pages during the OAuth consent screen |
| Right choice for | Scripts, migrations, internal automation — almost everything | A product other people install |

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · auth.md (reported line 75)May include surrounding context.

md
| | Internal | Public (OAuth) |
|---|---|---|
| Who uses it | One workspace, the one that created it | Any workspace that installs it |
| Credential | A long-lived token from the integration settings page | An access token per workspace, obtained by authorization code exchange |
| Access granted by | A workspace member connecting pages to it | The user picking pages during the OAuth consent screen |
| Right choice for | Scripts, migrations, internal automation — almost everything | A product other people install |

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 · blocks.md (reported line 10)May include surrounding context.

Read One Level

bash
curl 'https://api.notion.com/v1/blocks/BLOCK_OR_PAGE_ID/children?page_size=100' \
  -H "Authorization: Bearer $NOTION_API_KEY" \
  -H "Notion-Version: 2022-06-28"

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 · blocks.md (reported line 91)May include surrounding context.

Update a Block

bash
curl -X PATCH 'https://api.notion.com/v1/blocks/BLOCK_ID' \
  -H "Authorization: Bearer $NOTION_API_KEY" \
  -H "Notion-Version: 2022-06-28" \
  -H "Content-Type: application/json" \

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 · comments.md (reported line 8)May include surrounding context.

Read

bash
curl 'https://api.notion.com/v1/comments?block_id=PAGE_OR_BLOCK_ID&page_size=100' \
  -H "Authorization: Bearer $NOTION_API_KEY" \
  -H "Notion-Version: 2022-06-28"

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 · databases.md (reported line 12)May include surrounding context.

Read the Schema First

bash
curl 'https://api.notion.com/v1/databases/DATABASE_ID' \
  -H "Authorization: Bearer $NOTION_API_KEY" \
  -H "Notion-Version: 2022-06-28"

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 · databases.md (reported line 82)May include surrounding context.

Changing a Schema

bash
curl -X PATCH 'https://api.notion.com/v1/databases/DATABASE_ID' \
  -H "Authorization: Bearer $NOTION_API_KEY" \
  -H "Notion-Version: 2022-06-28" \
  -H "Content-Type: application/json" \

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · databases.md (reported line 90)May include surrounding context.

text

- The PATCH is a merge over the properties you name; untouched properties stay. It is not a replace, which is why sending a full schema you built from a stale read is how options get lost.
- **Sending an option list replaces that property's option list.** Any option missing from your payload is removed from the schema and stripped from every page that had it — no confirmation, no undo, no record of which pages changed. Read the current options, add to them, send the union.
- Rename a property: `{"properties": {"Old Name": {"name": "New Name"}}}`. Delete one: `{"properties": {"Old Name": null}}` — and deleting a property deletes its values everywhere.
- Under `write_mode: confirm-writes`, every schema change ships with the count of rows that hold a value for the affected property, obtained by a query before the PATCH.

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 · memory-template.md (reported line 43)May include surrounding context.

md
Everything except schemas, artifacts, runs and mappings begins inside `memory.md`. Splitting is a procedure, not a suggestion:

1. Before appending to a section, count its entries.
2. If the append would take it past **~15 entries or ~40 lines of real content** — scaffolding, headings and comments do not count — then, in the same turn: create the new file in `~/Clawic/data/notion-api-integration/`, move the whole section into it, **delete the section from `memory.md`**, add its line to `## Boxes`, and append the new entry to the new file.
3. Keep the headings identical on both sides of the move, so the split is a copy-paste and never a rewrite.
4. Never leave a copy behind. If the same data ever appears in both places, the extracted file wins and the `memory.md` copy is deleted.

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 · pages.md (reported line 10)May include surrounding context.

Retrieve

bash
curl 'https://api.notion.com/v1/pages/PAGE_ID' \
  -H "Authorization: Bearer $NOTION_API_KEY" \
  -H "Notion-Version: 2022-06-28"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The instruction directs the agent to modify local schema and memory files in the same turn based on API observations, without requiring user confirmation or clarifying that local state will be changed. This creates an unauthorized local side effect risk: a user asking for API debugging could inadvertently trigger persistent edits to files outside the immediate task scope, including corruption of local documentation or memory stores.

Content

No source excerpt is available for this finding.

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 209)May include surrounding context.

The Call

bash
curl -X POST 'https://api.notion.com/v1/search' \
  -H "Authorization: Bearer $NOTION_API_KEY" \
  -H "Notion-Version: 2022-06-28" \
  -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 · auth.md (reported line 29)May include surrounding context.

The Call

bash
curl -X POST 'https://api.notion.com/v1/search' \
  -H "Authorization: Bearer $NOTION_API_KEY" \
  -H "Notion-Version: 2022-06-28" \
  -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 · blocks.md (reported line 10)May include surrounding context.

The Call

bash
curl -X POST 'https://api.notion.com/v1/search' \
  -H "Authorization: Bearer $NOTION_API_KEY" \
  -H "Notion-Version: 2022-06-28" \
  -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 · blocks.md (reported line 32)May include surrounding context.

The Call

bash
curl -X POST 'https://api.notion.com/v1/search' \
  -H "Authorization: Bearer $NOTION_API_KEY" \
  -H "Notion-Version: 2022-06-28" \
  -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 · blocks.md (reported line 91)May include surrounding context.

The Call

bash
curl -X POST 'https://api.notion.com/v1/search' \
  -H "Authorization: Bearer $NOTION_API_KEY" \
  -H "Notion-Version: 2022-06-28" \
  -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 · blocks.md (reported line 105)May include surrounding context.

The Call

bash
curl -X POST 'https://api.notion.com/v1/search' \
  -H "Authorization: Bearer $NOTION_API_KEY" \
  -H "Notion-Version: 2022-06-28" \
  -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 · comments.md (reported line 8)May include surrounding context.

The Call

bash
curl -X POST 'https://api.notion.com/v1/search' \
  -H "Authorization: Bearer $NOTION_API_KEY" \
  -H "Notion-Version: 2022-06-28" \
  -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 · comments.md (reported line 22)May include surrounding context.

The Call

bash
curl -X POST 'https://api.notion.com/v1/search' \
  -H "Authorization: Bearer $NOTION_API_KEY" \
  -H "Notion-Version: 2022-06-28" \
  -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 · comments.md (reported line 34)May include surrounding context.

The Call

bash
curl -X POST 'https://api.notion.com/v1/search' \
  -H "Authorization: Bearer $NOTION_API_KEY" \
  -H "Notion-Version: 2022-06-28" \
  -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 · data-sources.md (reported line 35)May include surrounding context.

The Call

bash
curl -X POST 'https://api.notion.com/v1/search' \
  -H "Authorization: Bearer $NOTION_API_KEY" \
  -H "Notion-Version: 2022-06-28" \
  -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 · databases.md (reported line 12)May include surrounding context.

The Call

bash
curl -X POST 'https://api.notion.com/v1/search' \
  -H "Authorization: Bearer $NOTION_API_KEY" \
  -H "Notion-Version: 2022-06-28" \
  -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 · databases.md (reported line 22)May include surrounding context.

The Call

bash
curl -X POST 'https://api.notion.com/v1/search' \
  -H "Authorization: Bearer $NOTION_API_KEY" \
  -H "Notion-Version: 2022-06-28" \
  -H "Content-Type: application/json" \

Static analysis

No suspicious patterns detected.