跳转到正文
报告库
用途分类 / 浏览器操作

Clerk Testing Skill 安全审计

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

E2E testing for Clerk apps. Use with Playwright or Cypress for auth flow

第三方安全检查结论

先别安装或运行

已检查文件
1
发现的风险
5
会不会运行危险命令?检查是否下载程序后直接运行、让他人远程控制电脑,或藏起要运行的命令。发现 1 项风险
高风险

运行未固定版本的远程 Clerk CLI

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

工作流指示运行 `npx clerk@latest init`。`npx` 可下载并立即执行当时发布为 latest 的包,而 Skill 没有固定或校验具体版本;实际执行代码会随注册表内容变化。

为什么需要注意

若上游包、发布账户或依赖链被破坏,任意代码可能以代理当前权限运行,并访问项目文件、环境变量或可用凭据。即使包正常,升级也可能引入未经审核的行为变化。

`npx clerk@latest init` 会在需要时取得并执行 latest 标签所指向的 CLI,而源码没有固定版本或说明校验方式。其用途是创建测试用开发实例,并非与 Skill 目的无关的执行,但用户运行到的代码会随软件包发布状态变化。可限制为经审查的固定版本。

SKILL.md:35来自说明文档打开原文件
3. Follow official setup instructions4. Use development-instance keys only (`pk_test_*` / `sk_test_*`). If the project has no keys yet, `npx clerk@latest init` (the Clerk CLI; see `clerk-setup`) creates a Clerk application and writes development-instance keys to the env file. No Clerk account or Dashboard visit is needed.
会不会泄露文件和密钥?检查是否发送含密码或密钥的文件,以及代码里是否直接写了密钥。发现 1 项风险
中风险

持久化认证状态可能留下可复用会话

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

该 Skill 推荐用 Playwright `storageState` 保存认证状态以供测试复用,但没有要求保护、忽略或清理生成的状态文件。该文件通常代表已认证的浏览器会话。

为什么需要注意

如果状态文件进入版本库、CI 产物或可被其他用户读取,获得者可能在会话有效期内冒用测试用户;若误连生产环境,影响可能扩大到真实账户。

源码明确推荐用 `storageState` 持久化并复用认证状态,却没有给出存储位置、访问限制、版本控制排除或清理要求。若状态被写入文件,它可能包含可复用的浏览器认证材料并被误提交或被其他本地进程读取。用户可要求状态只保存到受限、被忽略的临时路径,并在测试后删除。

SKILL.md:25来自说明文档打开原文件
Test auth = isolated session state. Each test needs fresh auth context.- `clerkSetup()` initializes test environment- `setupClerkTestingToken()` bypasses bot detection- `storageState` persists auth between tests for speed
查看另外 2 个位置
SKILL.md:39来自说明文档打开原文件
- Use `setupClerkTestingToken()` before navigating to auth pages- Use test API keys: `pk_test_xxx`, `sk_test_xxx`- Save auth state with `storageState` for faster tests- Use `page.waitForSelector('[data-clerk-component]')` for Clerk UI
SKILL.md:41来自说明文档打开原文件
- Use test API keys: `pk_test_xxx`, `sk_test_xxx`- Save auth state with `storageState` for faster tests- Use `page.waitForSelector('[data-clerk-component]')` for Clerk UI
会不会删除文件或一直在后台运行?检查是否大范围删除文件、改写磁盘,或设置自动启动。发现 1 项风险
中风险

CLI 会创建 Clerk 应用并把秘密密钥写入环境文件

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

该指令不仅配置本地测试,还声明 CLI 会创建一个 Clerk 应用,并把开发实例密钥写入环境文件。它没有指定目标环境文件、已有内容的处理方式或执行前确认步骤。

为什么需要注意

这会改变外部 Clerk 资源并在项目目录中留下秘密。若目标文件被版本控制、日志、构建产物或其他用户读取,测试秘密可能泄露;自动选择环境文件也可能覆盖或混入现有配置。

