跳转到正文
报告库
用途分类 / 其他用途

Notion API Skill 安全审计

作者说它能做什么(原文)

>

第三方安全检查结论

发现安全风险

已检查文件
5
发现的风险
1
会不会运行危险命令?检查是否下载程序后直接运行、让他人远程控制电脑,或藏起要运行的命令。未发现风险
会不会泄露文件和密钥?检查是否发送含密码或密钥的文件,以及代码里是否直接写了密钥。发现 1 项风险
中风险

令牌可能暴露在对话上下文或本机进程参数中

原文依据:3 处
发现了什么

环境变量缺失时,Skill 要求用户向代理提供 API 密钥;正常对话并不是专用的秘密输入通道。示例还让 shell 把令牌展开到 curl 的命令行参数中,在某些共享系统上,其他本地进程或用户可能短暂看到该参数。虽然文档禁止回显令牌,但这不能消除令牌已进入对话上下文和进程参数的风险。

为什么需要注意

获得令牌的人可在该 Notion 集成权限范围内读取工作区内容,并可能创建、修改、归档或删除内容。

当环境中没有令牌时,Skill 明确要求用户在对话中提供 API 密钥,使凭据进入对话上下文。其 curl 示例还把环境变量展开为 Authorization 参数;在允许其他用户或进程查看进程参数的系统上,令牌可能短暂可见。禁止显示或记录令牌是有效的保护措施,但没有消除上述两条暴露路径。用户可要求作者改用平台的专用秘密输入/存储机制,并限制进程查看权限及令牌的 Notion 访问范围。

SKILL.md:18来自说明文档打开原文件
1. **Environment Variable**: Check if `NOTION_API_TOKEN` is available in the environment2. **User-Provided Key**: If the user provides an API key in context, use that instead3. **No Key Available**: If neither is available, use AskUserQuestion (or equivalent) to request the API key from the user**IMPORTANT**: Never display, log, or send `NOTION_API_TOKEN` anywhere except in the `Authorization` header. Confirm its existence, ask if missing, use it in requests—but never echo or expose it.
查看另外 2 个位置
SKILL.md:28来自说明文档打开原文件
```bash-H "Authorization: Bearer $NOTION_API_TOKEN" \-H "Notion-Version: 2025-09-03" \-H "Content-Type: application/json"```
SKILL.md:38来自说明文档打开原文件
```bashcurl -s "https://api.notion.com/v1/users/me" \  -H "Authorization: Bearer $NOTION_API_TOKEN" \  -H "Notion-Version: 2025-09-03" | jq```
会不会删除文件或一直在后台运行?检查是否大范围删除文件、改写磁盘,或设置自动启动。未发现风险
会不会绕过安全保护?检查是否跳过网站安全验证、开放过多文件权限,或取消操作前的确认。未发现风险
会不会误导 AI 或隐藏内容?检查工作说明是否要求 AI 忽略你的指令、干扰检查结果,或夹带看不见的文字。未发现风险
会不会偷偷改推广链接或收款方?检查是否强制替换推广链接或收款对象,同时要求隐瞒更改。未发现风险

Skill 逻辑拆解

8 个说明模块

该 Skill 是一套直接调用 Notion REST API 的操作说明,会使用集成令牌读取或更改该令牌可访问的工作区内容;没有附带可执行脚本。

查看原文
SKILL.md:12来自说明文档打开原文件
This skill enables interaction with Notion workspaces through the Notion REST API. Use `curl` and `jq` for direct REST calls, or write ad-hoc scripts as appropriate for the task.
SKILL.md:46来自说明文档打开原文件
- **Base URL**: `https://api.notion.com`- **API Version**: `2025-09-03` (required header)- **Data Format**: JSON for all request/response bodies- **IDs**: UUIDv4 format (dashes optional in requests)

它提供搜索、页面、区块、数据库、用户和评论等接口,因此实际权限取决于用户给 Notion 集成共享了哪些资源。搜索说明可能遍历令牌可访问的全部页面和数据库。

查看原文
SKILL.md:90来自说明文档打开原文件
### SearchSearch across all accessible pages and databases:```bashcurl -s -X POST "https://api.notion.com/v1/search" \  -H "Authorization: Bearer $NOTION_API_TOKEN" \
SKILL.md:366来自说明文档打开原文件
### Users#### List All Users```bashcurl -s "https://api.notion.com/v1/users?page_size=100" \  -H "Authorization: Bearer $NOTION_API_TOKEN" \  -H "Notion-Version: 2025-09-03" | jq```

该 Skill 明确要求在修改、删除、架构变更和批量操作前确认,并建议更新前读取当前状态。删除区块会移入回收站,可恢复。

