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

Opencli Browser Skill 安全审计

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

Use when an agent needs to drive a real Chrome window via opencli — inspect a page, fill forms, click through logged-in flows, or extract data ad-hoc. Covers the selector-first target contract, compound form fields, stale-ref handling, network capture, and the agent-native envelopes the CLI returns. Not for writing adapters — see opencli-adapter-author for that.

第三方安全检查结论

先别安装或运行

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

已登录页面的完整 API 响应会写入持久网络缓存

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

Skill 优先建议捕获网络数据,支持输出单个或全部完整响应正文,并将缓存保存在 `~/.opencli/cache/browser-network/`,默认 TTL 为 24 小时。响应可能包含个人资料、消息、会话令牌或业务数据。

为什么需要注意

敏感响应可能同时出现在代理输出和本地缓存中,之后被其他进程、备份或后续会话读取。

该 Skill 建议优先捕获页面 API,并允许读取单个或全部完整响应正文;捕获内容会缓存在用户主目录下,默认 TTL 为 24 小时。若在已登录标签页中使用,正文可能含账户或业务数据。源码没有证明一定含会话令牌,也没有说明缓存的权限、加密或清理方式,但持久保存敏感响应是可信风险。用户可限制 `network --raw`、缩短 TTL,并要求说明缓存保护和删除机制。

SKILL.md:71来自说明文档打开原文件
9. **`eval` is read-only.** Wrap the JS in an IIFE and return JSON. If you need to *change* the page, use the structured `click` / `type` / `select` / `keys` commands instead — they produce structured output and fingerprints, `eval` does not.10. **Prefer `network` to screen-scraping.** If a page you care about fetches its data from a JSON API, the API is almost always more reliable than scraping the rendered DOM. Capture once, inspect the shape, then `--detail <key>` the body you need.
查看另外 2 个位置
SKILL.md:199来自说明文档打开原文件
```bashbrowser network                        # shape preview + cache key listbrowser network --detail <key>         # full body for one cached entrybrowser network --filter "field1,field2"  # keep only entries whose body shape contains ALL fields as path segmentsbrowser network --all                  # include static resources (usually noise)browser network --raw                  # full bodies inline — large; use sparinglybrowser network --ttl <ms>             # cache TTL (default 24h)```List entries look like `{key, method, status, url, ct, size, shape, body_truncated?}`. Detail envelope is `{key, url, method, status, ct, size, shape, body, body_truncated?, body_full_size?, body_truncation_reason}`. Cache lives in `~/.opencli/cache/browser-network/` so you can re-inspect without re-triggering the request.
SKILL.md:207来自说明文档打开原文件
List entries look like `{key, method, status, url, ct, size, shape, body_truncated?}`. Detail envelope is `{key, url, method, status, ct, size, shape, body, body_truncated?, body_full_size?, body_truncation_reason}`. Cache lives in `~/.opencli/cache/browser-network/` so you can re-inspect without re-triggering the request.
高风险

示例会把登录密码或支付字段值放入命令及输出

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

登录示例把密码作为 `type` 命令的明文参数;跨域 iframe 示例读取银行卡号字段值,而 `eval` 的字符串结果会直接写到标准输出。若替换为真实秘密,这些值可能进入代理对话、命令记录、进程参数或日志。

为什么需要注意

账户密码或支付信息可能暴露给代理服务、日志查看者或同一设备上的其他进程。

登录段落是示例,使用虚构站点、邮箱和密码,因此本身不泄露真实凭据;但它示范把密码放进命令参数。另一个示例读取跨域支付 iframe 的卡号值,而文档说明字符串结果原样写到 stdout。若代理把这些模式用于真实秘密,秘密可能暴露在进程参数、终端输出或日志中。用户可要求敏感字段不出现在命令行或 `eval` 输出中,并使用不会回显秘密的输入机制。