源码明确称该 CLI 会创建 Clerk 应用并把开发密钥写入“env file”,但未标明具体文件、是否覆盖已有值或是否先确认。它只应在项目没有密钥时运行,并要求使用测试密钥,这降低了生产凭据风险;不过仍会改变本地文件并创建外部应用。用户可要求作者说明目标文件、合并行为及创建前确认。

SKILL.md:10来自说明文档打开原文件
  version: 1.2.1compatibility: Requires a publishable key and either CLERK_SECRET_KEY or CLERK_TESTING_TOKEN. Keys can be auto-generated by `clerk init` (temporary development keys, no Clerk account required), or pulled from the Clerk Dashboard.---
查看另外 1 个位置
SKILL.md:35来自说明文档打开原文件
3. Follow official setup instructions4. Use development-instance keys only (`pk_test_*` / `sk_test_*`). If the project has no keys yet, `npx clerk@latest init` (the Clerk CLI; see `clerk-setup`) creates a Clerk application and writes development-instance keys to the env file. No Clerk account or Dashboard visit is needed.
会不会绕过安全保护?检查是否跳过网站安全验证、开放过多文件权限,或取消操作前的确认。发现 1 项风险
低风险

安装命令没有固定依赖版本

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

安装命令没有指定依赖版本。同样的命令以后可能下载不同代码,你实际安装的内容可能与这次检查时不同。

为什么需要注意

即使命令和报告没变,以后安装时也可能下载到另一份代码。

该工作流明确使用 `clerk@latest`,没有锁定具体版本。执行时会解析当时的 latest 版本,因此未来取得的 CLI 代码可能不同。命令仅在项目尚无密钥时使用,且用途与测试配置相符,但版本漂移风险仍然存在。用户可要求作者固定并验证 CLI 版本。

SKILL.md:35来自说明文档打开原文件
3. Follow official setup instructions4. Use development-instance keys only (`pk_test_*` / `sk_test_*`). If the project has no keys yet, `npx clerk@latest init` (the Clerk CLI; see `clerk-setup`) creates a Clerk application and writes development-instance keys to the env file. No Clerk account or Dashboard visit is needed.
会不会误导 AI 或隐藏内容?检查工作说明是否要求 AI 忽略你的指令、干扰检查结果,或夹带看不见的文字。发现 1 项风险
中风险

要求直接遵循运行时获取的可变网页指令

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

Skill 授权 WebFetch,并明确要求获取 Clerk 网页后“遵循官方设置说明”。网页内容不在本次提供的源码中,也可能在 Skill 发布后变化,因此其安装命令、权限要求和数据处理无法由这份静态审计确认。

为什么需要注意

若页面、重定向或其内容供应链发生变化,代理可能遵循新增的命令、凭据请求或文件修改,而用户误以为这些行为已随 Skill 一同审核。

该 Skill 允许 WebFetch,并要求获取所列网页后直接遵循其中的设置说明。那些网页内容未包含在本次源码中,可能后来改变,因此静态审计无法确认届时要求执行的命令、权限或数据处理。链接指向声称为 Clerk 官方文档且行为与测试目的相关,但用户仍可要求在执行任何获取到的命令前展示并确认其版本、权限和文件改动。

SKILL.md:5来自说明文档打开原文件
  tests.allowed-tools: WebFetchlicense: MIT
查看另外 2 个位置
SKILL.md:17来自说明文档打开原文件
| Framework | Documentation ||-----------|---------------|| Overview | https://clerk.com/docs/guides/development/testing/overview || Playwright | https://clerk.com/docs/guides/development/testing/playwright/overview || Cypress | https://clerk.com/docs/guides/development/testing/cypress/overview |
SKILL.md:32来自说明文档打开原文件
1. Identify test framework (Playwright or Cypress)2. WebFetch the appropriate URL from decision tree above3. Follow official setup instructions4. Use development-instance keys only (`pk_test_*` / `sk_test_*`). If the project has no keys yet, `npx clerk@latest init` (the Clerk CLI; see `clerk-setup`) creates a Clerk application and writes development-instance keys to the env file. No Clerk account or Dashboard visit is needed.
会不会偷偷改推广链接或收款方?检查是否强制替换推广链接或收款对象,同时要求隐瞒更改。未发现风险

