keiko233 建议 Clash Nyanpasu 保留局域网访问权限与新装默认值的控制
在尚未合并的配置归属 PR 中,keiko233 支持让 ipv6 可选择由配置管理,但建议 allow-lan 继续由应用强制控制。他认为该字段涉及主机监听暴露,若交给订阅或配置变换,可能绕过 system:write 与 profile:write 的权限划分。他还建议新装默认保持 unified-delay 和 tcp-concurrent 为 Managed(true)、ipv6 为 Managed(false),仅在用户主动选择“跟随配置”等选项后交出相应控制,并把修订 6 的迁移限于 ipv6。
作者原文@keiko233Thanks for the detailed write-up on the Windows TUN +
ipv6hintleak (#2794) and for the thorough migration and test coverage! Makingipv6aManageableField<bool>makes a lot of sense and fits cleanly into the post-processing ownership pipeline.Before merging, could we narrow the scope of this PR on two fronts?
- Keep
allow-lanas a forcedbool(do not hand it to profiles)
- Host listener boundary: Like
mixed-port,port,socks-port,external-controller, andsecret(see #5720),allow-lancontrols local network exposure on the host rather than proxy routing topology. Many third-party subscription templates ship withallow-lan: trueout of the box; letting profiles own it risks silently exposing local proxy listeners on untrusted LANs or public Wi-Fi.- RPC privilege separation (
system:writevs.profile:write):ClashAccessPatch(patch_runtime_access) intentionally isolatesallow-lanandsecretbehindsystem:write(Admin), whereasOperatortokens only holdprofile:writeandsettings:write(#6378). Ifallow-lancan beUnmanaged, any caller withprofile:write(or a remote subscription refresh) can enable LAN exposure through a profile or transform, effectively bypassingClashAccessPatchandsystem:write.
- Keep fresh-install defaults
Managed(unified-delay: Managed(true),tcp-concurrent: Managed(true),ipv6: Managed(false))
- Consistent with #5669 and #5889 (
tun.auto-route), handing a guard field over to profiles should remain an explicit user opt-in ("Follow profile") rather than changing fresh-install behavior silently.- Defaulting
unified-delayandtcp-concurrenttoUnmanagedcauses subscriptions that omit those keys to fall back to core defaults (falsein mihomo), regressing out-of-the-box latency measurement and TCP concurrency. Likewise, keepingipv6: Managed(false)by default avoids unexpected dual-stack routing regressions on environments with broken IPv6 connectivity until the user explicitly chooses "Follow profile" or "Always on".Suggested path forward:
- Scope
ClashGuardOverrides/ClashOverridesSettings/ClashOverridesSettingsPatchchanges toipv6: ManageableField<bool>only (withDefaultkept asManaged(false)).- Narrow the revision 6 migration to
ipv6(e.g.,clash_config/manageable_ipv6).- Revert the
allow-lan(ClashAccessPatch,AllowLanSwitch/AllowLanSettings) andunified-delay/tcp-concurrentdefault changes.cc @greenhat616