SKILL.md:193来自说明文档打开原文件
- **`web read --url <url>`** — One-shot Markdown reader for arbitrary pages. It expands relevant same-origin iframes by default, so old iframe-shell sites work better than with a top-document-only scrape. Use `--frames all-same-origin` when completeness matters more than Markdown noise. For AJAX shell pages use `opencli web read --url <url> --wait-for "<selector>" --wait-until networkidle --diagnose`; diagnostics show frame URLs, empty containers, and API-like XHRs. If the value you need is table/API data, switch to `browser network` or a dedicated adapter instead of relying on Markdown.- **`browser eval <js> [--frame N]`** — Run an expression in the page (or in a cross-origin frame via `--frame`). Wrap in an IIFE and return JSON. Read-only: no `document.forms[0].submit()`, no clicks, no navigations. If the result is a string, stdout is the raw string; otherwise it's JSON.- **`browser extract [--selector <css>] [--chunk-size N] [--start N]`** — Markdown extraction of long-form content with a continuation cursor. Returns `{url, title, selector, total_chars, chunk_size, start, end, next_start_char, content}`. Loop on `next_start_char` until it is `null`. Auto-scopes to `<main>`/`<article>`/`<body>` if you don't pass `--selector`.
查看另外 3 个位置
SKILL.md:326来自说明文档打开原文件
```bashopencli browser login open "https://example.com/login"opencli browser login state                          # find [N] for email, password, submitopencli browser login type 4 "me@example.com"opencli browser login type 5 "hunter2"opencli browser login get value 4                    # verify (autocomplete can eat chars)opencli browser login click 6                        # submitopencli browser login wait selector "[data-testid=account-menu]" --timeout 15000
SKILL.md:399来自说明文档打开原文件
```bashopencli browser checkout frames# -> [{"index": 0, "url": "https://checkout.stripe.com/...", ...}]opencli browser checkout eval "(() => document.querySelector('input[name=cardnumber]')?.value)()" --frame 0```
SKILL.md:325来自说明文档打开原文件
```bashopencli browser login open "https://example.com/login"opencli browser login state                          # find [N] for email, password, submitopencli browser login type 4 "me@example.com"opencli browser login type 5 "hunter2"opencli browser login get value 4                    # verify (autocomplete can eat chars)opencli browser login click 6                        # submitopencli browser login wait selector "[data-testid=account-menu]" --timeout 15000
中风险

文件上传命令可把本地文件直接交给网站

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

`browser upload` 通过 CDP 接受本地路径并附加文件。虽然说明要求不要编造路径并尊重文件类型,但没有要求在上传前向用户显示完整路径、目标网站和文件清单并再次确认。

为什么需要注意

选错路径或目标控件时,私人文档、图片或其他本地资料可能被上传到第三方账户或网站。

上传命令会通过 CDP 把指定本地路径附加到网页文件输入框,这是对用户文件的真实披露操作。文档要求不要编造路径并遵守 `accept`,但没有要求在上传前核对目标域名、完整路径和文件清单,或取得单独确认。因此,若代理选错页面、控件或文件,内容可能交给错误网站。用户可要求上传前展示目标域名和文件清单,并只允许用户明确指定的路径。

SKILL.md:165来自说明文档打开原文件
| `browser uncheck [target] [--role R --name N] [--nth N]` | Ensures checkbox/aria-checked control is unchecked. Radio buttons cannot be unchecked directly; select another radio in the group instead. || `browser upload [target] <file...> [--role R --name N] [--nth N]` | Attaches local file path(s) to an `input[type=file]` via CDP. With semantic flags, omit `target` and pass files as positionals. Returns `{uploaded, files, file_names, target, matches_n, match_level, multiple?, accept?}`. || `browser drag [source] [target] [--from-role R --from-name N] [--to-role R --to-name N] [--from-nth N] [--to-nth N]` | Mouse-based drag from one resolved element center to another. Works for mouse-listener drag libraries; native HTML5 `dataTransfer` drops may need a site-specific fallback. Returns `{dragged, source, target, source_matches_n, target_matches_n, ...}`. |
查看另外 1 个位置
SKILL.md:272来自说明文档打开原文件
Do not invent file paths. Upload is done via the normal click flow — respect `accept` when telling the user what to upload.
会不会删除文件或一直在后台运行?检查是否大范围删除文件、改写磁盘,或设置自动启动。未发现风险
会不会绕过安全保护?检查是否跳过网站安全验证、开放过多文件权限,或取消操作前的确认。发现 3 项风险
高风险

绑定被视为对已登录标签页的持续控制授权

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

说明把一次 `bind` 直接解释为代理对该标签页的“明确所有权”,允许导航,而且绑定没有空闲超时。一次有限任务因此可能留下持续到手动解绑、关闭窗口或守护进程重启的控制通道。

为什么需要注意

如果代理继续操作或后续任务复用该会话,它可以在用户账户登录状态下浏览、填写或点击页面,可能改变账户数据或触发未单独确认的操作。

该 Skill 明确建议把已登录或 SSO 标签页绑定给代理,并把绑定解释为允许导航的“明确代理所有权”。绑定没有空闲自动关闭机制,会持续到解绑、标签页或窗口关闭、或守护进程重启。因此,若用户只授权一次短任务但代理未解绑,后续仍可能控制该已登录标签页。用户可要求每次任务后必须执行 `unbind`,并限制绑定期间允许访问的站点和操作。

SKILL.md:30来自说明文档打开原文件
- Owned browser sessions keep a tab lease alive between calls. Release it with `opencli browser <session> close` or let the idle timeout expire.- `opencli browser <session> bind` binds the Chrome tab you already have open to that session. Use this for logged-in pages, SSO flows, or pages you manually positioned before handing control to the agent.- `--window foreground|background` (or `OPENCLI_WINDOW=foreground|background`) chooses whether OpenCLI creates/focuses a foreground browser window or uses a background browser window for owned sessions.
查看另外 3 个位置
SKILL.md:45来自说明文档打开原文件
Navigation is allowed on bound sessions because the session now represents explicit agent ownership of that tab. Tab mutation (`tab new`, `tab select`, `tab close`) is still blocked for bound sessions. Use an owned session when you want OpenCLI to manage tab lifecycle.Bound sessions have no OpenCLI idle-close timer; the binding lasts until `unbind`, tab close, window close, or daemon restart.
SKILL.md:43来自说明文档打开原文件
Binding never owns the user window and never closes the user tab. It fails closed if the tab is closed or becomes non-debuggable. Re-run `opencli browser <session> bind` when you switch to a different real tab.Navigation is allowed on bound sessions because the session now represents explicit agent ownership of that tab. Tab mutation (`tab new`, `tab select`, `tab close`) is still blocked for bound sessions. Use an owned session when you want OpenCLI to manage tab lifecycle.
SKILL.md:47来自说明文档打开原文件
Bound sessions have no OpenCLI idle-close timer; the binding lasts until `unbind`, tab close, window close, or daemon restart.
高风险

故障排查要求开放远程调试或临时禁用密码管理器扩展

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

Skill 建议用远程调试端口启动 Chrome,并在连接失败时临时禁用 1Password 或其他使用 CDP 的扩展。这会降低浏览器原有的安全隔离或密码保护能力。

为什么需要注意

在调试端口可被其他本地进程访问或保护扩展被关闭期间,已登录页面、Cookie、表单内容和浏览器操作可能更容易被控制或观察。

故障排查确实建议以远程调试端口启动 Chrome,或临时禁用 1Password 等扩展。两项操作都改变用户浏览器的安全状态:调试接口可能扩大可控制范围,禁用密码管理器会暂时移除其保护或提示。源码未说明端口绑定范围、访问控制或恢复扩展的步骤,因此实际严重性取决于 OpenCLI/Chrome 配置。用户可要求使用隔离的浏览器配置、仅本机调试,并在完成后关闭调试实例和恢复扩展。

SKILL.md:21来自说明文档打开原文件
Until `doctor` is green, nothing else will work. Typical failures: Chrome not running, extension not installed, debug port blocked by 1Password / other extensions. The doctor output tells you which.
查看另外 1 个位置
SKILL.md:428来自说明文档打开原文件
|---------|-----|| `opencli doctor` red: "Browser not connected" | Start Chrome with `--remote-debugging-port=9222`, or install the extension from the [Chrome Web Store](https://chromewebstore.google.com/detail/opencli/ildkmabpimmkaediidaifkhjpohdnifk). || `attach failed: chrome-extension://...` | Disable 1Password / other CDP-hungry extensions temporarily. || `selector_not_found` right after `state` | Page mutated. `wait selector "..."` then retry. |
中风险

声明的文件权限超出浏览器操作所需范围

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

元数据除限制为 `opencli` 的 Bash 外,还允许通用的 Read、Edit 和 Write。主体目的描述是控制浏览器,没有为任意编辑或写入用户文件提供对应需求或范围。

为什么需要注意

如果宿主依据该声明授予权限,启用 Skill 的代理可能读取或永久修改浏览器任务无关的可访问文件;上传功能还可利用读取权限取得这些文件。

元数据主动授予通用 `Read`、`Edit` 和 `Write`,而描述的核心用途是通过受限的 `opencli` Bash 命令控制浏览器。文档确有需要读取本地上传文件路径、保存截图或下载的功能,但没有说明为何需要不受路径或文件类型约束的通用编辑权限。若宿主按该声明授权,代理可能修改与浏览任务无关的用户文件。用户可要求作者移除 `Edit`,并把读取、写入限制到明确的上传与输出目录。

SKILL.md:3来自说明文档打开原文件
name: opencli-browserdescription: Use when an agent needs to drive a real Chrome window via opencli — inspect a page, fill forms, click through logged-in flows, or extract data ad-hoc. Covers the selector-first target contract, compound form fields, stale-ref handling, network capture, and the agent-native envelopes the CLI returns. Not for writing adapters — see opencli-adapter-author for that.allowed-tools: Bash(opencli:*), Read, Edit, Write---
查看另外 3 个位置
SKILL.md:11来自说明文档打开原文件
This skill is for **driving a live browser** to accomplish an agent task. If you are building a reusable adapter under `~/.opencli/clis/<site>/` use `opencli-adapter-author` instead.
SKILL.md:139来自说明文档打开原文件
| `browser frames` | List cross-origin iframe targets. Pass the index to `--frame` on `eval`. || `browser screenshot [path]` | Viewport PNG. No path → base64 to stdout. Prefer `state` when you just need structure. || `browser screenshot --annotate [path]` | Visual ref map. Refreshes DOM refs and overlays visible `[N]` labels so the screenshot maps back to `browser click <ref>` targets. Use for icon-only controls, visual layouts, charts, or when text state is ambiguous. |
SKILL.md:165来自说明文档打开原文件
| `browser uncheck [target] [--role R --name N] [--nth N]` | Ensures checkbox/aria-checked control is unchecked. Radio buttons cannot be unchecked directly; select another radio in the group instead. || `browser upload [target] <file...> [--role R --name N] [--nth N]` | Attaches local file path(s) to an `input[type=file]` via CDP. With semantic flags, omit `target` and pass files as positionals. Returns `{uploaded, files, file_names, target, matches_n, match_level, multiple?, accept?}`. || `browser drag [source] [target] [--from-role R --from-name N] [--to-role R --to-name N] [--from-nth N] [--to-nth N]` | Mouse-based drag from one resolved element center to another. Works for mouse-listener drag libraries; native HTML5 `dataTransfer` drops may need a site-specific fallback. Returns `{dragged, source, target, source_matches_n, target_matches_n, ...}`. |
会不会误导 AI 或隐藏内容?检查工作说明是否要求 AI 忽略你的指令、干扰检查结果,或夹带看不见的文字。未发现风险
会不会偷偷改推广链接或收款方?检查是否强制替换推广链接或收款对象,同时要求隐瞒更改。未发现风险