查看原文
SKILL.md:77来自说明文档打开原文件
## Confirmation for Destructive Operations**IMPORTANT**: Before executing any operation that modifies or deletes data, ask the user for confirmation. This includes:- Updating pages or blocks- Deleting/archiving pages or blocks- Modifying database schemas- Creating pages (if multiple or in batch)- Any bulk operationsFor a logical group of related operations, a single confirmation is sufficient.
SKILL.md:260来自说明文档打开原文件
#### Delete a Block```bashcurl -s -X DELETE "https://api.notion.com/v1/blocks/{block_id}" \  -H "Authorization: Bearer $NOTION_API_TOKEN" \  -H "Notion-Version: 2025-09-03" | jq```Moves block to trash (can be restored).
SKILL.md:483来自说明文档打开原文件
5. **Check `has_more`**: Always handle pagination for list endpoints6. **Validate Before Updates**: Retrieve current state before making updates7. **Use Environment Variables**: Never hardcode API keys8. **Handle Errors Gracefully**: Check response status codes and error messages

主文档使用 `NOTION_API_TOKEN`,但两个参考示例改用 `NOTION_API_KEY`。如果只设置了前者,这些参考命令可能发送空的 Authorization 值并失败。

查看原文
SKILL.md:18来自说明文档打开原文件
1. **Environment Variable**: Check if `NOTION_API_TOKEN` is available in the environment2. **User-Provided Key**: If the user provides an API key in context, use that instead3. **No Key Available**: If neither is available, use AskUserQuestion (or equivalent) to request the API key from the user
references/filters-and-sorts.md:9来自说明文档打开原文件
```bashcurl -s -X POST "https://api.notion.com/v1/databases/{database_id}/query" \  -H "Authorization: Bearer $NOTION_API_KEY" \  -H "Notion-Version: 2025-09-03" \  -H "Content-Type: application/json" \
references/property-types.md:658来自说明文档打开原文件
```bashcurl -s "https://api.notion.com/v1/pages/{page_id}/properties/{property_id}" \  -H "Authorization: Bearer $NOTION_API_KEY" \  -H "Notion-Version: 2025-09-03"```
从这里开始 · 工作说明SKILL.md
notion-api
连线表示工作说明包含的模块,不是实际运行顺序。点击模块可查看原文。 另有 2 个章节,可在原文件中查看。

文件引用关系图

4 处引用
哪些文件发起引用引用了什么
连线表示真实的文件引用,不是运行顺序。点击节点可高亮相关连线,并查看具体文件和原文位置。虚线表示还有文件需要定位。
文件与检查记录5 个文件

检查范围与遗漏

逐文件查看涉及的内容

下方列出本次涉及的原文范围;纳入检查不代表已查清所有问题。

  • SKILL.md已纳入全文
  • references/block-types.md已纳入全文
  • references/filters-and-sorts.md已纳入全文
  • references/property-types.md已纳入全文
  • references/rich-text.md已纳入全文

这份报告只针对上方版本。我们看了拿到的代码和说明文件,没有实际运行 Skill,也没有检查它另外安装的软件包。因此,这不是“保证安全”的承诺;换了版本或使用环境,结果也可能不同。

  • SKILL.md工作说明
  • references/block-types.md配套文件
  • references/filters-and-sorts.md配套文件
  • references/property-types.md配套文件
  • references/rich-text.md配套文件

代码和说明中提到的操作

连接外部网站
SKILL.md:12来自说明文档打开原文件
This skill enables interaction with Notion workspaces through the Notion REST API. Use `curl` and `jq` for direct REST calls, or write ad-hoc scripts as appropriate for the task.
SKILL.md:39来自说明文档打开原文件
```bashcurl -s "https://api.notion.com/v1/users/me" \  -H "Authorization: Bearer $NOTION_API_TOKEN" \
SKILL.md:46来自说明文档打开原文件
- **Base URL**: `https://api.notion.com`- **API Version**: `2025-09-03` (required header)
运行命令
SKILL.md:28来自说明文档打开原文件
```bash-H "Authorization: Bearer $NOTION_API_TOKEN" \
SKILL.md:38来自说明文档打开原文件
```bashcurl -s "https://api.notion.com/v1/users/me" \
SKILL.md:94来自说明文档打开原文件
```bashcurl -s -X POST "https://api.notion.com/v1/search" \
读取密钥或账号配置
references/filters-and-sorts.md:11来自说明文档打开原文件
curl -s -X POST "https://api.notion.com/v1/databases/{database_id}/query" \  -H "Authorization: Bearer $NOTION_API_KEY" \  -H "Notion-Version: 2025-09-03" \
references/filters-and-sorts.md:495来自说明文档打开原文件
curl -s -X POST "https://api.notion.com/v1/databases/{database_id}/query" \  -H "Authorization: Bearer $NOTION_API_KEY" \  -H "Notion-Version: 2025-09-03" \
references/property-types.md:660来自说明文档打开原文件
curl -s "https://api.notion.com/v1/pages/{page_id}/properties/{property_id}" \  -H "Authorization: Bearer $NOTION_API_KEY" \  -H "Notion-Version: 2025-09-03"
读取了多少行
2,697
文件校验值(用于核对版本)
befd9e5a9af5706d738553abf0e4873b288e615e207624deacf45c805b880047