Arbitrary File Read via Path Traversal in SDTP File Download Endpoint
The SDTP server trusts an unsigned HTTP header for authentication and passes user-supplied file paths directly to Flask's send_file() without validation. An unauthenticated attacker can set the header to impersonate any user, register a file record pointing to any filesystem path, and download its contents, including database credentials and Kubernetes tokens.
Originally disclosed on Bugcrowd
- Accepted in 35 days
- Fixed in 36 days
- Disclosed after 40 days
Summary by bl4cksku11
NASA's Science Data Transfer Protocol (SDTP) server contains two vulnerabilities in its publicly available source code that chain together to allow unauthenticated arbitrary file read from the server filesystem.
- Authentication bypass: SDTP authenticates requests using a plain, unsigned HTTP header (
Cert-UID). Any client that can reach the endpoint can authenticate as any user, including admin, by setting this header. - Path traversal: The file download endpoint accepts a
file:location prefix and passes the path directly to Flask'ssend_file()with no validation or directory confinement (server/bin/endpoint/files.py:46-47).
Chaining these two issues, an unauthenticated attacker can register as admin, store a file record pointing to any path on the filesystem, and download its contents through the API. Confirmed readable targets include the PostgreSQL connection config (containing plaintext database credentials) and the Kubernetes service account token (enabling authenticated API calls against the cluster).
Source code: https://gitlab.modaps.eosdis.nasa.gov/infrastructure/transfers/sdtp PoC environment: https://github.com/bl4cksku11/sdtp-bugcrowd-poc
CWE-22 (Path Traversal), CWE-306 (Missing Authentication for Critical Function).
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 server relies on a client-supplied header for authentication and fails to validate or confine file paths before passing them to send_file().
Impact
An unauthenticated attacker could read arbitrary files, including plaintext database credentials and Kubernetes service account tokens, potentially leading to full cluster compromise.
What the attacker needed
Network access to the SDTP endpoint; no authentication required
The fix
The server should use signed authentication tokens and validate that file paths are confined to an allowed directory before calling send_file().
How it was found
- Set the Cert-UID header to impersonate an admin user.
- Register a file record with a file: location pointing to a target path on the filesystem.
- Request the file download endpoint to retrieve the file contents.
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.
This report describes two mistakes in a file-sharing server. First, the server believes a simple text label that says who you are, so anyone can pretend to be an administrator. Second, when asked to download a file, the server does not check that the file is inside the allowed folder, so it will hand over any file on the computer, such as passwords or secret keys.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.