Back to skill

Security audit

Notion 技能基础版

Security checks for vulnerabilities and agentic risk

Overview

This Notion skill appears purpose-related, but it asks for Notion write access and shell execution while giving misleading privacy and credential-checking guidance.

Review before installing. Use a minimally scoped Notion integration token, share only the specific pages/databases needed, avoid vague write requests, and do not run the documented broad environment-variable check. Treat Notion page/database contents as remote data sent to Notion despite the local-only privacy claim.

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

Credential Exposure Through Broad Environment Variable Enumeration

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 176–181
Vulnerability Type: Plaintext exposure of sensitive environment variables
Risk Level: Medium

Vulnerable Code

bash
# 验证环境变量是否设置
echo "配置检查:"
env | grep -E "API|KEY|TOKEN|SECRET" | sed "s/=.*/=***/"  # Linux/macOS
# 或 PowerShell
# Get-ChildItem Env: | Where-Object {$_.Name -match "API|KEY|TOKEN"} | Format-Table

Technical Analysis

The configuration-verification instructions enumerate all environment variables whose names contain credential-related terms such as API, KEY, TOKEN, or SECRET. This is unnecessarily broad because the Skill only needs to determine whether NOTION_API_KEY is configured.

The Unix command replaces values with ***, reducing immediate disclosure risk, but still enumerates unrelated secret-bearing variable names. The PowerShell command is more severe: it passes complete environment-variable objects to Format-Table without redacting their values. Consequently, unrelated API keys and access tokens can appear in plaintext in the terminal, AI Agent context, execution logs, captured transcripts, or screenshots.

No evidence indicates that the Skill deliberately transmits these credentials to an attacker. The confirmed issue is local plaintext exposure caused by insecure verification guidance.

Attack Path

  1. A user or AI Agent follows the documented configuration-verification procedure on a system containing multiple credentials in environment variables.
  2. On PowerShell, Get-ChildItem Env: retrieves the environment-variable names and values available to the current process.
  3. Where-Object selects variables with names matching API, KEY, or TOKEN, including credentials unrelated to Notion.
  4. Format-Table renders the selected objects without masking their values.
  5. Plaintext credentials become visible in console output.
  6. Any party or system able to access the terminal, Agent transcript, execution log, screen recording, ...[truncated 777 chars]
Remediation
View remediation

Remediation Suggestions

Replace broad environment enumeration with a targeted existence check that never prints the credential value.

For Unix-like systems:

bash
if [ -n "${NOTION_API_KEY:-}" ]; then
  echo "NOTION_API_KEY is configured"
else
  echo "NOTION_API_KEY is not configured"
fi

For PowerShell:

powershell
if (Test-Path Env:NOTION_API_KEY) {
    Write-Output "NOTION_API_KEY is configured"
} else {
    Write-Output "NOTION_API_KEY is not configured"
}

Apply the following additional controls:

  1. Do not enumerate variables based on generic credential-related patterns.
  2. Never print secret values during configuration checks, including in debug mode.
  3. Avoid placing credentials in AI Agent prompts, transcripts, callback payloads, or execution logs.
  4. If diagnostic output must identify a variable, print only its exact expected name and a boolean configuration status.
  5. Document procedures for revoking and rotating credentials if they are exposed.
  6. Add an explicit warning that users must not paste terminal output containing secrets into issue reports or Agent conversations.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (7)

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The document claims all data is stored locally and not uploaded to the cloud, yet the same skill clearly operates through the Notion API and external API access. This is a materially misleading data-handling claim: users may expose sensitive content or credentials believing no remote transmission occurs, which is especially risky in an exec-capable agent skill that reads and modifies Notion content.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill description emphasizes convenience and core features but does not prominently warn that it can both execute shell commands and modify Notion pages/databases. This omission is significant because users and orchestrating agents may treat it as a passive knowledge tool, when in fact it has side effects and command-execution capability that can alter data and expose secrets through the local environment.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill describes database schema change as a PRO-only capability in one section, but elsewhere says the FREE version can modify database schema. In a skill that can drive exec-enabled actions against Notion, this ambiguity is dangerous because an agent or user may perform destructive, irreversible schema changes under the false assumption that the operation is supported and safe.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The trigger condition is overly broad and mismatched to the skill's actual Notion-focused scope, which can cause the agent to invoke this skill for unrelated requests such as generic data analysis, reporting, or visualization. In an exec-enabled skill that can mutate pages and databases, unintended invocation increases the chance of accidental data modification or disclosure.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The natural-language invocation guidance is too generic ('请帮我读取并追加内容') and does not state prerequisites, target scope, or safety constraints. Because the skill can execute commands and modify remote content, vague invocation patterns raise the risk of being triggered without clear user intent, leading to unintended writes to the wrong page or workspace.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

L248-L250 明确写明可通过环境变量切换 personal/work 配置文件,这表示该技能面向不止单一个人配置,至少包含工作账户/工作空间切换能力。与此同时,L264-L266 又将 FREE 版本定位为“仅限个人使用、不支持团队协作”,两处意图表述存在直接冲突。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The display name and summary are presented only in Chinese, and the document does not state that the skill is region-specific or offer multilingual usage guidance. This can constitute a language/locale policy issue when users are not given a language choice or informed of a justified locale restriction.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.