Page warnings log their line only, never words or source (M-11)
A document can forge both a console message and its source (KaTeX's \errmessage, data: scripts, sourceURL, encoded paths), so the display handler logs a line number and nothing the page wrote. The page's own diagnostics reach the app over elyQuery: a missed reveal sends its line; the visual failure and diagram lines already did. A test calls the real handler and checks the captured log. Round 5 found only the missing test; it is added and mutation-checked, with no sixth review under the five-round cap. M-15 is new: the print page runs a document's scripts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4a2dcbb222
commit
c5cb153f72
13 files changed
+101
-30
No files matched your search
+2
-1
@@ -71,10 +71,11 @@
|
||||
- [x] M-08 页面重载后悬着的渲染回调永不完成,导出既不成功也不报错 — 页面失败后挂起与新到的渲染都以错误结束,载入成功才恢复(审查 2 轮)
|
||||
- [x] M-09 导出的保存面板出错被当作取消 — 面板出错走 panel_failed,取消只记日志(审查 1 轮)
|
||||
- [x] M-10 关闭查找框只清当前标签的高亮 — 关闭查找框对每个标签的页面清除高亮(审查 1 轮)
|
||||
- [ ] M-11 页面把搜索词写进应用日志
|
||||
- [x] M-11 页面把搜索词写进应用日志 — 控制台的文字与来源都可由文档伪造,只记行号;页面自己的诊断经 elyQuery;R1 前缀可伪造、R2 data 来源、R3 sourceURL、R4 编码路径与目录、R5 缺回归测试:已补并经变异核对(五轮上限,未再审)
|
||||
- [ ] M-12 浏览器创建完成前 `WebView` 已释放,浏览器泄漏
|
||||
- [ ] M-13 编辑器构建失败时页面空白且不上报
|
||||
- [ ] M-14 `render_pdf` 在界面线程内嵌图片并写文件
|
||||
- [ ] M-15 打印与导出 PDF 的暂存页执行文档里的脚本
|
||||
- [ ] G-01 打开“文件历史”或“逐行追溯”后,中间区不再响应任何别的选择
|
||||
- [ ] G-02 进行中操作读取失败被吞掉;`git am` 冲突无提示条无错误
|
||||
- [ ] G-03 新建的空仓库在“仓库”页显示两段 Git 致命错误(引用日志、LFS)
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
FAIL
|
||||
|
||||
- crates/ely-web-content/src/handlers.rs:455 — The `ely: ` prefix does not establish that a message came from application code. Open Markdown containing `$\errmessage{ely: M11_PRIVATE_DOCUMENT_SENTINEL}$` in visual or preview mode: the bundled KaTeX executes `console.error` with the formula's argument verbatim, and `console_line` preserves it as `web: page says ely: M11_PRIVATE_DOCUMENT_SENTINEL ...`. This writes document contents to the application log, violating PRD §18.2 and agents.md rule 4. Reproduced with the freshly built ElyMark page; probes using the unchanged Rust helper fail on both Windows and WSL while the existing unit test passes. Evidence: `.work/m11-r1/page-console.log`, `.work/m11-r1/privacy-probe.log`, `.work/m11-r1/linux-privacy-probe.log`. Fix direction: do not trust a text prefix to authorize arbitrary console contents; withhold third-party messages and preserve application diagnostics through controlled messages that cannot contain document text. Add a regression covering KaTeX's `\errmessage` with this prefix, and update agents.md's claim accordingly.
|
||||
@@ -0,0 +1,3 @@
|
||||
FAIL
|
||||
|
||||
- crates/ely-web-content/src/handlers.rs:274 — Console `source` can contain document text, so withholding `_message` does not satisfy PRD §18.2 or agents.md rule 4. Open Markdown containing `<div><script src="data:text/javascript,console.warn('M11_PRIVATE_DOCUMENT_SENTINEL')"></script></div>` and print or export PDF: the real page's HTML renderer preserves this script, the staged page executes it (`export.rs`'s `render_pdf`/`print_page`; the resource fence permits `data:`), and CEF supplies the entire data URL as `source`. The unchanged display handler logs `web: the page warned at data:text/javascript,console.warn('M11_PRIVATE_DOCUMENT_SENTINEL'):1`. Reproduced with the freshly built page and native CEF on both Windows and WSL; the assertion excluding the document marker fails on both. The previous KaTeX prefix leak is fixed, but this source-field leak remains untested by the repository tests. Evidence: `.work/m11-r2/windows-cef-source.log`, `.work/m11-r2/linux-cef-source.log`, and `.work/m11-r2/evidence.log`. Fix direction: omit arbitrary console source strings or reduce them to validated, trusted diagnostic identifiers; add a regression that asserts document text cannot reach logs through either console message or source fields.
|
||||
@@ -0,0 +1,3 @@
|
||||
FAIL
|
||||
|
||||
- crates/ely-web-content/src/handlers.rs:453 — `warned()` trusts every `file://` console source as a bundled script and logs its final URL segment, including query/fragment text. JavaScript's `sourceURL` can supply this metadata without loading that file. Extend round 2's data-script Markdown fixture with `console.warn('hidden message');\n//# sourceURL=file:///not-bundled/M11_PRIVATE_SOURCE_SENTINEL.js`: the actual page renderer retains it, and the staged print page's warning becomes `web: the page warned at M11_PRIVATE_SOURCE_SENTINEL.js:1`. Native CEF probes using the unchanged production display handler and resource fence reproduce this on Windows and WSL; both privacy assertions fail. A source ending in `main.js?M11_PRIVATE_QUERY_SENTINEL` also leaks its query. This still violates PRD §18.2 and agents.md rule 4. The previous plain `data:` source and KaTeX message cases are fixed; script execution itself is outside this finding. Fix direction: log only verified bundled script identifiers, exclude URL queries/fragments, and use the fixed inline-script diagnostic for all other sources. Add regressions for forged `file://` sources and URL suffixes; the current two-case test passes despite this leak. Evidence: `.work/m11-r3/windows-cef-export.log`, `.work/m11-r3/linux-cef-export.log`, both `*-privacy-assert.log`, and `evidence.log`.
|
||||
@@ -0,0 +1,5 @@
|
||||
FAIL
|
||||
|
||||
- crates/ely-web-content/src/surface.rs:82 — The logged name still comes from the untrusted URL rather than the verified file. On Windows, with a real `main.js` under the page root, execute `console.warn('hidden');` with `//# sourceURL=file:///.../content/M11_PRIVATE_DOCUMENT_SENTINEL%2F..%2Fmain.js`. Windows canonicalization removes the decoded nonexistent intermediate directory followed by `..`, so `holds()` accepts the real `main.js`; `script()` returns `M11_PRIVATE_DOCUMENT_SENTINEL%2F..%2Fmain.js`. Native CEF preserves that source metadata, and the unchanged display handler logs the document marker verbatim. This violates PRD §18.2 and rule 4; it is a leak introduced by the new name extraction, independent of the pre-existing W-02 test failures. Round 3's missing-file, query, fragment and data-source cases are fixed, but the new repository test passes despite this encoded-path leak. Fix direction: derive the diagnostic name from the canonical file verified by the fence, and add a regression excluding document text carried by encoded path components. Evidence: `.work/m11-r4/windows-probe.log`, `windows-native.log`, and `evidence.log`.
|
||||
|
||||
- crates/ely-web-content/src/surface.rs:81 — `holds()` verifies canonical containment but does not require a file, so `script()` also trusts directories ending in `.js`. Create `content/M11_DIRECTORY_SENTINEL.js` as a directory and use its file URL as a console `sourceURL`: both Windows and WSL native CEF probes log `web: the page warned at M11_DIRECTORY_SENTINEL.js:1`, although no such script file exists. This breaks the required real-file restriction and agents.md's updated claim. The added regression omits directories and therefore passes. Fix direction: require the canonical target to be a regular file under the same root before returning its script name; test a `.js` directory explicitly. Evidence: `.work/m11-r4/windows-probe.log`, `linux-probe.log`, `windows-native.log`, and `linux-native.log`. Probe copies and their dedicated targets were deleted before this verdict.
|
||||
@@ -0,0 +1,3 @@
|
||||
FAIL
|
||||
|
||||
- crates/ely-web-content/src/handlers.rs:273 — The new console privacy boundary has no repository regression test; the previous `Surface::script` test was removed without replacement. In a review copy, restoring logging of `_message` and `_source` leaves all 32 ElyMark/Web-content Cargo tests passing on WSL, although a warning carrying document text now writes it verbatim to logs, violating PRD §18.2 and rule 4. A probe capturing this actual callback's log records passes with the current implementation and fails with that mutation on both Windows and WSL. Retain such a regression in the repository: private markers in warning/error messages and arbitrary sources must never reach logs, while the line diagnostic remains observable. Evidence: `.work/m11-r5/linux-mutant-repository.log`, `windows-mutant-probe.log`, `linux-mutant-probe.log`, and `evidence.log`. Both round 4 leaks are fixed, confirmed by native CEF probes on both platforms. Probe copies and their dedicated targets were deleted before this verdict.
|
||||
Reference in new issue
Block a user