Skip to content
Path traversal Write-up Intermediate

When a Prefix Looks Like a Boundary: A Public-Share Path Traversal in SFTPGo (CVE-2026–49244)

The public browsable-share partial-ZIP download endpoint checked whether a requested file path started with the share's base directory using a raw string-prefix comparison, so a sibling directory whose name began with the same characters was accepted. An attacker who knows a passwordless browsable share URL could download files from that sibling directory in a ZIP archive.

Christopher Linke Follow

Published on medium.com

When a Prefix Looks Like a Boundary: A Public-Share Path Traversal in SFTPGo (CVE-2026–49244)

Christopher Linke, on medium.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

The final containment check in getZipEntryName used a raw string-prefix comparison instead of a separator-aware directory-boundary check, so a sibling path sharing the base name's prefix passed.

Impact

Files in a prefix-overlapping sibling directory could be read without authorisation, but only where such a sibling exists, is readable in the share owner's context, and the share is browsable and its URL (and password, if set) is known.

What the attacker needed

A browsable public share exists; attacker knows the share URL; share password if one is set; prefix-overlapping sibling directory exists

The fix

It was fixed in v2.7.3 by replacing the raw prefix comparison with a separator-aware directory-boundary check, the same shape already used for the browse path parameter.

How it was found

  1. Create a user with two sibling directories, one shared and one not, and place a file in each.
  2. Create a read-scoped browsable share pointing only at the first directory.
  3. Send a partial-download request to the share with the files field naming a path that steps into the sibling directory.
  4. Inspect the returned ZIP and observe the sibling file's contents under an entry name with a stray leading character.

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.

A share lets someone publish one folder so others can download from it without logging in. The server was meant to refuse anything outside that folder, but it only checked that the file's path began with the same letters as the folder name. So a folder called 'share2' sitting next to 'share' looked close enough, and its files could be pulled out.

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 Christopher Linke

View all

1 more disclosed report, best first.

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.