Repository navigation
Revert "Preview HTML files by default" (#31575): clicked HTML can read local files - #31770
brennanb2025 wants to merge 4 commits into
Conversation
This reverts commit 524fa00.
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬆️ High Merge Risk: 🟡 Moderate · up to
|
There was a problem hiding this comment.
Actionable comments posted: 5
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
af764108-311a-48d5-b3d7-552671ac1157
📒 Files selected for processing: 63
src/renderer/src/components/QuickOpen.mount-gating.test.tsxsrc/renderer/src/components/browser-pane/assemble-chrome/browser-page-toolbar.tsxsrc/renderer/src/components/browser-pane/host-guest/browser-page-webview.tssrc/renderer/src/components/browser-pane/navigate/browser-file-editor-open.test.tssrc/renderer/src/components/browser-pane/navigate/browser-file-editor-open.tssrc/renderer/src/components/browser-pane/navigate/local-html-preview-freshness.test.tssrc/renderer/src/components/browser-pane/navigate/local-html-preview-freshness.tssrc/renderer/src/components/browser-pane/workspace-doc/doc-preview-document-actions.test.tssrc/renderer/src/components/browser-pane/workspace-doc/doc-preview-document-actions.tssrc/renderer/src/components/editor/editor-dropped-file-open.escaping-link.test.tssrc/renderer/src/components/editor/editor-dropped-file-open.tssrc/renderer/src/components/editor/use-editor-group-file-drop-owner.remote.test.tsxsrc/renderer/src/components/editor/use-editor-group-file-drop-owner.test.tsxsrc/renderer/src/components/quick-open-file-navigation.test.tssrc/renderer/src/components/quick-open-file-navigation.tssrc/renderer/src/components/right-sidebar/SourceControl.preview-open.test.tsxsrc/renderer/src/components/right-sidebar/file-explorer-drag-scroll-marker.test.tsxsrc/renderer/src/components/right-sidebar/file-explorer-instant-dir-toggle.test.tssrc/renderer/src/components/right-sidebar/source-control-branch-section-heading.test.tsxsrc/renderer/src/components/right-sidebar/source-control/listing/active-open-file-keys.tssrc/renderer/src/components/right-sidebar/source-control/listing/branch-entry-row.tsxsrc/renderer/src/components/right-sidebar/source-control/listing/branch-section.tsxsrc/renderer/src/components/right-sidebar/source-control/listing/open-uncommitted-entry.test.tssrc/renderer/src/components/right-sidebar/source-control/listing/open-uncommitted-entry.tssrc/renderer/src/components/right-sidebar/source-control/listing/section-action-buttons.test.tsxsrc/renderer/src/components/right-sidebar/source-control/listing/section-file-list.tsxsrc/renderer/src/components/right-sidebar/source-control/listing/uncommitted-sections.tsxsrc/renderer/src/components/right-sidebar/source-control/listing/use-file-listing.tssrc/renderer/src/components/right-sidebar/source-control/listing/use-row-opening.tssrc/renderer/src/components/right-sidebar/source-control/listing/use-selection.tssrc/renderer/src/components/right-sidebar/source-control/notes/use-note-opening.tssrc/renderer/src/components/right-sidebar/source-control/panel/panel-content.tsxsrc/renderer/src/components/right-sidebar/source-control/panel/use-panel-model.tssrc/renderer/src/components/right-sidebar/use-file-explorer-tree-pane-state.tssrc/renderer/src/components/right-sidebar/useFileExplorerHandlers.test.tssrc/renderer/src/components/right-sidebar/useFileExplorerHandlers.tssrc/renderer/src/components/status-bar/workspace-space-open-change.test.tssrc/renderer/src/components/status-bar/workspace-space-open-change.tssrc/renderer/src/components/tab-bar/tab-create-entry-absolute-file.tssrc/renderer/src/components/tab-bar/tab-create-entry-action.test.tssrc/renderer/src/components/tab-bar/tab-create-entry-action.tssrc/renderer/src/components/tab-bar/tab-create-entry-local-path.test.tssrc/renderer/src/components/tab-bar/tab-create-entry-preview.test.tssrc/renderer/src/components/terminal-pane/terminal-file-link-editor-open.tssrc/renderer/src/components/terminal-pane/terminal-file-open-routing.tssrc/renderer/src/components/terminal-pane/terminal-link-file-open-routing.test.tssrc/renderer/src/components/terminal-pane/terminal-link-handlers-test-fixtures.tssrc/renderer/src/components/terminal-pane/terminal-link-handlers-test-harness.tssrc/renderer/src/components/terminal-pane/terminal-link-handlers.tssrc/renderer/src/components/terminal-pane/terminal-link-open-beside-source.test.tssrc/renderer/src/components/terminal-pane/terminal-link-remote-runtime-ssh-open.test.tssrc/renderer/src/lib/file-preview-tab.tssrc/renderer/src/lib/file-preview.test.tssrc/renderer/src/lib/file-preview.tssrc/renderer/src/lib/open-html-file-preview.test.tssrc/renderer/src/lib/open-html-file-preview.tssrc/renderer/src/lib/workspace-file-open.test.tssrc/renderer/src/lib/workspace-file-open.tssrc/renderer/src/lib/workspace-file-preview-page.tssrc/shared/files-runtime-capabilities.tssrc/shared/html-file-url.tstests/e2e/html-file-url-opening.spec.tstests/e2e/html-source-control-preview.spec.ts
💤 Files with no reviewable changes: 13
- src/renderer/src/components/right-sidebar/source-control/listing/branch-entry-row.tsx
- src/renderer/src/lib/workspace-file-open.test.ts
- src/renderer/src/lib/file-preview-tab.ts
- src/renderer/src/components/tab-bar/tab-create-entry-local-path.test.ts
- src/renderer/src/lib/workspace-file-preview-page.ts
- src/renderer/src/components/browser-pane/host-guest/browser-page-webview.ts
- src/renderer/src/components/browser-pane/navigate/local-html-preview-freshness.test.ts
- src/renderer/src/components/browser-pane/navigate/local-html-preview-freshness.ts
- src/renderer/src/components/QuickOpen.mount-gating.test.tsx
- src/renderer/src/lib/workspace-file-open.ts
- src/renderer/src/components/right-sidebar/source-control/listing/active-open-file-keys.ts
- src/shared/files-runtime-capabilities.ts
- tests/e2e/html-source-control-preview.spec.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
|
Closing: Jinjing is fixing the P0 forward instead of reverting (tracked in STA-11670). |
Problem
Since #31575 ("Preview HTML files by default"), clicking an
.htmlfile in Explorer, Quick Open, file drops, and Source Control opens it as a live page in an ordinary browser tab at itsfile://path, and its scripts run. In v1.4.237 those general file-opening routes showed source or the existing source/diff view instead. Terminal HTML links were already an exception: ordinary Cmd/Ctrl-click opened a live browser preview in v1.4.237 too.That browser tab is not the locked-down document-preview session that remote previews use (no content policy, no outbound-request filter), and the app does not turn off Electron's extra
file://privileges. Afile://page can therefore read other local files withfetchand send them to any website. This was reproduced in Electron 43.7.8 with the guest settings Orca forces: areport.htmlread a siblingsecret.env.So a repo that contains a hostile HTML file can read local secrets (for example a
.envnext to it) the moment someone clicks the file to look at it.The production release scan for v1.4.237..main flagged this, and the release counsel kept it as release-blocking.
What changes for users
General HTML file-opening routes return to source or the existing source/diff view, as in v1.4.237. Rendering remains available through the existing explicit preview action. Terminal Cmd/Ctrl-click on a local HTML link still opens a live
file://browser preview: that route is byte-for-byte identical to v1.4.237, and this exact revert deliberately preserves it.Change
git revert 524fa0039b4(#31575). It applies cleanly on current main; no later commit imports the removed files.Follow-up
The underlying exposure (a local HTML preview runs with full
file://read access) also exists in v1.4.237's explicit preview and terminal-link HTML route. The real fix is to serve local HTML previews through a restricted protocol/session (or turn off the extra file privileges) and then bring back preview-by-default. That belongs to the #31575 owner.