Unauthenticated Arbitrary File Write (Zip Slip) via shapefile.clj on cmr.earthdata.nasa.gov
The shapefile upload feature on the CMR Search API extracted ZIP entries without checking their names for directory traversal sequences, so an attacker could write files outside the intended extraction directory. Because the service ran as root, this arbitrary file write could be leveraged toward full system compromise.
- Accepted in 23 days
- Fixed in 41 days
- Disclosed after 51 days
Summary by obaskly
An unauthenticated arbitrary file write vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory) was discovered in the NASA CMR Search API's shapefile upload functionality. The endpoints /search/collections and /search/granules accept shapefile uploads as ZIP files. However, the ZIP extraction function (shapefile.clj) failed to validate entry names against directory traversal sequences (../).
This flaw, commonly known as "Zip Slip," allowed an unauthenticated attacker to write arbitrary files to unintended locations outside of the designated extraction directory. Because the underlying service was executing with root privileges, this arbitrary file write vulnerability could be chained or leveraged to achieve full system compromise. The issue was verified by writing a benign file to the disk and confirming its existence.
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 ZIP extraction routine did not check entry names for traversal sequences before writing them to disk.
Impact
An unauthenticated attacker could write arbitrary files outside the extraction directory, and because the service ran as root this could be chained to full system compromise.
What the attacker needed
Unauthenticated access to the search endpoints; ability to upload a crafted ZIP shapefile
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 upload a ZIP file, each file inside has a name. If a name contains '..' it can point to a folder above the one the program meant to use. The program trusted those names, so an attacker could drop files anywhere on the server, and since it ran with the highest permissions, that is serious.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.