Skip to content

完成五款浏览器七种方法 Web Fetch 全量评测与独立报告 - #6

Merged
lanyue-llk merged 19 commits into
mainfrom
codex/headless-webfetch-comparison
Sep 8, 2026
Merged

lanyue-llk merged 19 commits into
mainfrom
codex/headless-webfetch-comparison

Conversation

@lanyue-llk

@lanyue-llk lanyue-llk commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

结果

  • 完成 5 类浏览器、7 种方法在 150 个任务上的 1050 次主评测唯一调用;另用预先声明的 20 个任务执行 140 次同窗测速。评测任务每方法仅调用一次,失败不重试。
  • 方法:Kitesurf、Lightpanda、Obscura、Chromium、Moli 1.0.6、Moli 1.1.1、Moli 1.1.3。三个 Moli 版本均作为独立方法。
  • 综合通过:Moli 1.1.1 134/150、Moli 1.0.6 133/150、Moli 1.1.3 133/150、Chromium 125/150、Lightpanda 119/150、Obscura 117/150、Kitesurf 112/150。
  • 普通网页使用各方法最快的正式正文路线;三个 Moli 版本均用 fetch --dump markdown。直接 PDF、DOCX、图片和视频 URL 均改用裸 fetch <url>,正文任务的本地解析计入耗时,文件任务直接验收原始字节。
  • 8 个会频繁变化的全文任务替换为带固定版本标识的 Wikipedia 修订、RFC、W3C Recommendation 和 Git commit README。七种方法只重测这 8 个替换任务;其他 142 个任务保留原始调用及耗时。
  • 动态任务仍按稳定文字锚点与结构契约验收,不把实时名单、价格或排序固定为历史答案。全文指标仅在存在完整、同范围参考时计算。
  • Codex 独立强推理代理逐条复核主结果 1050/1050 和测速结果 140/140;自动判定分歧 0,未决 0。历史格式误判通过统一评分规则纠正,不手工翻转单条结果。
  • 报告发布到独立站点 bWkRP157EtF6,未覆盖旧报告 UeZE1vfcEOrM。账号页只列变量名与官方获取入口,不包含正式密钥。
  • 测量输出、执行清单、provider 原始产物、核验分片、发布凭据和回执均未提交。

公平性与测速边界

  • 对齐输入 URL、任务、评测集、验收规则、端到端 45 秒预算和最终交付物,不强制对齐中间接口。
  • 本地与远程方法都从调用开始计时,包含网络、远端处理、浏览器渲染、下载和形成最终交付物所需的本地转换。
  • 速度榜仅使用 20 个预声明任务中 7 种方法全部成功的 8 个共同任务,属于小样本探索;P95 只作样本诊断,不外推长期尾延迟。

验证

  • make test:574 项 unittest 通过(38 项按缺少持久化通用基准产物跳过);Browser Use 66 项通过(2 项跳过);报告 UI 和加载器测试通过。
  • make fixture-smoke:配置校验与端到端 fixture 运行通过。
  • make report-check:150 个任务 / 1050 条主结果 / 7 种方法;1218 个 HTML 页面;0 个本地断链;表格、排序、筛选和修订绑定通过。
  • 最终发布包:3975 个虚拟文件;1050 个计分输出与本地原字节一致;3 份第三方附加 HTML 共 36 处脱敏;凭据扫描通过。
  • 远端版本 ver_4b03b4533d0c44fba2f7ba381671257f:84/84 个物理文件与最终提交包一致,上传字节校验通过。

报告:https://artifact-hub.dev.lexmount.net/v/pkLbADh7bIol3LWfCla_flFgeb6sepW0#page=index.html

kevin added 8 commits September 3, 2026 22:57
…ch-comparison

# Conflicts:
#	AGENTS.md
#	harness/web_fetch/providers/cloudflare.py
#	harness/web_fetch/report.py
#	harness/web_fetch/report_build.py
#	harness/web_fetch/report_explainer.py
#	harness/web_fetch/report_interfaces.py
#	harness/web_fetch/runner.py
#	harness/web_fetch/stable_tasks.py
#	scripts/build_report.py
@github-actions

github-actions Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

PR Review in Progress

  • Gather context and read key changed files
  • Review for bugs and security issues
  • Post findings

View job run

@github-actions

github-actions Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

Claude finished @lanyue-llk's task in 3m 39s —— View job


PR Review

  • Gather context
  • Review key changed files for bugs and security issues
  • Post findings

Two actual issues found; everything else looks correct.


Finding 1 — XSS via unescaped WEBFETCH_REPORT_PUBLIC_URL in published HTML

scripts/package_artifact_hub.py:171-172

privacy_href=(HUB+'#page=guide/index.html' if name=='guide/article.html' else ...)
notice='...<a href="'+privacy_href+'">...</a>...'
text=re.sub(r'(<body\b[^>]*>)',lambda match:match[0]+notice,text,count=1)