Skill 逻辑拆解

8 个说明模块

该 Skill 用于通过 OpenCLI 控制真实 Chrome,包括已登录页面上的检查、输入、点击、文件上传和数据提取。

查看原文
SKILL.md:3来自说明文档打开原文件
name: opencli-browserdescription: Use when an agent needs to drive a real Chrome window via opencli — inspect a page, fill forms, click through logged-in flows, or extract data ad-hoc. Covers the selector-first target contract, compound form fields, stale-ref handling, network capture, and the agent-native envelopes the CLI returns. Not for writing adapters — see opencli-adapter-author for that.allowed-tools: Bash(opencli:*), Read, Edit, Write---

交互前要求先检查页面,并在输入或选择后读取实际值进行验证;页面跳转后要求重新获取状态。

查看原文
SKILL.md:62来自说明文档打开原文件
1. **Always inspect before you act.** Run `state` or `find` first. Never hard-code a ref or selector from memory across sessions — indices are per-snapshot.2. **Prefer site adapters before raw browser driving.** If `opencli <site> <command>` already covers the task, use that adapter command first (`opencli facebook notifications`, `opencli reddit read`, `opencli chatgpt model <level>`, etc.). Use `opencli browser ...` only for gaps, debugging, or one-off UI flows the adapter does not expose.3. **Prefer numeric ref over CSS once you have it.** Numeric refs survive mild DOM shifts because the CLI fingerprints each tagged element. A CSS selector written by hand will break the first time the site re-renders.4. **Read `match_level` after every write.** `exact` = all good. `stable` = the element is the same but some soft attrs drifted — your action still applied. `reidentified` = the original ref was gone and the CLI found a unique replacement; double-check you hit the right element.5. **Use the `compound` field for form controls.** Do not regex-guess a date format, do not `state` twice to get the full `<select>` options list. The compound envelope has the format string, full option list up to 50, `options_total` for overflow, and `accept`/`multiple` for `<input type=file>`.6. **Verify writes that matter.** After `type <target> <text>`, run `get value <target>`. After `select`, run `get value`. Autocomplete widgets, React controlled inputs, and masked fields all silently eat characters. The CLI cannot detect this for you.7. **`state` → action → `state` after a page change.** Navigations, form submits, and SPA route changes invalidate refs. Take a fresh snapshot. Do not reuse refs from before the transition.8. **Chain with `&&` when reusing freshly parsed refs.** A chained sequence runs in one shell so the ref you just read from output can be passed directly to the next command. Separate shell invocations keep the named browser session, but any shell-local variables or copied refs from the previous command can go stale after page changes.

网络功能可读取页面请求的完整响应正文,并把捕获结果缓存到用户主目录,默认有效期为 24 小时。

查看原文
SKILL.md:199来自说明文档打开原文件
```bashbrowser network                        # shape preview + cache key listbrowser network --detail <key>         # full body for one cached entrybrowser network --filter "field1,field2"  # keep only entries whose body shape contains ALL fields as path segmentsbrowser network --all                  # include static resources (usually noise)browser network --raw                  # full bodies inline — large; use sparinglybrowser network --ttl <ms>             # cache TTL (default 24h)```List entries look like `{key, method, status, url, ct, size, shape, body_truncated?}`. Detail envelope is `{key, url, method, status, ct, size, shape, body, body_truncated?, body_full_size?, body_truncation_reason}`. Cache lives in `~/.opencli/cache/browser-network/` so you can re-inspect without re-triggering the request.

绑定现有标签页后,Skill 允许导航但禁止标签页创建、选择和关闭;绑定不会自动空闲关闭。

查看原文
SKILL.md:43来自说明文档打开原文件
Binding never owns the user window and never closes the user tab. It fails closed if the tab is closed or becomes non-debuggable. Re-run `opencli browser <session> bind` when you switch to a different real tab.Navigation is allowed on bound sessions because the session now represents explicit agent ownership of that tab. Tab mutation (`tab new`, `tab select`, `tab close`) is still blocked for bound sessions. Use an owned session when you want OpenCLI to manage tab lifecycle.Bound sessions have no OpenCLI idle-close timer; the binding lasts until `unbind`, tab close, window close, or daemon restart.
从这里开始 · 工作说明SKILL.md
opencli-browser
连线表示工作说明包含的模块,不是实际运行顺序。点击模块可查看原文。 另有 6 个章节,可在原文件中查看。
文件与检查记录1 个文件

检查范围与遗漏

逐文件查看涉及的内容

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

  • SKILL.md已纳入全文

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

  • SKILL.md工作说明

代码和说明中提到的操作

运行命令
SKILL.md:4来自说明文档打开原文件
description: Use when an agent needs to drive a real Chrome window via opencli — inspect a page, fill forms, click through logged-in flows, or extract data ad-hoc. Covers the selector-first target contract, compound form fields, stale-ref h allowed-tools: Bash(opencli:*), Read, Edit, Write---
SKILL.md:17来自说明文档打开原文件
```bashopencli doctor
SKILL.md:35来自说明文档打开原文件
```bashopencli browser gmail bind
连接外部网站
SKILL.md:28来自说明文档打开原文件
- `opencli browser *` commands require a `<session>` positional immediately after `browser`. Use the same session name for a multi-step flow; use a different name to isolate parallel browser work.- Use a stable session name for any multi-command or human-paced browser workflow. Example: `opencli browser fb-yaya-warmup open https://example.com`, then reuse `opencli browser fb-yaya-warmup state`, `extract`, `click`, etc.- Owned browser sessions keep a tab lease alive between calls. Release it with `opencli browser <session> close` or let the idle timeout expire.
SKILL.md:310来自说明文档打开原文件
```bashopencli browser hn open "https://news.ycombinator.com" \  && opencli browser hn state \
SKILL.md:326来自说明文档打开原文件
```bashopencli browser login open "https://example.com/login"opencli browser login state                          # find [N] for email, password, submit
读取了多少行
445
文件校验值(用于核对版本)
ac0de7d5b6f6c60517671fdad24f5d132d646fa54ca284a9fddb41820f6793e1