Skip to content

fix(browser): preserve URL paths when removing credentials - #4731

Merged
morluto merged 3 commits into
morluto:mainfrom
ShuaixinHuang:codex/fix-browser-url-credential-span
Oct 17, 2026
Merged

morluto merged 3 commits into
morluto:mainfrom
ShuaixinHuang:codex/fix-browser-url-credential-span

Conversation

@ShuaixinHuang

@ShuaixinHuang ShuaixinHuang commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Problem and outcome

Removing userinfo from https://user:[email protected]\path@tail/../keep?x=1#frag changed its host to tail, while the reported origin still named allowed.example. The duplicate authority parser mistook a path @ after a special-scheme backslash for userinfo.

Reuse the shared transport parser's credential spans and remove only those original bytes. Ambiguous spellings keep the existing credential-free parsed fallback. Relative/unparseable URL behavior is unchanged; this complements #2878's proposed relative-reference handling. The superseded authority parser is removed.

Validation

Head c942f642a937fc539f08a4fe5fae445c5a81d1e7, normally merged upstream 78cf6100; Windows x64, pinned Node 24.18.0/npm 11.16.0.

  • Original production baseline: 2 failed / 6 passed, including compiled CLI output with the wrong host.
  • Final integration: 58/58 passed across the original seven focused files plus the upstream keyed-archive CLI/MCP file; npm run check 6/6 plus architecture guards passed; git diff --check passed. The upstream formatting-only call(...) correction unblocks the shared static gate without changing assertions. Original test discovery: 1,498 files exactly once; this follow-up adds verifier scripts, not Vitest files.
  • Real installed Edge 155.0.4283.45 completed npm run verify:browser with an isolated owned headless profile, covering public CLI/stdio MCP observation and bundle analysis, screenshots, network, script export, module tracing and scenario workflows. After the final load barrier was added, its exact helper was verified again in a fresh real Edge process. The browser production/verifier files are byte-identical to this f888dee8 validation stage after the final upstream merge.
  • The new verifier confirms real V8 Debugger.scriptParsed retains both raw credential-bearing and credential-free sourceURL labels. Public CLI and stdio MCP preserve the original path/query/fragment while removing userinfo, and independently verify selected source bytes and SHA-256. Independent reviews found no actionable issue.

An earlier expanded Windows selection reported 16 passed / 1 failed: the unchanged browser-startup SIGTERM fixture expected Unix signal termination, but Windows reported exit code 1 without a signal. That failure remains recorded; no assertion or production behavior was weakened to hide it. Windows process-family lineage proof also remains unavailable in the verifier report; resource-close completion is not claimed as whole-family proof.

Browser navigation normalizes backslashes and dot segments; the new regression explicitly exercises real V8 script labels. It does not claim raw navigation/HTTP URL preservation. Existing 1,101-target capacity and attachment assertions remain intact.

The current PR real Chrome job passed on Chrome/155.0.8059.39 with verified: true. The new urlUserInfo report confirms CLI, stdio MCP, raw V8 spelling, the credential-free control and original-source digest checks all passed. Its Linux point-in-time lineage check succeeded; this does not replace the unavailable Windows lineage proof. The current-head required CI passed. Earlier static-gate failures and their skipped Chrome jobs are not reported as executed provider evidence. Prepared with AI assistance.

Author readiness

Human owner: @ShuaixinHuang

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

@ShuaixinHuang
ShuaixinHuang marked this pull request as ready for review October 17, 2026 10:22
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-17T10:22:31.394532Z 75963a4 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issue was found.

Summary

The PR replaces duplicate credential parsing with the shared parser, preserving original path, query, and fragment bytes when removing userinfo.

  • Browser URL cleanup keeps the original path when removing credentials.
  • The archive CLI test keeps the same check with clearer formatting.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Original URL] --> B[Parse URL]
  B --> C{Has credentials?}
  C -->|No| D[Keep original bytes]
  C -->|Yes| E[Read shared credential span]
  E --> F{Span is clear?}
  F -->|Yes| G[Remove only credential bytes]
  F -->|No| H[Return parsed URL without credentials]
Loading

Reviews (3) · Last reviewed commit: "chore: integrate upstream CI compatibili..." · Reviewed by Greptile

@morluto
morluto merged commit 6b0113a into morluto:main Oct 17, 2026
36 checks passed
@morluto

morluto commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Thanks @ShuaixinHuang for catching the URL case where a backslash and @ in the path could make credential removal report the wrong host. Reusing the shared parser’s credential spans keeps the original path intact while stripping userinfo.

@morluto morluto added bug Something isn't working area: runtime Process capture and runtime observation labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: runtime Process capture and runtime observation bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants