Skip to content
Access control Write-up Advanced

Elevation of privileges from Everyone through Avast Sandbox to System AmPPL (CVE-2021-45335, CVE-2021-45336 and CVE-2021-45337)

The Avast antivirus engine sandbox process had an overly permissive DACL allowing any user to inject code, and the Task Scheduler service allowed a restricted token to register tasks that run as unrestricted SYSTEM, enabling sandbox escape. Additionally, the Avast self-defence driver could be tricked into marking a process as Antimalware Protected Process Light (AmPPL) by hollowing a specific executable, allowing an attacker with SYSTEM privileges to gain AmPPL protection.

Denis Skvortcov Follow

Published on the-deniss.github.io

In March 2020 (during quarantine) I researched the security of Avast Free Antivirus ver. 20.1.2397 and I may have been one of the first external security researchers to explore the product’s newest feature – the antivirus (AV) engine sandbox.

Denis Skvortcov, on the-deniss.github.io

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the developers set an overly permissive default DACL on the sandboxed process token, and the Task Scheduler service trusted any token containing the LocalSystem SID without checking whether it was restricted, while the self-defence driver set PPL protection based only on the executable path and user context.

Impact

An attacker with normal user privileges could delete arbitrary files, escape the sandbox to run code as SYSTEM, and then obtain AmPPL protection for their process, potentially interfering with other protected processes.

What the attacker needed

Local access as a normal user; Avast antivirus installed

How it was found

  1. Log in as a normal user and observe that the aswEngSrv.exe process token is accessible.
  2. Check the process DACL and confirm that Everyone has read/write access.
  3. Inject code into aswEngSrv.exe to make it report a file as malicious, causing AvastSvc.exe to delete the file.
  4. From the restricted context of aswEngSrv.exe, use the Task Scheduler COM API to register a task that runs as SYSTEM.
  5. To bypass PPL, set a conditional breakpoint on RChangeServiceConfig2W in services.exe to cancel AmPPL service configuration during installation.
  6. Launch wsc_proxy.exe as SYSTEM in a suspended state, overwrite its memory with a payload, and resume to obtain AmPPL protection.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

This report describes three linked security weaknesses in Avast antivirus. First, a background scanning process could be accessed and modified by any user because its permissions were too open. Second, the attacker could use that access to trick a Windows scheduling service into running code with the highest system privileges. Third, Avast's own protection driver could be fooled into giving a malicious process the same protected status as antivirus processes, making it harder to remove.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by Denis Skvortcov

View all

2 more disclosed reports, best first.

More from Avast

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.