Repository navigation
fix(browser): remote tunnel matches Chromium for IPv6 bypass rules and <-loopback> - #32665
Conversation
db4037a to
b7bc1f8
Compare
|
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:
📝 Walkthrough
Priority: ⬇️ Low Severity of issue fixed: Low Merge Risk: 🔵 Low · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
64d45e2c-c667-4018-b38f-0ee50827b3e4
📒 Files selected for processing: 2
src/main/browser/browser-network-tunnel-proxy-selection.tssrc/main/browser/browser-network-tunnel-proxy.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
| .findLast((rule) => | ||
| rule === '<-loopback>' ? implicit : matchesBypassRule(host, target.port, rule, style) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Preserve the trailing dot when matching <local>.
If the target is localhost. and the rules are <-loopback>;<local>, normalizeHost removes the dot before matchesBypassRule checks <local>. The last rule then selects a direct connection. Chromium does not match <local> against a hostname with a trailing dot, so this combination should select the proxy. Keep the original hostname’s trailing-dot state for the <local> check while retaining normalization for the other rules. (chromium.googlesource.com)
b7bc1f8 to
34cf880
Compare
ELI5
When you browse through a remote Orca server, the server decides for each connection whether to go through its proxy or connect directly. It now makes that call the same way the server's own browser does when the bypass list has an IPv6 address or
<-loopback>in it.What Changed
Before:
[fd00::1]never matched, because the SOCKS front end hands IPv6 destinations over asfd00:0:0:0:0:0:0:1and the rule was compared as text. The request went through the proxy.<-loopback>was ignored. The tunnel always connected to localhost and loopback directly, while Chromium on the server sends them through the proxy when that rule is set.169.254.0.0/16,fe80::/10) went through the proxy. Chromium bypasses these implicitly.After, in
matchesProxyBypassRules:matchesCidr/BlockList), so compressed, expanded, bracketed and upper-case forms all match.selectBrowserNetworkTunnelProxyand into the matcher. It now works as Chromium's fallback after the explicit rules: the last matching rule wins, and<-loopback>removes the implicit bypass for the hosts it covers. So<-loopback>;<local>still bypasseslocalhost, and<local>;<-loopback>proxies it, the same as Chromium.Why
Root cause: the tunnel's bypass matcher decided on its own, outside Chromium's rule model. It compared IP literals as strings, and it applied the implicit loopback bypass before the rule list, so no rule could remove it.
The fix copies Chromium's evaluator (
net/proxy_resolution/proxy_host_matching_rules.ccandnet/base/scheme_host_port_matcher.cc: reverse iteration with first match,SubtractImplicitBypassesRule, andMatchesImplicitRulesas the fallback, which includes link-local). I leftformatIpv6alone: rules can be written in any form, so canonicalizing only the target would fix one side.<-loopback>applies toNO_PROXYtoo, because the server's own Chromium sessions getNO_PROXYunchanged and honor it there.Linked Issue
Fixes #29448
Linear: STA-10760
Visual Proof
N/A: this changes main-process proxy selection for tunneled connections, and there is no UI.
Testing
pnpm test src/main/browser/browser-network-tunnel-proxy.test.ts: new table rows cover an expanded IPv6 target against a compressed bracketed rule, an expanded rule against a bracketed upper-case target, implicit link-local,<-loopback>alone, and both orders of<local>with<-loopback>. A selector-level case checks that<-loopback>proxies127.0.0.1. The existing IPv4, hostname, CIDR and NO_PROXY rows are unchanged and pass.With the old selection file restored, 6 of the new cases fail.
pnpm run check:code-quality:changedandpnpm run check:react-doctor:changedpass.Automated tests added/updated
Notes
loopbackimplicitly.