Skip to content

chore: use isPathInside consistently#40495

Merged
pavelfeldman merged 1 commit into
microsoft:mainfrom
pavelfeldman:assorted_fixes
Apr 29, 2026
Merged

chore: use isPathInside consistently#40495
pavelfeldman merged 1 commit into
microsoft:mainfrom
pavelfeldman:assorted_fixes

Conversation

@pavelfeldman

Copy link
Copy Markdown
Member

Summary

  • Add isPathInside / resolveWithinRoot helpers in @utils/fileUtils and use them across the MCP tools backend, HAR replay, blob report merge, trace viewer /file handler, and serveFolder /trace/file handler to confine path-based reads/writes to their intended roots.
  • Validate Host header on loopback HTTP bindings to defeat DNS rebinding against show-report and the trace viewer.
  • Drop unsafe launch options (args, executablePath, etc.) from run-server clients unless --unsafe is set.
  • Use UUID instead of site-suggested filename for BiDi downloads.
  • Validate the edgeupdates artifact URL and shell-quote install args in the macOS msedge install path.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

86 failed
❌ [chrome] › mcp/config-resolve.spec.ts:69 › browserName and channel › config file browserName chromium does not auto-set channel @mcp-macos-latest-chrome
❌ [chrome] › mcp/config-resolve.spec.ts:77 › browserName and channel › config file browserName firefox does not set channel @mcp-macos-latest-chrome
❌ [chrome] › mcp/config-resolve.spec.ts:85 › browserName and channel › config file browserName + channel are both preserved @mcp-macos-latest-chrome
❌ [chrome] › mcp/config-resolve.spec.ts:220 › merge order › env overrides config file @mcp-macos-latest-chrome
❌ [chrome] › mcp/config.spec.ts:88 › browserName @mcp-macos-latest-chrome
❌ [chrome] › mcp/config-resolve.spec.ts:69 › browserName and channel › config file browserName chromium does not auto-set channel @mcp-ubuntu-latest-chrome
❌ [chrome] › mcp/config-resolve.spec.ts:77 › browserName and channel › config file browserName firefox does not set channel @mcp-ubuntu-latest-chrome
❌ [chrome] › mcp/config-resolve.spec.ts:85 › browserName and channel › config file browserName + channel are both preserved @mcp-ubuntu-latest-chrome
❌ [chrome] › mcp/config-resolve.spec.ts:220 › merge order › env overrides config file @mcp-ubuntu-latest-chrome
❌ [chrome] › mcp/config.spec.ts:88 › browserName @mcp-ubuntu-latest-chrome
❌ [chrome] › mcp/config-resolve.spec.ts:69 › browserName and channel › config file browserName chromium does not auto-set channel @mcp-windows-latest-chrome
❌ [chrome] › mcp/config-resolve.spec.ts:77 › browserName and channel › config file browserName firefox does not set channel @mcp-windows-latest-chrome
❌ [chrome] › mcp/config-resolve.spec.ts:85 › browserName and channel › config file browserName + channel are both preserved @mcp-windows-latest-chrome
❌ [chrome] › mcp/config-resolve.spec.ts:220 › merge order › env overrides config file @mcp-windows-latest-chrome
❌ [chrome] › mcp/config.spec.ts:88 › browserName @mcp-windows-latest-chrome
❌ [chrome] › mcp/dashboard.spec.ts:207 › should enter annotate mode on fresh dashboard.tsx mount with -s --annotate @mcp-windows-latest-chrome
❌ [chrome] › mcp/dashboard.spec.ts:231 › should switch screencast to -s session on show --annotate @mcp-windows-latest-chrome
❌ [chromium] › mcp/cli-isolated.spec.ts:21 › should not save user data by default (in-memory mode) @mcp-macos-latest-chromium
❌ [chromium] › mcp/cli-isolated.spec.ts:45 › should save user data with --persistent flag @mcp-macos-latest-chromium
❌ [chromium] › mcp/cli-json.spec.ts:84 › list after open returns one browser entry @mcp-macos-latest-chromium
❌ [chromium] › mcp/cli-session.spec.ts:86 › delete-data @mcp-macos-latest-chromium
❌ [chromium] › mcp/cli-session.spec.ts:98 › delete-data named session @mcp-macos-latest-chromium
❌ [chromium] › mcp/config.spec.ts:88 › browserName @mcp-macos-latest-chromium
❌ [chromium] › mcp/cli-isolated.spec.ts:21 › should not save user data by default (in-memory mode) @mcp-windows-latest-chromium
❌ [chromium] › mcp/cli-isolated.spec.ts:45 › should save user data with --persistent flag @mcp-windows-latest-chromium
❌ [chromium] › mcp/cli-json.spec.ts:84 › list after open returns one browser entry @mcp-windows-latest-chromium
❌ [chromium] › mcp/cli-session.spec.ts:86 › delete-data @mcp-windows-latest-chromium
❌ [chromium] › mcp/cli-session.spec.ts:98 › delete-data named session @mcp-windows-latest-chromium
❌ [chromium] › mcp/config.spec.ts:88 › browserName @mcp-windows-latest-chromium
❌ [chromium] › mcp/cli-isolated.spec.ts:21 › should not save user data by default (in-memory mode) @mcp-ubuntu-latest-chromium
❌ [chromium] › mcp/cli-isolated.spec.ts:45 › should save user data with --persistent flag @mcp-ubuntu-latest-chromium
❌ [chromium] › mcp/cli-json.spec.ts:84 › list after open returns one browser entry @mcp-ubuntu-latest-chromium
❌ [chromium] › mcp/cli-session.spec.ts:86 › delete-data @mcp-ubuntu-latest-chromium
❌ [chromium] › mcp/cli-session.spec.ts:98 › delete-data named session @mcp-ubuntu-latest-chromium
❌ [chromium] › mcp/config.spec.ts:88 › browserName @mcp-ubuntu-latest-chromium
❌ [firefox] › mcp/cli-isolated.spec.ts:21 › should not save user data by default (in-memory mode) @mcp-ubuntu-latest-firefox
❌ [firefox] › mcp/cli-isolated.spec.ts:45 › should save user data with --persistent flag @mcp-ubuntu-latest-firefox
❌ [firefox] › mcp/cli-json.spec.ts:84 › list after open returns one browser entry @mcp-ubuntu-latest-firefox
❌ [firefox] › mcp/cli-session.spec.ts:86 › delete-data @mcp-ubuntu-latest-firefox
❌ [firefox] › mcp/cli-session.spec.ts:98 › delete-data named session @mcp-ubuntu-latest-firefox
❌ [firefox] › mcp/config.spec.ts:88 › browserName @mcp-ubuntu-latest-firefox
❌ [firefox] › mcp/cli-isolated.spec.ts:21 › should not save user data by default (in-memory mode) @mcp-windows-latest-firefox
❌ [firefox] › mcp/cli-isolated.spec.ts:45 › should save user data with --persistent flag @mcp-windows-latest-firefox
❌ [firefox] › mcp/cli-json.spec.ts:84 › list after open returns one browser entry @mcp-windows-latest-firefox
❌ [firefox] › mcp/cli-session.spec.ts:86 › delete-data @mcp-windows-latest-firefox
❌ [firefox] › mcp/cli-session.spec.ts:98 › delete-data named session @mcp-windows-latest-firefox
❌ [firefox] › mcp/config.spec.ts:88 › browserName @mcp-windows-latest-firefox
❌ [firefox] › mcp/cli-isolated.spec.ts:21 › should not save user data by default (in-memory mode) @mcp-macos-latest-firefox
❌ [firefox] › mcp/cli-isolated.spec.ts:45 › should save user data with --persistent flag @mcp-macos-latest-firefox
❌ [firefox] › mcp/cli-json.spec.ts:84 › list after open returns one browser entry @mcp-macos-latest-firefox
❌ [firefox] › mcp/cli-session.spec.ts:86 › delete-data @mcp-macos-latest-firefox
❌ [firefox] › mcp/cli-session.spec.ts:98 › delete-data named session @mcp-macos-latest-firefox
❌ [firefox] › mcp/config.spec.ts:88 › browserName @mcp-macos-latest-firefox
❌ [msedge] › mcp/cli-isolated.spec.ts:21 › should not save user data by default (in-memory mode) @mcp-windows-latest-msedge
❌ [msedge] › mcp/cli-isolated.spec.ts:45 › should save user data with --persistent flag @mcp-windows-latest-msedge
❌ [msedge] › mcp/cli-json.spec.ts:84 › list after open returns one browser entry @mcp-windows-latest-msedge
❌ [msedge] › mcp/cli-session.spec.ts:86 › delete-data @mcp-windows-latest-msedge
❌ [msedge] › mcp/cli-session.spec.ts:98 › delete-data named session @mcp-windows-latest-msedge
❌ [msedge] › mcp/config.spec.ts:88 › browserName @mcp-windows-latest-msedge
❌ [webkit] › mcp/cli-core.spec.ts:114 › check @mcp-macos-latest-webkit
❌ [webkit] › mcp/cli-core.spec.ts:123 › uncheck @mcp-macos-latest-webkit
❌ [webkit] › mcp/cli-isolated.spec.ts:21 › should not save user data by default (in-memory mode) @mcp-macos-latest-webkit
❌ [webkit] › mcp/cli-isolated.spec.ts:45 › should save user data with --persistent flag @mcp-macos-latest-webkit
❌ [webkit] › mcp/cli-json.spec.ts:84 › list after open returns one browser entry @mcp-macos-latest-webkit
❌ [webkit] › mcp/cli-session.spec.ts:86 › delete-data @mcp-macos-latest-webkit
❌ [webkit] › mcp/cli-session.spec.ts:98 › delete-data named session @mcp-macos-latest-webkit
❌ [webkit] › mcp/config.spec.ts:88 › browserName @mcp-macos-latest-webkit
❌ [webkit] › mcp/cli-cdp.spec.ts:75 › detach rejects sessions opened via open @mcp-windows-latest-webkit
❌ [webkit] › mcp/cli-config.spec.ts:21 › user-data-dir @mcp-windows-latest-webkit
❌ [webkit] › mcp/cli-config.spec.ts:32 › context options @mcp-windows-latest-webkit
❌ [webkit] › mcp/cli-core.spec.ts:37 › click button @mcp-windows-latest-webkit
❌ [webkit] › mcp/cli-core.spec.ts:51 › click link @mcp-windows-latest-webkit
❌ [webkit] › mcp/cli-core.spec.ts:114 › check @mcp-windows-latest-webkit
❌ [webkit] › mcp/cli-core.spec.ts:123 › uncheck @mcp-windows-latest-webkit
❌ [webkit] › mcp/cli-isolated.spec.ts:21 › should not save user data by default (in-memory mode) @mcp-windows-latest-webkit
❌ [webkit] › mcp/cli-isolated.spec.ts:45 › should save user data with --persistent flag @mcp-windows-latest-webkit
❌ [webkit] › mcp/cli-json.spec.ts:84 › list after open returns one browser entry @mcp-windows-latest-webkit
❌ [webkit] › mcp/cli-session.spec.ts:86 › delete-data @mcp-windows-latest-webkit
❌ [webkit] › mcp/cli-session.spec.ts:98 › delete-data named session @mcp-windows-latest-webkit
❌ [webkit] › mcp/config.spec.ts:88 › browserName @mcp-windows-latest-webkit
❌ [webkit] › mcp/cli-isolated.spec.ts:21 › should not save user data by default (in-memory mode) @mcp-ubuntu-latest-webkit
❌ [webkit] › mcp/cli-isolated.spec.ts:45 › should save user data with --persistent flag @mcp-ubuntu-latest-webkit
❌ [webkit] › mcp/cli-json.spec.ts:84 › list after open returns one browser entry @mcp-ubuntu-latest-webkit
❌ [webkit] › mcp/cli-session.spec.ts:86 › delete-data @mcp-ubuntu-latest-webkit
❌ [webkit] › mcp/cli-session.spec.ts:98 › delete-data named session @mcp-ubuntu-latest-webkit
❌ [webkit] › mcp/config.spec.ts:88 › browserName @mcp-ubuntu-latest-webkit