Skill 逻辑拆解

7 个说明模块

该 Skill 面向 Clerk 应用的 Playwright 或 Cypress 端到端认证测试,并要求每个测试使用隔离的会话状态。

查看原文
SKILL.md:2来自说明文档打开原文件
---name: clerk-testingdescription: E2E testing for Clerk apps. Use with Playwright or Cypress for auth flow  tests.allowed-tools: WebFetch
SKILL.md:23来自说明文档打开原文件
## Mental ModelTest auth = isolated session state. Each test needs fresh auth context.- `clerkSetup()` initializes test environment- `setupClerkTestingToken()` bypasses bot detection- `storageState` persists auth between tests for speed

它要求从预设的 Clerk 文档网址获取当前说明,然后遵循获取到的设置步骤;因此实际执行内容并不完全包含在本文件中。

查看原文
SKILL.md:17来自说明文档打开原文件
| Framework | Documentation ||-----------|---------------|| Overview | https://clerk.com/docs/guides/development/testing/overview || Playwright | https://clerk.com/docs/guides/development/testing/playwright/overview || Cypress | https://clerk.com/docs/guides/development/testing/cypress/overview |
SKILL.md:32来自说明文档打开原文件
1. Identify test framework (Playwright or Cypress)2. WebFetch the appropriate URL from decision tree above3. Follow official setup instructions4. Use development-instance keys only (`pk_test_*` / `sk_test_*`). If the project has no keys yet, `npx clerk@latest init` (the Clerk CLI; see `clerk-setup`) creates a Clerk application and writes development-instance keys to the env file. No Clerk account or Dashboard visit is needed.

该 Skill 明确限定使用开发实例密钥,并把生产密钥用于测试列为安全风险。

查看原文
SKILL.md:35来自说明文档打开原文件
3. Follow official setup instructions4. Use development-instance keys only (`pk_test_*` / `sk_test_*`). If the project has no keys yet, `npx clerk@latest init` (the Clerk CLI; see `clerk-setup`) creates a Clerk application and writes development-instance keys to the env file. No Clerk account or Dashboard visit is needed.
SKILL.md:46来自说明文档打开原文件
| Pattern | Problem | Fix ||---------|---------|-----|| Production keys in tests | Security risk | Use `pk_test_*` keys || No `setupClerkTestingToken()` | Auth fails | Call before navigation || UI-based sign-in every test | Slow tests | Use `storageState` |
从这里开始 · 工作说明SKILL.md
clerk-testing
连线表示工作说明包含的模块,不是实际运行顺序。点击模块可查看原文。
文件与检查记录1 个文件

检查范围与遗漏

逐文件查看涉及的内容

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

  • SKILL.md已纳入全文

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

  • SKILL.md工作说明

代码和说明中提到的操作

连接外部网站
SKILL.md:19来自说明文档打开原文件
|-----------|---------------|| Overview | https://clerk.com/docs/guides/development/testing/overview || Playwright | https://clerk.com/docs/guides/development/testing/playwright/overview |
SKILL.md:20来自说明文档打开原文件
| Overview | https://clerk.com/docs/guides/development/testing/overview || Playwright | https://clerk.com/docs/guides/development/testing/playwright/overview || Cypress | https://clerk.com/docs/guides/development/testing/cypress/overview |
SKILL.md:21来自说明文档打开原文件
| Playwright | https://clerk.com/docs/guides/development/testing/playwright/overview || Cypress | https://clerk.com/docs/guides/development/testing/cypress/overview |
安装其他软件包
SKILL.md:35来自说明文档打开原文件
3. Follow official setup instructions4. Use development-instance keys only (`pk_test_*` / `sk_test_*`). If the project has no keys yet, `npx clerk@latest init` (the Clerk CLI; see `clerk-setup`) creates a Clerk application and writes development-instance keys to the env file. No Clerk account or Dashboard visit is needed.
读取了多少行
62
文件校验值(用于核对版本)
7145f9bf9b6a9afbf2659a872bab7b1cc2184eb35805c05fe69247c0016734e1