Skip to content
Path traversal Advisory Intermediate CVE-2020-26312

GHSL-2020-254: Arbitrary file read and/or write in dotmesh - CVE-2020-26312

The tar extraction routine in dotmesh attempted to prevent symlink escapes but could be bypassed by a chain of symlinks, allowing an attacker to create links pointing outside the extraction directory. This could lead to arbitrary file read or write with the permissions of the unpacking process.

ghsecuritylab Follow

Originally disclosed on GitHub Security Lab

The unsafe handling of symbolic links in an unpacking routine may enable attackers to read and/or write to arbitrary locations outside the designated target folder.

ghsecuritylab, on GitHub Security Lab

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 report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the symlink validation only checked the immediate target path without resolving chained symlinks, allowing a two-step escape.

Impact

An attacker who controls the archive could write arbitrary files with the permissions of the unpacking process, and if they can read the unpacked files, they could read arbitrary system files the parent process can access.

What the attacker needed

Attacker controls the tar archive; victim extracts the archive with dotmesh

How it was found

  1. Create a tar archive containing a symlink named subdir/parent pointing to ..
  2. Add another symlink inside that path, e.g., subdir/parent/escapes, also pointing to ..
  3. Extract the archive using the vulnerable untarFile routine
  4. The resulting symlink points outside the extraction directory, enabling access to files outside

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 report has not been written yet. The Original tab links to the source.

When you extract a tar archive, the program must ensure that files and links stay inside the target folder. Here, the check could be tricked by creating a link that points to the parent folder, and then another link inside that which escapes further. An attacker who controls the archive could then read or write files anywhere the program has access.

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 ghsecuritylab

View all

132 more disclosed reports, best first.

More from GitHub Security Lab

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.