Skip to content
Path traversal Write-up Advanced

Writeup for CVE-2023-39143: PaperCut WebDAV Vulnerability

A path traversal flaw in PaperCut's WebDAV component on Windows allowed attackers to list, download, and delete arbitrary files, and in some configurations upload files leading to remote code execution. Attackers could also brute-force a weak WebDAV password and use hardcoded credentials to generate scan job IDs for file upload.

Naveen Sunkavally Follow

Published on horizon3.ai

Attack Blogs, Disclosures

Naveen Sunkavally, on horizon3.ai

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 combination of weak authentication, missing rate limiting, path traversal in a third-party WebDAV library that did not sanitise backslashes on Windows, and hardcoded credentials, all chained together.

What the attacker needed

Network access to PaperCut over HTTPS; Windows install of PaperCut NG/MF; external device integration enabled for upload; valid scan job id for upload

The fix

It was fixed in PaperCut version 22.1.3, which enforces a strong WebDAV password, rate limiting, restricts WebDAV methods, and fixes the path traversal issues.

How it was found

  1. Brute-force the six-digit password for the papercut-webdav user on the WebDAV endpoint.
  2. Use the WebDAV PROPFIND method with path traversal to list arbitrary directories.
  3. Use the WebDAV DELETE method with path traversal to delete arbitrary files or folders.
  4. Use the WebDAV COPY method to copy a target file into the webdav folder with a png extension.
  5. Use a second path traversal in the CustomReportExample servlet to download the copied file.
  6. If file upload is possible, generate a scan job id via the site server API or XMLRPC API, then use WebDAV PUT with path traversal to upload a file anywhere.

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 a security flaw in PaperCut, a print management program. The flaw let someone who could reach the server trick it into showing, downloading, or deleting any file on the computer, and sometimes even run their own code. The problem came from several small mistakes that, added together, gave an attacker full control.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

More by Naveen Sunkavally

View all

5 more disclosed reports, best first.

More from PaperCut

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.