Extension sanitization (.lnk, .local) bypass using pipe (|) + "Always ask you where to save files"
When the 'Always ask you where to save files' setting is enabled, Firefox's extension sanitisation can be bypassed using a pipe character in the filename, causing a file like 'test.ln||k' to be saved as 'test.ln k.lnk'. An attacker could use this to deliver dangerous file types such as .lnk, .local, .url, or .scf that would normally be filtered.
- Fixed in 11 months
- Paid in 11 months
- Disclosed after 11 months
+++ This bug was initially created as a clone of Bug #1815204 +++
Weirdly, when "Always ask you where to save files" enabled, it is again possible to bypass filters and save lnk / local / url / scf files in Firefox.
For instance, saving a file named "test.ln||k" with "Always ask you where to save files" gets transformed to a file named "test.ln k.lnk" which is considered a .lnk extension, bypassing the filtering.
(1) Enable "Always ask you where to save files".
(2) Test the download by clicking the link using https://deluxe-remarkable-cacao.glitch.me/
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 filename sanitisation logic does not properly handle pipe characters when the 'Always ask' setting is enabled, allowing the extension to be altered after filtering.
Impact
An attacker could deliver dangerous file types (.lnk, .local, .url, .scf) that Firefox would normally block, potentially leading to code execution if the user opens the file.
What the attacker needed
Firefox user; 'Always ask you where to save files' enabled; Victim downloads a file from a malicious site
How it was found
- Enable the 'Always ask you where to save files' setting in Firefox.
- Visit the test page and click the download link.
- Observe that a file named 'test.ln||k' is saved as 'test.ln k.lnk', bypassing the extension filter.
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.
Firefox tries to stop you from downloading dangerous files by checking their extension (the part after the last dot). This report shows that if you turn on the setting that asks where to save each file, a specially crafted filename with a pipe character can trick Firefox into saving a dangerous file anyway. An attacker could then send you a file that looks harmless but is actually a shortcut or script.
What is File upload?
An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.