6735 passed, 927 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

10 failed
❌ [playwright-test] › reporter.spec.ts:398 › merged › should use sourceMap-based file suite names @ubuntu-latest-node20
❌ [playwright-test] › reporter.spec.ts:398 › merged › should use sourceMap-based file suite names @macos-latest-node20
❌ [playwright-test] › reporter.spec.ts:398 › merged › should use sourceMap-based file suite names @ubuntu-latest-node24
❌ [playwright-test] › reporter.spec.ts:398 › merged › should use sourceMap-based file suite names @ubuntu-latest-node22
❌ [playwright-test] › ui-mode-trace.spec.ts:433 › should work behind reverse proxy @ubuntu-latest-node20
❌ [playwright-test] › ui-mode-trace.spec.ts:433 › should work behind reverse proxy @macos-latest-node20
❌ [playwright-test] › ui-mode-trace.spec.ts:433 › should work behind reverse proxy @ubuntu-latest-node24
❌ [playwright-test] › ui-mode-trace.spec.ts:433 › should work behind reverse proxy @ubuntu-latest-node22
❌ [playwright-test] › reporter.spec.ts:398 › merged › should use sourceMap-based file suite names @windows-latest-node20
❌ [playwright-test] › ui-mode-trace.spec.ts:433 › should work behind reverse proxy @windows-latest-node20

5 flaky ⚠️ [chromium-library] › library/video.spec.ts:275 › screencast › should capture navigation `@ubuntu-22.04-chromium-tip-of-tree`
⚠️ [chromium-library] › library/beforeunload.spec.ts:130 › should support dismissing the dialog multiple times `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/video.spec.ts:719 › screencast › should work with video+trace `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/popup.spec.ts:261 › should not throw when click closes popup `@chromium-ubuntu-22.04-node22`
⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:1080 › cli codegen › should not throw csp directive violation errors `@firefox-ubuntu-22.04-node20`

41556 passed, 784 skipped


Merge workflow run.

else
if (!artifact)
throw new Error(`Cannot install ${channel} on ${process.platform}`);
const location = String(artifact.location);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why is this place changing?

}
}

function computeAllowedHosts(requested: string | undefined, bound: string, port: number): Set<string> | null {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is requested actually '::1' not '[::1]'?

@pavelfeldman
pavelfeldman merged commit 3a47f3e into microsoft:main Apr 29, 2026
23 of 47 checks passed
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.

2 participants