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

Sandbox Migrate To Next Skill 安全审计

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

Migrate Cloudflare Sandbox apps from stable @cloudflare/sandbox to @cloudflare/sandbox@next (SDK 1.0 preview). Use sandbox-next for apps already on the preview.

第三方安全检查结论

发现安全风险

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

浮动的 `next` 软件包和容器标签可在未来解析为不同代码

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

升级步骤安装 `@cloudflare/sandbox@next` 并使用 `cloudflare/sandbox:next`,且明确允许继续使用浮动的 `next`。容器标签可在以后拉取时移动到新镜像;重新安装依赖时,预览通道也可能提供新版本。

为什么需要注意

不同时间的构建可能运行未经本次审查的依赖或镜像代码,并引入不兼容行为、供应链风险或生产差异。

包和镜像都使用浮动的 `next` 标签,未来安装或拉取可能解析到不同的预览版本。Skill 要求两者处于相同版本线,但这不能保证不同时间的构建可复现。用户可要求将二者固定到同一、已测试的精确预发布版本,并保留 lockfile 或镜像摘要。

SKILL.md:76来自说明文档打开原文件
```shnpm install @cloudflare/sandbox@next``````dockerfileFROM cloudflare/sandbox:next# Python: cloudflare/sandbox:next-python```Same prerelease tag on Worker and image when not on floating `next`.
查看另外 3 个位置
SKILL.md:77来自说明文档打开原文件
```shnpm install @cloudflare/sandbox@next```
SKILL.md:81来自说明文档打开原文件
```dockerfileFROM cloudflare/sandbox:next# Python: cloudflare/sandbox:next-python```
SKILL.md:85来自说明文档打开原文件
Same prerelease tag on Worker and image when not on floating `next`.
会不会泄露文件和密钥?检查是否发送含密码或密钥的文件,以及代码里是否直接写了密钥。未发现风险
会不会删除文件或一直在后台运行?检查是否大范围删除文件、改写磁盘,或设置自动启动。未发现风险
会不会绕过安全保护?检查是否跳过网站安全验证、开放过多文件权限,或取消操作前的确认。发现 1 项风险
低风险

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

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

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

为什么需要注意

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

该安装步骤使用浮动的 `@next` 标签,而不是固定的预发布版本;未来重新安装时可能取得不同代码,影响可复现性和依赖供应链风险。用户可要求作者提供经过验证的精确版本,并通过 lockfile 固定实际解析结果。

这段代码的正常用途

被标记的命令不是安装依赖,而是用 Wrangler 部署已有项目;`--containers-rollout=immediate` 是发布策略参数,因此“不固定依赖版本”的规则不适用于此行。该命令确有生产发布影响,但那属于候选 m-0 所述的切换风险。

这项判断针对展示的代码和适用条件,不表示风险已经实际发生。
SKILL.md:77来自说明文档打开原文件
```shnpm install @cloudflare/sandbox@next```
查看另外 3 个位置
SKILL.md:85来自说明文档打开原文件
Same prerelease tag on Worker and image when not on floating `next`.
SKILL.md:157来自说明文档打开原文件
```shnpx wrangler deploy --containers-rollout=immediate```
SKILL.md:152来自说明文档打开原文件
### Deploy cutoverStaging/branch first. Production is **one** deploy of matching Worker + image:```shnpx wrangler deploy --containers-rollout=immediate```
会不会误导 AI 或隐藏内容?检查工作说明是否要求 AI 忽略你的指令、干扰检查结果,或夹带看不见的文字。发现 1 项风险
中风险

迁移逻辑依赖执行时获取的可变网页内容

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

Skill 指示代理在需要细节时获取链接页面,并要求依据这些网页实施代码修改。网页内容不在所提供、已审计的 Skill 源码中,之后可以变化;若页面或内容供应链被篡改,其中的指令可能影响代理修改或执行什么。

为什么需要注意

代理可能依据未经本次审计的新增内容执行额外命令、改变文件,或扩大迁移范围。

Skill 要求在迁移时获取外部网页,并依据网页内容实施修改;这些内容未包含在本次审计材料中,日后可能变化。因此代理的实际操作部分取决于执行时取得的未审计内容。用户可限制只使用指定日期或保存快照的官方文档,并要求展示拟执行的修改和命令后再批准。

