veracrypt / VeraCrypt

Disk encryption with strong security based on TrueCrypt
https://www.veracrypt.fr
Other
6.76k stars 937 forks source link

Clicking Select File... causes lock up of program on Windows 11 #1161

Closed thadguidry closed 11 months ago

thadguidry commented 1 year ago

Expected behavior

Select file... should open a file explorer dialog to select the encrypted file on disk.

Observed behavior

No explorer dialog opens. The program then becomes unusable and interactivity halts on anything clicked in the Veracrypt UI. I must then use Task Manager to End task.

Workaround for now: Manually typing in the encryption file path in the Volume input box and then clicking Mount does work successfully. My hunch is that the Select file... not working is likely due to a recent update on Windows 11 Insider or Veracrypt's file dialog handler might need to be updated? Dunno.

Steps to reproduce

  1. Open Veracrypt.exe
  2. Click on H: drive icon
  3. Click on Select File... button
  4. Notice that UI locks up and cannot even be exited (must End task from Task Manager)

Screenshots

Your Environment

Please tell us more about your environment

VeraCrypt version: 1.25.9

Operating system and version: Windows 11 Pro Insider Preview Build 23511.ni_prerelease.230722-2325

System type: 64-bit

idrassi commented 1 year ago

This issue has been reported and discussed in Sourceforge forums:

https://sourceforge.net/p/veracrypt/discussion/technical/thread/17c681a98e/?limit=25#16f1

Specifically, one user was able to narrow down the issue to OneDrive and a reinstallation of OneDrive using installer from Microsoft website seems to solve the issue.

As I indicated in my response at the bottom of this thread, a safe approach is to use Drag-n-drop facility of VeraCrypt to mount file containers(just drop the file on VeraCrypt UI and it will fill the container file path automatically). No need to manually type the file container path.

Here is a quote of my answer on the Sourceforg thread:

For the issue about "Select File", there is nothing that can be done from VeraCrypt because it is Explorer shell who causes the issue: in the past, I have encountered issues with certain Explorer Shell Extensions that are automatically loaded when using the open file dialog and which cause issues with VeraCrypt. These shell extensions are loaded into VeraCrypt memory space and there is no way to block them from being loaded. In this particular case, it is the shell extension of One Drive that causes the issue.

From security point of view, having foreign dlls loaded into VeraCrypt memory space is not good and so I advice to always use Drag-n-drop facility of VeraCrypt to mount file containers instead of clicking on the "Select File" button.

The more secure approach would be to implement a custom file selection dialog that doesn't use Explorer Shell but this is too much work.

On my side, I don't have this issue on my Windows 11 22H2 with latest updates installed (OS build 22621.1992) but I don't have OneDrive installed.

On your side, do you have OneDrive installed? If yes, can you uninstall it and then check if the issue still remains?

Of course, I will try to reproduce to try to understand the cause.

thadguidry commented 1 year ago

From security point of view, having foreign dlls loaded into VeraCrypt memory space is not good and so I advice to always use Drag-n-drop facility of VeraCrypt to mount file containers instead of clicking on the "Select File" button.

Good to know!

I uninstalled OneDrive and the issue remains. However, I am happy to close this issue since the drag-drop facility seems to be easier and safer as you explained.

idrassi commented 1 year ago

Thank you for the update. There must be some other shell extension in your machine that is causing the hang. Any special shell extension installed on your side? On my Windows 11, I have only TortoiseGit, TortoiseHg and GpgEx shell extensions and no hang happens.

I will leave this issue open so that others can find it.

idrassi commented 1 year ago

I have implemented a change in VeraCrypt to try to address this issue by replacing legacy file/dir selection APIs with modern Windows IFileDialog interface (cf commit https://github.com/veracrypt/VeraCrypt/commit/2a6726b00ed51430590e01950a5c0f67ede9e8a9)

I have prepared a Release Candidate for the imminent official 1.26 version of VeraCrypt and windows installers are available on Sourceforge under Nightly Builds folder.

Please test it out and share any observations or issues you encounter.

thadguidry commented 11 months ago

@idrassi Tested with the nightly build for 1.26.6 (msi file) and it resolves this issue! Select folder button immediately opened an explorer dialog. Thanks for the fix!

idrassi commented 11 months ago

Thank you @thadguidry for the confirmation, I really appreciate!