CVE-2024–45186: Unauthenticated SSTI bug in Filesender exposes
An unauthenticated attacker could inject template tags into a base64-encoded error message, causing the server to render configuration values such as database credentials and cloud storage keys. This could expose all uploaded files if those credentials were used to access the storage.
Published on medium.com
FileSender is an open-source web application designed for securely transferring large files. The idea for FileSender was born in 2007 during a task-force meeting of the pan-European network for the research and education community GÉANT.
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
Likely the application decoded a user-controlled base64 string and passed it to a template renderer without sanitising template tags, allowing configuration values to be read.
Impact
An unauthenticated attacker could read sensitive configuration values, including database credentials and cloud storage keys, which could lead to access to all uploaded files; however, files encrypted with a user-chosen password would remain protected.
What the attacker needed
No authentication required; target runs a vulnerable FileSender version
The fix
The fix stored the error message in the user session instead of accepting it from the user, and later isolated sensitive configuration variables into a separate file.
How it was found
- Send a request to the file download endpoint with an expired file, which returns a base64-encoded error message.
- Decode the base64 message to see a JSON object with a message field.
- Change the message field to a template tag such as cfg:db_username and re-encode it.
- Send the modified base64 string back to the server.
- Observe that the server renders the configuration value in the error page.
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.
The application took a message from the user, decoded it, and then inserted it into a template without checking it. By putting special template instructions in the message, an attacker could make the server reveal secret settings like passwords. This is called server-side template injection.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.