New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Clash For Windows 最新版存在本地权限提升漏洞/Clash For Windows latest version has LPE vulnerability #3405
Comments
|
oh god |
|
非常感谢,后续版本会对此问题进行修复 |
|
oh no |
|
对于 CFW 的需求,也可以去除 WinSW 这层。Task Scheduler 即可实现相同的功能。 |
|
v 以下是我之前想的,还是发出来吧。 这个问题看着好尴尬。全都是 NTFS 默认的 inheritance,但 CFW 放了个 service,就变得不妥了。 所有静默提权执行的映像及依赖原则上确实应该放到受保护的位置。考虑 Program Files 1 ,或者释放到 Common Program Files 如何?这样可以尽量回避编辑 ACL 2 ,也避免改变 user profile 的期望语义。 另外,我感觉仅保护 CFW 的那个目录无法完全堵上窟窿。Clash 目前的设计恐怕有点违反 Windows 的 integrity control。 Footnotes |
|
给个临时的解决方案吧,已安装Service Mode,在拥有管理员权限的CMD下执行 |
|
@Lemmingh 20.0现在acl也可以比无权限替换掉吗 |
|
因为你不可能拒掉 owner 的权限。 |
|
那我下次把它移到program files里吧 |
干掉目录权限继承就行,不过这样有点不美观... |
|
这跟继承 (ACE inheritance) 无关。 User profile 下的 object 的 owner 默认是当前用户。所以,只要这些文件在 user profile 下,怎么改都无法阻止当前用户的 effective access,除非变更 ownership。 |
|
经 #3405 (comment) 提醒,确实有了个新思路,只要在安装 service 前执行就有可能实现: 1. 准备工作预先准备两个目录 往 2. 使用 junction point 占用 clash config 目录这步需要保证 clash config 目录没有被占用,时机有很多先按下不表 3. 通过 cfw 安装 service4. service 安装完成后转移文件并重新挂载准备好的 hijack 目录到这步为止已经成功劫持该目录,并且安装 service 后 cfw 全程处于开启状态 5. 最后重启验证效果
而使用 |
|
我再说点废话。 icacls.exe service /reset /T /C无论 DACL 被改成什么样子,只要当前用户是 owner,无需提权,就能重置整个目录的权限。 PS [21:50:00] Temp:\> (Get-Acl .\service).Access
FileSystemRights : FullControl
AccessControlType : Deny
IdentityReference : Everyone
IsInherited : False
InheritanceFlags : ContainerInherit, ObjectInherit
PropagationFlags : None
PS [21:50:02] Temp:\> (Get-NTFSEffectiveAccess -Path $(Convert-Path .\service) -Account $env:USERNAME).AccessRights
WARNING: The user does not hold the Security Privliege and might not be able to read the effective permissions
ReadPermissions, ChangePermissions, Synchronize
PS [21:50:08] Temp:\> [System.Security.Principal.WindowsPrincipal]::new([System.Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)
False
PS [21:50:13] Temp:\> icacls.exe service /reset /T /C
processed file: service
processed file: service\clash-core-service.exe
processed file: service\service.exe
processed file: service\service.wrapper.log
processed file: service\service.yml
Successfully processed 5 files; Failed processing 0 files我也许算是提起过:
所以,
|
|
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days |




请认真检查以下清单中的每一项
软件版本
0.19.29
操作系统
Windows x64
系统版本
Windows 11
问题描述
Windows 上的 clash_for_windows 到 0.19.29 在Service Mode激活时存在本地权限提升漏洞。由于 Service Mode 配置文件目录权限配置错误引起的。
clash_for_windows on Windows to 0.19.29 allows privilege escalation and command execution when Service Mode is activated. This is caused by a
clash_for_windows Service Mode profile directory permissions misconfiguration.
复现步骤
https://www.youtube.com/watch?v=5Yqy21jQMAw
日志文件
logs
01:39:52 INF [API] listening addr=127.0.0.1:49697
01:39:52 INF [Inbound] Mixed(http+socks) listening addr=127.0.0.1:7890
其他补充
解决方案:参考7Zip

The text was updated successfully, but these errors were encountered: