# Local Privilege Escalation and Code Execution when restoring files from Quarantine

Acronis AV Quarantine restore follows directory junctions, letting a low-priv user write attacker files into protected paths like Startup, achieving SYSTEM code execution.

- Payout: $250
- Severity: medium
- Program: Acronis
- Found by: z3ron3
- Disclosed: 2024-08-27
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/980500
- Library page: https://bugbountylibrary.com/r/h1%3A980500
- Tags: area:os domain:desktop impact:dos impact:privesc kind:bounty platform:hackerone sev:medium tech:windows technique:chained technique:race-window vuln:path-traversal vuln:privilege-escalation vuln:race-condition

**Target:** Acronis True Image Antivirus Quarantine restore feature
**Root cause:** Quarantine restore blocks symlinks but not NTFS directory junctions, so restoring a file to its original path traverses a junction into an arbitrary protected directory.
**Steps:**
1. Create folder `%userprofile%\Desktop\eicar`
2. Write EICAR string to `eicar.bat` so AV detects it
3. Overwrite `eicar.bat` contents with `calc` before acting on detection
4. Choose Quarantine; edited file is moved to Quarantine
5. `rmdir /S /Q %userprofile%\Desktop\eicar`
6. Create directory junction from `eicar` folder to `C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp`
7. Restore quarantined file; it lands in Startup via junction
**How found:** Noticed restore defended against symlinks; hypothesized junction is a distinct reparse point not covered, tested by replacing origin folder with a junction.
**Exploitation:** Attacker plants a benign-detected file, swaps its contents with malicious payload, quarantines it, replaces the origin folder with a junction to a protected directory, then triggers Restore so the payload is written to Startup and executed at next logon (SYSTEM if admin logs in). Also used to overwrite `pci.sys` for DoS and to plant DLLs in SYSTEM search paths.
**Escalation:** Chained to SYSTEM code execution by targeting `adp-rest-util.exe` launched by `schedul2.exe` as SYSTEM, and by planting DLLs in SYSTEM DLL search order directories.
**Insight:** When a fix blocks symlinks, test NTFS junctions/mount points as alternate reparse points; also test TOCTOU by mutating file contents between AV detection and quarantine action.

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

**Directory junction creation to Startup folder**

```
Create a Directory Junction from the 'eicar' folder to any target folder you want to write to but don't have permission for.
I chose '**C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp**' folder in Windows which executes any programs in it on system start as the logged in user. This means logging in as SYSTEM will execute the program from SYSTEM privileges.
```

**EICAR test string written to file**

```
echo|set /p="X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*" > %userprofile%\Desktop\eicar\eicar.bat
```

**Replace quarantined file contents with calc**

```
echo calc > %userprofile%\Desktop\eicar\eicar.bat
```

