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

Sandbox Next Skill 安全审计

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

Build or maintain Cloudflare Sandbox apps on @cloudflare/sandbox@next (SDK 1.0 preview). Use sandbox-migrate-to-next when porting a stable app.

第三方安全检查结论

发现低风险问题

已检查文件
3
发现的风险
1
会不会运行危险命令?检查是否下载程序后直接运行、让他人远程控制电脑,或藏起要运行的命令。未发现风险
会不会泄露文件和密钥?检查是否发送含密码或密钥的文件,以及代码里是否直接写了密钥。未发现风险
会不会删除文件或一直在后台运行?检查是否大范围删除文件、改写磁盘,或设置自动启动。未发现风险
会不会绕过安全保护?检查是否跳过网站安全验证、开放过多文件权限,或取消操作前的确认。未发现风险
会不会误导 AI 或隐藏内容?检查工作说明是否要求 AI 忽略你的指令、干扰检查结果,或夹带看不见的文字。发现 1 项风险
低风险

实现流程依赖运行时获取的可变外部文档和示例

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

Skill 要求实现前获取网页,并优先参考远程仓库树和文档。这些内容不包含在已审计的 Skill 文件中,可能在安装后发生变化。

为什么需要注意

如果链接目标、仓库分支或上游内容被错误修改或入侵,代理可能把未经本次审计的指令或代码带入用户项目。已安装类型检查只能发现部分 API 类型问题,不能验证外部代码的安全意图。

这段代码的正常用途

这是为快速变化的预览版 SDK 核对最新 API 的正常文档检索流程。指令指向 Cloudflare 官方文档和官方 GitHub 仓库,并要求以本地安装的 `@next` 类型为准,可降低远程内容变化导致的误导。远程页面确实可能变化,但现有源码没有要求执行从网页取得的脚本、安装未知软件或提交凭据,因此仅凭这些链接不足以构成具体用户风险。用户仍可限制联网,并要求在采用远程示例前展示来源和改动。

这项判断针对展示的代码和适用条件,不表示风险已经实际发生。
SKILL.md:64来自说明文档打开原文件
## 3. Retrieve — open the doc for the taskFetch the page before implementing. Installed `@next` types win over guesses.
查看另外 5 个位置
references/examples.md:3来自说明文档打开原文件
Pointers only—not a full catalog. Prefer the repo tree and docs.https://github.com/cloudflare/sandbox-sdk/tree/next/examples
references/examples.md:15来自说明文档打开原文件
Use the **`next`** branch for `@cloudflare/sandbox@next`.
SKILL.md:10来自说明文档打开原文件
**Prefer preview docs and installed `@next` types over memory.** APIs change; this skill is a gate, a contract, and a retrieval map—not a full manual.
SKILL.md:66来自说明文档打开原文件
Fetch the page before implementing. Installed `@next` types win over guesses.
references/api-quick-ref.md:5来自说明文档打开原文件
Fetch the page for the task before implementing and check signatures against installed `@cloudflare/sandbox@next` types.
会不会偷偷改推广链接或收款方?检查是否强制替换推广链接或收款对象,同时要求隐瞒更改。未发现风险

Skill 逻辑拆解

4 个说明模块

此 Skill 仅面向使用 `@cloudflare/sandbox@next` 预览版的新项目,并要求先核对 npm 依赖与容器镜像处于同一版本线;稳定版应用和迁移任务会被转交给其他 Skill。

查看原文
SKILL.md:20来自说明文档打开原文件
| ----- | ---------- || npm dependency | `@cloudflare/sandbox@next` (or another preview tag) || Container image | Same line (e.g. `cloudflare/sandbox:next`, `next-python`) |
SKILL.md:25来自说明文档打开原文件
| ------------ | ------ || Default `@cloudflare/sandbox` (no `@next`) | **Stop.** Load **`sandbox-stable`**. Do not apply this skill’s APIs. || User wants to port stable → `@next` | **Stop.** Load **`sandbox-migrate-to-next`**. || Self-deployed **bridge** only | Bridge is **not** on the 1.0 preview line yet. Keep bridge on stable package + image. [Bridge (stable)](https://developers.cloudflare.com/sandbox/bridge/) |Never mix an `@next` Worker package with a stable container image (or the reverse).

它指导代理通过 Sandbox SDK 在隔离容器中启动任意 argv 进程,并说明启动、等待、终止和交互式终端的行为;示例仅执行固定的 Python 算术命令。

查看原文
SKILL.md:35来自说明文档打开原文件
- `sandbox.exec(argv)` takes an **argv** list and resolves when the process **starts**. It returns a **handle**, not a finished command result.- Collect results with handle methods: `output()`, `logs()`, `waitForExit()`, `waitForPort()`, `waitForLog()`, `kill(signal?)`.- No implicit shell. Shell syntax needs an explicit shell, e.g. `["/bin/bash", "-lc", script]`.- Each launch is independent. A `cd` / `export` in one `exec` is not visible to the next. Pass `cwd` and `env` per launch, or one shell script.- Process handles have **no stdin**. Interactive use → terminals (`createTerminal` + `connect`).- Local wait `timeout` / `AbortSignal` cancel the **wait only**. They do not kill the process. Use `kill` or `exec`’s remote `timeout`.- `getProcess` / `listProcesses` / `getTerminal` / `listTerminals` do **not** start a container; they return `null` / `[]` when none is up.
SKILL.md:54来自说明文档打开原文件
const sandbox = getSandbox(env.Sandbox, "user-123");const process = await sandbox.exec(["python3", "-c", "print(2 + 2)"]);const result = await process.output({ encoding: "utf8" });// result.stdout, result.exitCode```

此 Skill 明确禁止把实时凭据放入沙箱环境变量,建议凭据留在 Worker,并在沙箱访问外部 API 时使用出站处理器。

查看原文
SKILL.md:43来自说明文档打开原文件
- Process and terminal IDs belong to the **current container**, not forever to a sandbox ID. For work that must survive replace, store the full job (argv, cwd, env, app state)—not only an id.- Non-secret config only in `setEnvVars` / launch `env`. Live credentials stay in the Worker; use outbound handlers when the sandbox calls external APIs.- Do **not** invent removed stable APIs (`gitCheckout` on core, string-`exec` completion, session execution, `sandbox.terminal(request)`).
SKILL.md:89来自说明文档打开原文件
- Lockfile and Dockerfile on the **same** `@next` line  - Typecheck against installed `@next` types  - No live secrets in sandbox env  - Production preview hostnames need wildcard DNS on a custom domain when using those URL patterns  

实现前会查询外部 Cloudflare 文档和 GitHub `next` 分支示例,并以本地安装的 `@next` 类型作为签名校验依据。

查看原文
SKILL.md:64来自说明文档打开原文件
## 3. Retrieve — open the doc for the taskFetch the page before implementing. Installed `@next` types win over guesses.
SKILL.md:83来自说明文档打开原文件
| Files, mounts, backups, ports, tunnels, `proxyToSandbox` | Main docs for shared surfaces (ignore stable-only session/transport/`sandbox.terminal`): [Files](https://developers.cloudflare.com/sandbox/api/files/) · [Storage / mounts](https://developers.cloudflare.com/sandbox/api/storage/) · [Ports](https://developers.cloudflare.com/sandbox/api/ports/) · [Tunnels](https://developers.cloudflare.com/sandbox/api/tunnels/) · [Backups](https://developers.cloudflare.com/sandbox/api/backups/) · [Outbound traffic](https://developers.cloudflare.com/sandbox/guides/outbound-traffic/) · [Expose services](https://developers.cloudflare.com/sandbox/guides/expose-services/) · [Production](https://developers.cloudflare.com/sandbox/guides/production-deployment/) || Example apps | [examples on `next`](https://github.com/cloudflare/sandbox-sdk/tree/next/examples) || Still on stable package | **`sandbox-stable`** · [Main Sandbox docs](https://developers.cloudflare.com/sandbox/) || Porting an existing stable app | **`sandbox-migrate-to-next`** · [Migrate](https://developers.cloudflare.com/sandbox/1-0-preview/migrate/) |
references/examples.md:3来自说明文档打开原文件
Pointers only—not a full catalog. Prefer the repo tree and docs.https://github.com/cloudflare/sandbox-sdk/tree/next/examples
从这里开始 · 工作说明SKILL.md
sandbox-next
连线表示工作说明包含的模块,不是实际运行顺序。点击模块可查看原文。

文件引用关系图

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

检查范围与遗漏

逐文件查看涉及的内容

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

  • SKILL.md已纳入全文
  • references/api-quick-ref.md已纳入全文
  • references/examples.md已纳入全文

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

  • SKILL.md工作说明
  • references/api-quick-ref.md配套文件
  • references/examples.md配套文件

代码和说明中提到的操作

连接外部网站
SKILL.md:8来自说明文档打开原文件
Isolated Linux environments on [Cloudflare Containers](https://developers.cloudflare.com/containers/), driven from Workers.
SKILL.md:27来自说明文档打开原文件
| User wants to port stable → `@next` | **Stop.** Load **`sandbox-migrate-to-next`**. || Self-deployed **bridge** only | Bridge is **not** on the 1.0 preview line yet. Keep bridge on stable package + image. [Bridge (stable)](https://developers.cloudflare.com/sandbox/bridge/) |
SKILL.md:31来自说明文档打开原文件
Skills install: [Agent setup](https://developers.cloudflare.com/agent-setup/) · [cloudflare/skills](https://github.com/cloudflare/skills)
运行命令
SKILL.md:37来自说明文档打开原文件
- Collect results with handle methods: `output()`, `logs()`, `waitForExit()`, `waitForPort()`, `waitForLog()`, `kill(signal?)`.- No implicit shell. Shell syntax needs an explicit shell, e.g. `["/bin/bash", "-lc", script]`.- Each launch is independent. A `cd` / `export` in one `exec` is not visible to the next. Pass `cwd` and `env` per launch, or one shell script.
读取密钥或账号配置
SKILL.md:43来自说明文档打开原文件
- Process and terminal IDs belong to the **current container**, not forever to a sandbox ID. For work that must survive replace, store the full job (argv, cwd, env, app state)—not only an id.- Non-secret config only in `setEnvVars` / launch `env`. Live credentials stay in the Worker; use outbound handlers when the sandbox calls external APIs.- Do **not** invent removed stable APIs (`gitCheckout` on core, string-`exec` completion, session execution, `sandbox.terminal(request)`).
references/api-quick-ref.md:15来自说明文档打开原文件
| Set sandbox or per-launch environment | [Environment variables](https://developers.cloudflare.com/sandbox/1-0-preview/environment/) || Keep external API credentials in the Worker | [Outbound traffic](https://developers.cloudflare.com/sandbox/guides/outbound-traffic/) || Handle startup failures, interrupted work, stale handles, or local wait cancellation | [Errors and recovery](https://developers.cloudflare.com/sandbox/1-0-preview/errors/) and [Errors API](https://developers.cloudflare.com/sandbox/1-0-pre 
读取了多少行
128
文件校验值(用于核对版本)
ea54b955dbc608f9ec8916c8543e9717a12d15d145ab3dbf66ed0578f120e31e