SKILL.md:8来自说明文档打开原文件
**Perform** the port. Follow the steps in order. Depth lives in docs—fetch the linked page when a step needs detail.Human guide: [Migrate](https://developers.cloudflare.com/sandbox/1-0-preview/migrate/) · [1.0 preview](https://developers.cloudflare.com/sandbox/1-0-preview/)
查看另外 2 个位置
SKILL.md:89来自说明文档打开原文件
Apply replacements from the map. For each area, implement from the doc—not from stable habits:| Area | Doc || ---- | --- || Commands / handles / waits | [Processes](https://developers.cloudflare.com/sandbox/1-0-preview/processes/) · [Processes API](https://developers.cloudflare.com/sandbox/1-0-preview/api/processes/) || `cwd` / `env` / secrets | [Environment](https://developers.cloudflare.com/sandbox/1-0-preview/environment/) · [Outbound traffic](https://developers.cloudflare.com/sandbox/guides/outbound-traffic/) || Drop sessions | [Migrate](https://developers.cloudflare.com/sandbox/1-0-preview/migrate/) · [Lifecycle](https://developers.cloudflare.com/sandbox/1-0-preview/lifecycle/) || Terminals | [Terminals](https://developers.cloudflare.com/sandbox/1-0-preview/terminals/) || Interpreter | [Interpreter](https://developers.cloudflare.com/sandbox/1-0-preview/interpreter/) || Errors | [Errors](https://developers.cloudflare.com/sandbox/1-0-preview/errors/) || Durable job across requests | [Process execution — lifetime / durability](https://developers.cloudflare.com/sandbox/1-0-preview/processes/) |
SKILL.md:16来自说明文档打开原文件
**Prefer installed `@next` types and the migrate doc over memory.**
会不会偷偷改推广链接或收款方?检查是否强制替换推广链接或收款对象,同时要求隐瞒更改。发现 1 项风险
中风险

生产切换会立即替换容器并可能中断正在运行的工作

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

Skill 指示生产环境使用立即滚动发布,并说明进行中的容器任务可能停止、旧进程和终端 ID 会失效。虽然它要求先获得用户同意,但同意后执行仍会产生明确的服务连续性风险。

为什么需要注意

活跃终端、流、后台任务或用户请求可能中断;依赖旧进程 ID 的应用可能失败,造成短时停机或任务丢失。

Skill 明确要求生产切换采用立即容器发布,并说明进行中的容器工作可能停止、旧进程和终端 ID 会失效。这是经用户同意后仍存在的可用性风险;所幸它同时要求先确认并先在 staging/branch 操作。用户应要求维护窗口、回滚方案以及对活动任务的处理计划。

SKILL.md:30来自说明文档打开原文件
- Worker package and container image must be the **same** `@next` line.  - Production cutover uses **immediate** container rollout. Stable and `@next` control protocols are incompatible both ways; gradual rollout leaves a broken mixed window. In-flight container work can stop.  - After cutover, `await sandbox.exec(...)` means process **started**, not command **finished**.  
查看另外 4 个位置
SKILL.md:154来自说明文档打开原文件
Staging/branch first. Production is **one** deploy of matching Worker + image:```shnpx wrangler deploy --containers-rollout=immediate```Leave `rollout_active_grace_period` at default `0` (or set `0` if raised). After cutover, pre-deploy process/terminal IDs are invalid. Details: [Migrate](https://developers.cloudflare.com/sandbox/1-0-preview/migrate/) · [Container rollouts](https://developers.cloudflare.com/containers/platform-details/rollouts/)
SKILL.md:14来自说明文档打开原文件
Existing apps should migrate **when you can**, so you are ready when 1.0 becomes the stable release. Do **not** force production cutover without the user agreeing.
SKILL.md:31来自说明文档打开原文件
- Worker package and container image must be the **same** `@next` line.  - Production cutover uses **immediate** container rollout. Stable and `@next` control protocols are incompatible both ways; gradual rollout leaves a broken mixed window. In-flight container work can stop.  - After cutover, `await sandbox.exec(...)` means process **started**, not command **finished**.  
SKILL.md:160来自说明文档打开原文件
Leave `rollout_active_grace_period` at default `0` (or set `0` if raised). After cutover, pre-deploy process/terminal IDs are invalid. Details: [Migrate](https://developers.cloudflare.com/sandbox/1-0-preview/migrate/) · [Container rollouts](https://developers.cloudflare.com/containers/platform-details/rollouts/)

Skill 逻辑拆解

8 个说明模块

该 Skill 的目标是把现有 Cloudflare Sandbox 应用迁移到 1.0 预览版,并要求先审计代码、在需要时征求用户决定,然后再升级和验证。

查看原文
SKILL.md:20来自说明文档打开原文件
1. **Review** hard rules and the replacement map  2. **Audit** the codebase; list hits and target shapes  3. **Clarify** with the user (cutover, bridge, Python image, unclear sites)  4. **Upgrade** package, image, and code  5. **Validate**  Stop after any step that needs a user decision.

它明确禁止未经用户同意强制切换生产环境,并要求在生产部署前确认立即滚动发布可能终止正在运行的任务。

查看原文
SKILL.md:14来自说明文档打开原文件
Existing apps should migrate **when you can**, so you are ready when 1.0 becomes the stable release. Do **not** force production cutover without the user agreeing.
SKILL.md:67来自说明文档打开原文件
- OK to cut production with `--containers-rollout=immediate` (live processes/terminals/streams may stop)?  - Self-deployed bridge? Leave on stable.  

命令迁移示例使用参数数组,并在需要 shell 语法时显式调用 Bash;Git 示例也用 `--` 分隔选项和仓库地址,降低把输入误当作 shell 或 Git 选项的风险。

查看原文
SKILL.md:32来自说明文档打开原文件
- Production cutover uses **immediate** container rollout. Stable and `@next` control protocols are incompatible both ways; gradual rollout leaves a broken mixed window. In-flight container work can stop.  - After cutover, `await sandbox.exec(...)` means process **started**, not command **finished**.  - Argv is as-is (no implicit shell). Shell syntax needs an explicit shell binary.  - Process handles have **no stdin** → terminals for interactive input.  
SKILL.md:143来自说明文档打开原文件
```tsconst clone = await sandbox.exec(  ["git", "clone", "--depth", "1", "--", repoUrl, "/workspace/repo"],  { cwd: "/workspace" },);const result = await clone.output({ encoding: "utf8" });```

验证清单要求检查依赖与镜像版本一致、测试迁移后的功能、清除已移除 API,并避免把真实密钥放入沙箱环境。

查看原文
SKILL.md:164来自说明文档打开原文件
1. Lockfile + Dockerfile on the same `@next` line  2. Typecheck against `@next`  3. Smoke argv `exec` + `output({ encoding: "utf8" })`  4. Smoke long process / terminal / interpreter if used  5. Errors distinguished: unavailable / interrupted-RPC / stale / local wait  6. No live secrets in sandbox env  7. Grep again for removed APIs  8. Production used `--containers-rollout=immediate`  
从这里开始 · 工作说明SKILL.md
sandbox-migrate-to-next
连线表示工作说明包含的模块,不是实际运行顺序。点击模块可查看原文。
文件与检查记录1 个文件

检查范围与遗漏

逐文件查看涉及的内容

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

  • SKILL.md已纳入全文

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

  • SKILL.md工作说明

代码和说明中提到的操作

连接外部网站
SKILL.md:10来自说明文档打开原文件
Human guide: [Migrate](https://developers.cloudflare.com/sandbox/1-0-preview/migrate/) · [1.0 preview](https://developers.cloudflare.com/sandbox/1-0-preview/)
SKILL.md:12来自说明文档打开原文件
**New projects** should start on `@next` (**`sandbox-next`**), not this skill. **Day-to-day stable work** → **`sandbox-stable`**. Deprecated-API cleanup **without** moving to `@next` → [2026 deprecation guide](https://developers.cloudflare.com/sandbox/guides/2026-deprecation/) first if needed.
SKILL.md:55来自说明文档打开原文件
Depth: [Migrate](https://developers.cloudflare.com/sandbox/1-0-preview/migrate/) · after port, day-to-day → **`sandbox-next`**
安装其他软件包
SKILL.md:77来自说明文档打开原文件
```shnpm install @cloudflare/sandbox@next```
SKILL.md:157来自说明文档打开原文件
```shnpx wrangler deploy --containers-rollout=immediate```
运行命令
SKILL.md:108来自说明文档打开原文件
// After (@next)const process = await sandbox.exec(["/bin/bash", "-lc", "npm test"]);const result = await process.output({ encoding: "utf8" });
SKILL.md:113来自说明文档打开原文件
```tsconst server = await sandbox.exec(["/bin/bash", "-lc", "npm run dev"], {  cwd: "/workspace/app",
SKILL.md:123来自说明文档打开原文件
```tsconst terminal = await sandbox.createTerminal({ command: ["bash"], cwd: "/workspace" });const t = await sandbox.getTerminal(terminal.id);
读取了多少行
186
文件校验值(用于核对版本)
2da01e787d0cd4f88db2f06e884a81995ce9b0b4efdb9b225aa5957c196ffe75