HUB is read from WEBFETCH_REPORT_PUBLIC_URL with no HTML escaping before it's injected into the href attribute of every published HTML page. If the env var contains " or > (e.g. https://example.com/">malicious<script>...), the attribute is terminated and arbitrary HTML is injected into all pages in the bundle. This applies to every .html file that goes through the packaging path.

Fix: HTML-escape privacy_href before string concatenation, or use a templating library:

from html import escape
privacy_href_attr = escape(privacy_href, quote=True)
notice = f'...<a href="{privacy_href_attr}">...</a>...'

Fix this →


Finding 2 — TOCTOU allows symlink injection in save_token backup path

harness/web_fetch/artifact_auth.py:30-41

if destination.is_symlink():          # check
    raise ValueError(...)
try:
    descriptor = os.open(destination, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o600)
except FileExistsError:               # triggered by a symlink placed after check above
    if destination.read_text().strip() != token:
        ...
        stream.write(destination.read_bytes())   # follows the attacker symlink

On Linux, O_CREAT | O_EXCL raises EEXIST for an existing symlink (even a dangling one), so an adversary who can write to ~/.config/artifact-hub/ and wins the race between is_symlink() and os.open() will land in the FileExistsError branch. destination.read_bytes() then follows the symlink, and the contents are written into the backup file (token.backup-<uuid>). This gives an unprivileged process a read primitive over arbitrary files readable by the current user.

The risk is limited to multi-user environments where another local user can reach the credential directory, and requires winning a tight race. The fix is to remove the pre-check and instead use O_NOFOLLOW in the os.open call:

try:
    descriptor = os.open(destination, os.O_WRONLY | os.O_CREAT | os.O_EXCL | os.O_NOFOLLOW, 0o600)
except FileExistsError:
    # destination.stat() here (not read_text) to check it's a regular file before reading

Fix this →


No other bugs or security issues found. The subprocess calls in headless_worker.py use list-form commands (no shell injection), validate_http_url is applied consistently at the boundary, and contained_path correctly prevents path traversal.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Claude review completed. Review run: https://github.com/lexmount/browser-eval/actions/runs/33864056223. Please check Claude's inline feedback and summary comment for details.

@github-actions

github-actions Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

Claude finished @lanyue-llk's task in 1m 52s —— View job


PR Review

  • Read CLAUDE.md and gather context
  • Review key changed files for bugs and security issues
  • Post findings

Both issues flagged in the previous review have been addressed in this update.

Finding 1 (XSS in scripts/package_artifact_hub.py) — Fixed. html.escape(privacy_href, quote=True) is now applied before string concatenation.

Finding 2 (TOCTOU symlink injection in harness/web_fetch/artifact_auth.py) — Fixed. O_NOFOLLOW is now used atomically in both os.open calls, and stat.S_ISREG() verifies the file type before reading in the FileExistsError branch.


No new bugs or security issues found in the added code. Subprocess calls in headless_worker.py and providers/headless.py use list-form commands (no shell injection). validate_http_url is applied at both the provider and worker boundaries. The publication_privacy.py redaction path correctly rejects hidden files and raises on credentials found outside supplemental HTML. The backup filename in artifact_auth.py uses uuid4().hex, making the path unpredictable.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Claude review completed. Review run: https://github.com/lexmount/browser-eval/actions/runs/33864786570. Please check Claude's inline feedback and summary comment for details.

@lanyue-llk lanyue-llk changed the title 完成五种浏览器 Web Fetch 全量评测与独立报告 完成五款浏览器六种方法 Web Fetch 全量评测与独立报告 Sep 7, 2026
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

Claude Code is working…

I'll analyze this and get back to you.

View job run

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

Claude Code is working…

I'll analyze this and get back to you.

View job run

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

Claude Code is working…

I'll analyze this and get back to you.

View job run

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

PR Review

  • Review PR diff for bugs and security issues
  • Post findings

View job run

@lanyue-llk lanyue-llk changed the title 完成五款浏览器六种方法 Web Fetch 全量评测与独立报告 完成五款浏览器七种方法 Web Fetch 全量评测与独立报告 Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Claude finished @lanyue-llk's task in 5m 1s —— View job


PR Review

  • Review PR diff for bugs and security issues
  • Post findings

No new bugs or security issues found.

Both previously reported issues are confirmed fixed:

  • Finding 1 (XSS): WEBFETCH_REPORT_PUBLIC_URL is only injected into HTML via escape(evidence_url(path), quote=True) in report_explainer.py:90; package_artifact_hub.py imports HUB but does not use it to construct page HTML.
  • Finding 2 (TOCTOU): artifact_auth.py now uses O_NOFOLLOW atomically in both os.open calls, with stat.S_ISREG() verification before reading in the FileExistsError branch. The backup path uses uuid4().hex making pre-planting infeasible, and the O_CREAT | O_EXCL combination on Linux fails with EEXIST even on a dangling symlink.

