Using ASCII code 0 can bypass the file download restriction on url/loca/lnk [Windows 10]
A file-download restriction in the browser could be bypassed by inserting a control character into the file extension, so a file with a normally blocked extension such as .url could be saved instead of being renamed to .download. The file could not be launched from the browser, but if the user later ran it from the folder it could be dangerous.
- Fixed in 33 days
- Paid in 39 days
- Disclosed after 33 days
Created attachment 9396437
poc.html
I discovered an incorrect symbol override of the character when placed in the file extension name. When the "Always ask for file save" flag is enabled, it is possible to save prohibited extensions that will not be converted to .download.
It is not possible to run such a file from the browser, but if the user executes the file from the folder, it could be dangerous.
An example of a file name looks like this: example.url. You can change it to any type of extension by adding just the character.
This works only for Windows.
I see that I cannot correctly transmit this character through the panel, decrypt BASE64 to understand which character is being discussed.
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 extension check did not normalise or strip control characters before comparing the file name against the blocked-extension list.
Impact
A user could be tricked into saving a file type the browser intends to block, and running it later from disk could be dangerous; the browser itself will not launch it.
What the attacker needed
Windows operating system; victim downloads a crafted file; victim runs the saved file
How it was found
- Enable the 'Always ask for file save' setting in the browser.
- Download a file whose extension contains the control character, for example a .url file.
- Observe that the file is saved with its original extension instead of being converted to .download.
- Run the saved file from the folder to see that it can execute.
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.
Browsers often block or rename dangerous file types when you download them, for example turning a shortcut file into a harmless .download file. Here, putting an invisible control character inside the extension confused that check, so the dangerous file kept its real extension. The attacker still needs the victim to open the saved file themselves, because the browser will not run it.
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.