Skip to content
Path traversal Advisory Intermediate

GHSL-2022-004: Partial path traversal in Apache Pinot

The untar function in Apache Pinot checked whether extracted file paths started with the output directory's canonical path, but without a trailing slash, allowing a crafted archive entry to write outside the intended directory. An attacker could exploit this to break out of the expected folder.

jarlob Follow

Originally disclosed on GitHub Security Lab

Latest revision 4bae48b on Linux

jarlob, 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

The code compared canonical paths using startsWith without ensuring the output directory path ended with a slash, so a sibling directory with a matching prefix passed the check.

Impact

This issue allows to break out of expected folder.

What the attacker needed

Crafted tar.gz archive; ability to supply archive to untar function

The fix

The issue was fixed in the main branch and released in v0.10.0.

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 should ensure all files go into a specific folder. This code checked if the file path started with the folder path, but forgot a slash at the end, so a path like '/usr/outnot' was wrongly accepted as being inside '/usr/out'. That let an attacker write files outside the intended folder.

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 jarlob

View all

192 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.