Reviewed in this round:

  • harness/web_fetch/providers/headless.py — subprocess calls use list form; validate_http_url applied before any URL leaves the process boundary; start_new_session=True with os.killpg correctly reaps the full process tree.
  • scripts/headless_worker.py — URL re-validated at worker entry; cli_command builds list-form argv; stdout/stderr capped at 40 MB in the parent before json.loads.
  • harness/web_fetch/publication_privacy.py — credential patterns cover ahp_, gh[pousr]_, sk-*, and PEM headers; any match outside supplemental HTML raises rather than redacts.
  • scripts/package_artifact_hub.py — symlink guard added before file read; all values interpolated into data-file/data-record attributes come from safe_identifier-validated paths (alphanumeric + _.-) so no HTML-special characters can appear there.
  • scripts/verify_artifact_hub.py / scripts/authorize_artifact_hub.py — user-supplied --slug is passed through quote(slug, safe='') before URL assembly; token validated with validate_token (whitespace check prevents CRLF header injection).
  • harness/web_fetch/runner.py — file_evaluation.files is populated by call_boundary.prepare_answer before persist_result_artifacts runs; the len(delivered) != len(result.files) guard is sound because both lists originate from the same provider call.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Claude review completed. Review run: https://github.com/lexmount/browser-eval/actions/runs/34205174236. Please check Claude's inline feedback and summary comment for details.

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Claude finished @lanyue-llk's task in 3m 39s —— View job


PR Review

  • Review PR diff for bugs and security issues
  • Post findings

No new bugs or security issues found in this update.

Both previously reported issues remain fixed:

  • Finding 1 (XSS): HUB is imported in package_artifact_hub.py but never interpolated into HTML there. In report_explainer.py, the URL enters HTML only via escape(evidence_url(path), quote=True) at line 90.
  • Finding 2 (TOCTOU): artifact_auth.py uses O_NOFOLLOW atomically in both os.open calls with stat.S_ISREG() verification before reading in the FileExistsError branch.

Reviewed in this round:

  • harness/web_fetch/providers/headless.py — validate_http_url called at fetch() entry; subprocess commands use list form; O_CREAT | O_EXCL on the temp file via NamedTemporaryFile before os.replace; output capped at 40 MB in the parent before json.loads.
  • scripts/headless_worker.py — URL re-validated at worker entry; cli_command builds list-form argv; subprocess calls use list form with no shell=True.
  • harness/web_fetch/runner.py (persist_result_artifacts) — all write paths go through contained_path; artifact_path components (provider.name, case.id) are safe_identifier-validated (alphanumeric + _.-) so cannot produce HTML-special characters in the data-file attribute. base64.b64decode(raw_stdout, validate=True) rejects non-base64 input. Hash integrity check (raw_stdout_sha256) guards raw binary writes.
  • harness/web_fetch/document_text.py — ET.fromstring on DOCX XML uses xml.etree.ElementTree, which does not resolve external entities in Python 3.8+, so XXE is not possible. ZIP processed in an isolated subprocess already bounded by the provider timeout.
  • harness/web_fetch/publication_privacy.py — any OTHER_SECRET match (including ahp_, gh[pousr]_, sk-*, PEM headers) raises rather than silently redacts; Google key redaction is restricted to artifacts/ and sources/ supplemental HTML only.
  • scripts/package_artifact_hub.py — symlink guard (path.is_symlink() check) added before file read; project_file called for every source file before packing.
  • scripts/verify_artifact_hub.py / scripts/authorize_artifact_hub.py — --slug passed through quote(slug, safe='') before URL assembly; token validated via validate_token (whitespace check includes \r/\n, preventing CRLF header injection).

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Claude review completed. Review run: https://github.com/lexmount/browser-eval/actions/runs/34206068236. Please check Claude's inline feedback and summary comment for details.

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Claude finished @lanyue-llk's task in 2m 39s —— View job


PR Review

  • Review PR diff for bugs and security issues
  • Post findings

No new bugs or security issues found.

Both previously reported issues remain fixed:

  • Finding 1 (XSS): escape(evidence_url(path), quote=True) at report_explainer.py:90; the new moli_comparison HTML block (lines 517–521) interpolates only Python integers from sum() — no user-controlled strings, no XSS risk.
  • Finding 2 (TOCTOU): artifact_auth.py uses O_NOFOLLOW atomically in both os.open calls with stat.S_ISREG() verification before reading in the FileExistsError branch.

Reviewed in this round (commits 7fd3b91, 687e7c3):

  • scripts/run_headless_benchmark.py — require_expected_provider_versions compares string values from trusted benchmark identity records; no external input involved.
  • scripts/review_headless_results.py — subprocess calls use list form (['codex','exec','--model',args.model,...]); no shell=True; args.model is passed as a list element, not via string concatenation; prompt includes only integers and file Path objects.
  • harness/web_fetch/report_explainer.py — review_summary is HTML-escaped via escape(review_summary) before template substitution; moli_comparison is an internally-constructed HTML literal with only integer interpolations.
  • scripts/merge_result_review_revision.py — dataset and record comparisons use strict equality checks; file reads go through trusted local paths only.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Claude review completed. Review run: https://github.com/lexmount/browser-eval/actions/runs/34215901516. Please check Claude's inline feedback and summary comment for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant