1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 19:08:26 -06:00

Implement detection of volumes with vulnerable XTS master key.

If vulnerability detected, a warning message is displayed during mount or backup/restore header, and changing the password is disallowed since it will not change the master key.
This commit is contained in:
Mounir IDRASSI
2024-08-02 00:20:53 +02:00
parent 6121ca0239
commit ed1263bf8c
24 changed files with 186 additions and 7 deletions

View File

@@ -652,6 +652,7 @@ namespace VeraCrypt
bool protectedVolumeMounted = false;
bool legacyVolumeMounted = false;
bool vulnerableVolumeMounted = false;
foreach_ref (const HostDevice &device, devices)
{
@@ -694,6 +695,10 @@ namespace VeraCrypt
if (newMountedVolumes.back()->EncryptionAlgorithmMinBlockSize == 8)
legacyVolumeMounted = true;
if (newMountedVolumes.back()->MasterKeyVulnerable)
vulnerableVolumeMounted = true;
}
catch (DriverError&) { }
catch (MissingVolumeData&) { }
@@ -708,6 +713,9 @@ namespace VeraCrypt
}
else
{
if (vulnerableVolumeMounted)
ShowWarning ("ERR_XTS_MASTERKEY_VULNERABLE");
if (someVolumesShared)
ShowWarning ("DEVICE_IN_USE_INFO");
@@ -741,10 +749,12 @@ namespace VeraCrypt
favorite.ToMountOptions (options);
bool mountPerformed = false;
if (Preferences.NonInteractive)
{
BusyScope busy (this);
newMountedVolumes.push_back (Core->MountVolume (options));
mountPerformed = true;
}
else
{
@@ -752,6 +762,7 @@ namespace VeraCrypt
{
BusyScope busy (this);
newMountedVolumes.push_back (Core->MountVolume (options));
mountPerformed = true;
}
catch (...)
{
@@ -769,6 +780,9 @@ namespace VeraCrypt
newMountedVolumes.push_back (volume);
}
}
if (mountPerformed && newMountedVolumes.back()->MasterKeyVulnerable)
ShowWarning ("ERR_XTS_MASTERKEY_VULNERABLE");
}
if (!newMountedVolumes.empty() && GetPreferences().CloseSecurityTokenSessionsAfterMount)
@@ -805,6 +819,9 @@ namespace VeraCrypt
}
}
if (volume->MasterKeyVulnerable)
ShowWarning ("ERR_XTS_MASTERKEY_VULNERABLE");
if (volume->EncryptionAlgorithmMinBlockSize == 8)
ShowWarning ("WARN_64_BIT_BLOCK_CIPHER");