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

Vercel Composition Patterns Skill 安全审计

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

React composition patterns that scale. Use when refactoring components with

第三方安全检查结论

发现安全风险

已检查文件
14
发现的风险
1
会不会运行危险命令?检查是否下载程序后直接运行、让他人远程控制电脑,或藏起要运行的命令。未发现风险
会不会泄露文件和密钥?检查是否发送含密码或密钥的文件,以及代码里是否直接写了密钥。未发现风险
会不会删除文件或一直在后台运行?检查是否大范围删除文件、改写磁盘,或设置自动启动。未发现风险
会不会绕过安全保护?检查是否跳过网站安全验证、开放过多文件权限,或取消操作前的确认。发现 1 项风险
中风险

Provider 边界可能向过多后代组件授予草稿读取和提交能力

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

指南明确把 Provider 边界作为访问控制范围:边界内的组件可读取消息和附件,也可调用 submit,即使不在 Composer.Frame 内。如果应用把 Provider 包在较大的组件树或包含不完全可信的第三方组件,这些后代会获得超出界面外观所暗示的能力。

为什么需要注意

受影响的后代组件可能读取尚未发送的内容、修改共享状态,或触发转发/提交动作。证据没有显示数据会被发送到外部,也没有显示这些动作会自动执行;风险取决于使用该模式时的 Provider 范围和后代组件。

该风险在架构层面成立,但不是已经发生的数据泄露。指南主动建议以 Provider 范围共享状态,并示例说明 Frame 外的后代可调用 submit、读取消息及附件。若应用把同一 Provider 扩展到不需要这些能力或不完全可信的组件,它们可能获得草稿读取或提交能力。这里是文档中的示例代码,不会由 Skill 自行执行。用户可要求作者明确 Provider 不是安全边界,并将其限制在最小可信组件树中。

rules/state-context-interface.md:140来自说明文档打开原文件
The provider boundary is what matters—not the visual nesting. Components thatneed shared state don't have to be inside the `Composer.Frame`. They just needto be within the provider.
查看另外 2 个位置
rules/state-context-interface.md:171来自说明文档打开原文件
// This button lives OUTSIDE Composer.Frame but can still submit based on its context!function ForwardButton() {  const {    actions: { submit },  } = use(ComposerContext)  return <Button onPress={submit}>Forward</Button>}// This preview lives OUTSIDE Composer.Frame but can read composer's state!function MessagePreview() {  const { state } = use(ComposerContext)  return <Preview message={state.input} attachments={state.attachments} />}
rules/state-lift-state.md:119来自说明文档打开原文件
The ForwardButton lives outside the Composer.Frame but still has access to thesubmit action because it's within the provider. Even though it's a one-offcomponent, it can still access the composer's state and actions from outside theUI itself.**Key insight:** Components that need shared state don't have to be visuallynested inside each other—they just need to be within the same provider.
会不会误导 AI 或隐藏内容?检查工作说明是否要求 AI 忽略你的指令、干扰检查结果,或夹带看不见的文字。未发现风险
会不会偷偷改推广链接或收款方?检查是否强制替换推广链接或收款对象,同时要求隐瞒更改。未发现风险

Skill 逻辑拆解

5 个说明模块

该 Skill 是面向 React 组件设计的文档型指南,主要建议用复合组件、Context Provider 和显式变体代替大量布尔属性。提供的内容没有安装命令、可执行脚本或凭据处理逻辑。

查看原文
SKILL.md:4来自说明文档打开原文件
description:  React composition patterns that scale. Use when refactoring components with  boolean prop proliferation, building flexible component libraries, or  designing reusable APIs. Triggers on tasks involving compound components,  render props, context providers, or component architecture. Includes React 19  API changes.license: MIT
SKILL.md:73来自说明文档打开原文件
Read individual rule files for detailed explanations and code examples:```rules/architecture-avoid-boolean-props.mdrules/state-context-interface.md```

核心模式将 state、actions 和 meta 注入共享 Context;位于 Provider 内的后代组件可以读取状态、更新状态或调用提交动作,即使它们不在主要表单的视觉结构内。

查看原文
rules/architecture-compound-components.md:47来自说明文档打开原文件
```tsxconst ComposerContext = createContext<ComposerContextValue | null>(null)function ComposerProvider({ children, state, actions, meta }: ProviderProps) {  return (    <ComposerContext value={{ state, actions, meta }}>      {children}    </ComposerContext>  )}
rules/state-context-interface.md:171来自说明文档打开原文件
// This button lives OUTSIDE Composer.Frame but can still submit based on its context!function ForwardButton() {  const {    actions: { submit },  } = use(ComposerContext)  return <Button onPress={submit}>Forward</Button>}// This preview lives OUTSIDE Composer.Frame but can read composer's state!function MessagePreview() {  const { state } = use(ComposerContext)  return <Preview message={state.input} attachments={state.attachments} />}
从这里开始 · 工作说明SKILL.md
vercel-composition-patterns
连线表示工作说明包含的模块,不是实际运行顺序。点击模块可查看原文。
文件与检查记录14 个文件

检查范围与遗漏

逐文件查看涉及的内容

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

  • SKILL.md已纳入全文
  • AGENTS.md已纳入全文
  • metadata.json已纳入全文
  • README.md已纳入全文
  • rules/_sections.md已纳入全文
  • rules/_template.md已纳入全文
  • rules/architecture-avoid-boolean-props.md已纳入全文
  • rules/architecture-compound-components.md已纳入全文
  • rules/patterns-children-over-render-props.md已纳入全文
  • rules/patterns-explicit-variants.md已纳入全文
  • rules/react19-no-forwardref.md已纳入全文
  • rules/state-context-interface.md已纳入全文
  • rules/state-decouple-implementation.md已纳入全文
  • rules/state-lift-state.md已纳入全文

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

  • AGENTS.md配套文件
  • README.md配套文件
  • SKILL.md工作说明
  • metadata.json配套文件
  • rules/_sections.md配套文件
  • rules/_template.md配套文件
  • rules/architecture-avoid-boolean-props.md配套文件
  • rules/architecture-compound-components.md配套文件
  • rules/patterns-children-over-render-props.md配套文件
  • rules/patterns-explicit-variants.md配套文件
  • rules/react19-no-forwardref.md配套文件
  • rules/state-context-interface.md配套文件
  • rules/state-decouple-implementation.md配套文件
  • rules/state-lift-state.md配套文件

代码和说明中提到的操作

连接外部网站
AGENTS.md:944来自说明文档打开原文件
1. [https://react.dev](https://react.dev)2. [https://react.dev/learn/passing-data-deeply-with-context](https://react.dev/learn/passing-data-deeply-with-context)
AGENTS.md:945来自说明文档打开原文件
1. [https://react.dev](https://react.dev)2. [https://react.dev/learn/passing-data-deeply-with-context](https://react.dev/learn/passing-data-deeply-with-context)3. [https://react.dev/reference/react/use](https://react.dev/reference/react/use)
AGENTS.md:946来自说明文档打开原文件
2. [https://react.dev/learn/passing-data-deeply-with-context](https://react.dev/learn/passing-data-deeply-with-context)3. [https://react.dev/reference/react/use](https://react.dev/reference/react/use)
读取了多少行
2,043
文件校验值(用于核对版本)
f967df27ca7db8f83fdf029328b58d1e5de7017da13b253c50b9ff78dde2752b