Skip to content
Access control Write-up Advanced

CVE-2020-1337 – PrintDemon is dead, long live PrintDemon!

The Windows Print Spooler service allowed unprivileged users to create printer ports pointing to arbitrary file paths, and a patch for CVE-2020-1048 only checked permissions at port creation time. An attacker could bypass this by creating a port in a user-writable directory, then replacing that directory with a junction to a privileged location, leading to arbitrary file write as SYSTEM.

Paolo Stagno Follow

Published on voidsec.com

Banner Image by Sergio Kalisiak

voidsec, on voidsec.com

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 a time-of-check to time-of-use flaw: the patch validated the port path only at creation, not when the spooler later wrote to it, allowing a junction to redirect the write.

Impact

An attacker could achieve local privilege escalation by writing an arbitrary DLL to a system directory, which could then be loaded by a privileged process.

What the attacker needed

Local access to a Windows system; ability to add printers; ability to create directories and junctions

The fix

The vulnerability was fixed by Microsoft in August 2020, as indicated by the patch release and CVE assignment.

How it was found

  1. Create a directory where the user has write privileges.
  2. Create a new printer port pointing to that directory with a filename for the target DLL.
  3. Add a printer using that port.
  4. Delete the created directory.
  5. Re-create the directory as a junction to a privileged system folder.
  6. Pause printing jobs to trigger shadow job files, print the DLL content, reboot or restart the spooler, then un-pause to write the file.

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.

The Windows print service runs with high privileges and lets normal users add printers. A previous fix tried to stop users from pointing a printer at sensitive files, but it only checked permissions once, when the printer port was created. The researcher showed that you can create the port in a folder you control, then swap that folder for a shortcut (junction) to a protected system folder, so the print service later writes your file into a sensitive location.

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 from Microsoft

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.