curl still vulnerable to SMB access smuggling via FILE URL on Windows
The fix for CVE-2019-15601 did not fully block SMB access via FILE URLs on Windows. An attacker could craft a URL that causes curl to fetch a file from a remote SMB share, potentially leaking local or remote file contents.
Originally disclosed on HackerOne
- Disclosed after 10 months
Summary:
The released fix for CVE-2019-15601, SMB access smuggling via FILE URL on Windows, leaves curl still vulnerable to SMB access smuggling via FILE URLs.
- FILE URLs formatted as
file:////smb_server/smb_share/fileare not filtered. - FILE URLs which point to the global DOS name space, ??, and formatted as
file:///%3f%3f/UNC/smb_server/smb_share/file_nameorfile:///%3f%3f/GLOBAL/UNC/smb_server/smb_share/fileare not filtered.
Steps To Reproduce:
curl file:////localhost/c$/windows/win.inicurl file:///%3f%3f/UNC/localhost/c$/windows/win.inicurl file:///%3f%3f/GLOBAL/UNC/localhost/c$/windows/win.ini
The above examples will return the contents of C:\Windows\win.ini utilizing SMB to fetch the file via the local administrative share for the C drive. This will also work with remote shares.
Impact
A properly crafted URL could cause a user to unknowingly access a remote file.
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 fix only blocked certain FILE URL patterns but missed alternative formats that still resolve to SMB paths on Windows.
Impact
A crafted URL could cause a user to unknowingly access a remote file via SMB.
What the attacker needed
Windows system; curl with FILE URL support; user runs curl on a crafted URL
How it was found
- Run curl with a FILE URL using four slashes to point to a local administrative share.
- Run curl with a FILE URL using encoded question marks to point to the global DOS namespace.
- Run curl with a FILE URL using encoded question marks and GLOBAL to point to the global DOS namespace.
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.
curl is a tool for downloading files from the internet. On Windows, a special kind of address starting with 'file:' can make curl read files from network shares. The report shows that some of these addresses still work even after a fix, so a user could be tricked into reading a file from another computer.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.