1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2026-05-21 21:30:48 -05:00
Commit Graph

2033 Commits

Author SHA1 Message Date
Diogo Santos 504c94f12c Fix Off-By-One Stack Buffer Overflows in XML Parser (#1717)
* Off-By-One Null Byte Fix

* Add XML parser tests and improve XmlGetAttributeText handling

* Refactor XML testing: integrate XmlTest into AutoTestAlgorithms, add sentinel test for XmlGetNodeText insuficient output size.

* Remove no-op Tests.c change

---------

Co-authored-by: Mounir IDRASSI <mounir.idrassi@amcrypto.jp>
2026-05-10 10:41:10 +09:00
Mounir IDRASSI f6dcfa2b64 Harden TLV parser bounds checks
Reject empty or truncated TLV buffers, unsupported indefinite lengths, and declared value lengths that exceed the remaining input or uint16 node storage. Parse BER long-form lengths in big-endian order before copying value bytes.
2026-05-09 22:54:47 +09:00
Mounir IDRASSI f8837090b8 Linux/macOS: show volume creation finalization stages
Report explicit progress stages while writing volume data, writing backup headers, and flushing data to disk so the wizard does not appear stuck at 100%.

Keep the wizard in progress during Unix post-creation formatting and show status for temporary mount/device setup, mkfs invocation, and dismount.
2026-05-03 11:26:20 +09:00
Mounir IDRASSI abd089140b Linux: add emergency cleanup for stale unmounts
When normal filesystem unmount fails, the Linux path could stop before cleaning VeraCrypt mapper, loop and FUSE objects. Add an explicit emergency dismount request that is only reached after interactive confirmation.

The recovery path lazy-detaches mounted filesystems, uses deferred dmsetup removal for VeraCrypt mapper devices, detaches loop devices, and keeps normal force/ignoreOpenFiles behavior unchanged.
2026-05-02 23:03:29 +09:00
Marius Kjærstad 338fedc56c Fix whitespace issues in translation files (#1707) 2026-05-02 10:32:52 +09:00
Mounir IDRASSI b6744b8ed5 Increment version to 1.26.28 2026-04-30 13:39:51 +09:00
Mounir IDRASSI b88b9bf76d Language files: regroup newly added entries at the bottom for easy tracking 2026-04-29 16:37:32 +09:00
Mammoth 771acf5951 Linux: allow mounting NTFS volumes with ntfs3 (#1695)
* Linux: allow mounting volumes with ntfs3

* Linux: add ntfs3 preference for NTFS mounts

* Linux: wrap ntfs3 preference help text

* Add Linux ntfs3 mount preference

* Remove Russian translation changes from ntfs3 PR

* XML Translations: Add English fallback entries for ntfs3 preference

---------

Co-authored-by: Mounir IDRASSI <mounir.idrassi@amcrypto.jp>
2026-04-29 10:11:22 +09:00
Mounir IDRASSI a9b1d5ce57 Windows: Harden Windows driver input validation
Validate SecRegion password cache offsets before use.
Wipe decrypted SecRegion password-cache data even when cache validation fails.
Clamp encrypted I/O work item counts and check allocation sizing.
Reject invalid boot drive sector writes and initialize decoy wipe data unit.
Validate hidden-system boot offsets and remap arithmetic before use.
2026-04-26 18:42:26 +09:00
Mounir IDRASSI d841ac63e4 Windows: allow EFI repair to finalize stuck decryption 2026-04-26 18:36:54 +09:00
Mounir IDRASSI e0555e14f0 Windows: detect VeraCrypt loader before Windows loader 2026-04-26 18:36:26 +09:00
Mounir IDRASSI df4e755112 Windows: verify EFI loader restoration
Verify restored EFI Microsoft and fallback boot loader paths after system decryption.

Show clearer recovery guidance when EFI file restoration or NVRAM cleanup remains incomplete.

Add a GPT-only EFI boot loader repair menu action for already decrypted systems.
2026-04-26 16:47:04 +09:00
curious-rabbit e7188c96a4 Fix undefined behavior in StartElevated stderr read loop (#1550) (#1687)
The read loop that captures stderr from the sudo child process used
`vector<char> buffer(4096); buffer.clear();` followed by
`read(fd, &buffer[0], buffer.capacity())`. This has two instances of
undefined behavior:

1. `operator[](0)` on a vector with `size() == 0` violates the C++
   standard precondition `n < size()`. libstdc++ built with
   `-D_GLIBCXX_ASSERTIONS` aborts the process with:

     stl_vector.h:1128: Assertion '__n < this->size()' failed.

2. `buffer.begin() + bytesRead` on the same empty vector constructs
   an iterator past `end()`, also UB.

`-D_GLIBCXX_ASSERTIONS` is in the default build flags of Arch Linux,
Fedora, and several other distributions. On those systems, the
unprivileged helper process aborts as soon as sudo writes anything
to stderr (a password prompt, a 'user is not in the sudoers file'
error, etc.). The main process then sees EOF on the service output
pipe, and throws `InsufficientData`, which renders to the user as
'Not enough data available'. A second mount attempt fails at
`File::Write` because the helper is dead and the pipe is broken,
producing the bare message 'VeraCrypt::File::Write:395'.

Fix by replacing `buffer` with a plain `char[4096]` and using
`reserve(4096)` on `errOutput` to preserve the original
pre-allocation intent. No behavioral change on systems where the UB
happened to work; aborts are eliminated on systems where the
assertions fire.

Reported-by: multiple users, see veracrypt/VeraCrypt#1550,
              veracrypt/VeraCrypt#1446, veracrypt/VeraCrypt#844

Co-authored-by: rabbit <rabbit@github>
2026-04-23 21:03:20 +09:00
Mounir IDRASSI 357ce6bd7a macOS: harden FUSE-T SMB metadata handling
Increase advertised metadata file size, broaden hdiutil path normalization, and make auxiliary device info updates atomic.
2026-04-22 23:20:25 +09:00
Mounir IDRASSI deb7f55bfb macOS: stabilize FUSE-T SMB mount metadata
Make /aux-device-info readable for SMB, verify that FUSE records hdiutil device info after mount and recover missing virtual devices from hdiutil before dismounting auxiliary mounts.
2026-04-22 16:32:10 +09:00
Mounir IDRASSI 4271b8e6f5 macOS: stabilize FUSE-T SMB auxiliary mounts
Add statfs metadata for the auxiliary FUSE mount, keep /control read-only by sending hdiutil device data through /aux-device-info and tolerate delayed SMB rediscovery during mount completion. Log final control-file retry failures for diagnostics.
2026-04-22 14:37:57 +09:00
Mounir IDRASSI 7cd062c42e Windows: honor EFI boot menu options in PostOOBE repair
Use the same SystemFavorites service flag mapping for /PostOOBE bootloader repair as the non-forced service update path. This prevents Windows upgrade repair from adding VeraCrypt to BootOrder or forcing it first when those actions are disabled, while forced updates keep their previous behavior and still repair the loader.
2026-04-21 12:16:33 +09:00
Mounir IDRASSI 49c68ea1ab Windows: handle Argon2 derivation failures 2026-04-20 19:49:45 +09:00
Mounir IDRASSI e59eb421fb Linux/macOS: Implement missing Argon2 KDF support on Unix 2026-04-19 17:52:44 +09:00
Mounir IDRASSI e07bd19f20 Windows: Validate PIM on KDF-only password changes 2026-04-19 17:51:02 +09:00
Mounir IDRASSI e6adb96b15 Windows: fix favorite volume mount race
Copy selected favorite volumes into mount thread parameters so background mounting does not depend on mutable global vector storage. Also avoid unnecessary FavoriteVolume copies in auto-mount paths and fix mount-on-arrival state updates.

Refs #1661
2026-04-18 15:34:38 +09:00
Mounir IDRASSI da2198831f Windows bootloader: Add EFI DCS guard for Argon2 support
We don't support yet Argon2 for EFI booloader build
2026-04-17 16:03:42 +09:00
audriusbuika 4fea6403ce Windows: Fix elevated COM format drive validation and device path normalization (#1670)
* Windows: Add input validation whitelists to elevated COM methods

* Windows: Add drive number validation to FormatNtfs and FormatFs COM methods

* Windows: Fix correctness regressions in elevated COM format and device path validation

* Windows: Revert unready COM input validation; keep FormatNtfs/FormatFs return fix
2026-04-16 10:31:02 +09:00
Mounir IDRASSI 3e9c47d256 Linux/macOS: collect mouse entropy from nested controls
wxWidgets does not propagate mouse motion events from child controls to parent windows. The Linux/macOS GUI was binding the random-pool mouse handlers only to the dialog/page and its direct children, which left nested controls such as static-box contents and the wizard image as dead zones.

Add a reusable recursive child-window event binder and use it in the keyfile generator, random pool enrichment dialog, and volume creation wizard. The root windows keep their existing generated bindings, while descendants are bound explicitly, avoiding duplicate handling on the root while covering all nested controls.

This makes the entropy gauge and the random pool update consistently no matter where the pointer moves inside the affected windows.

Fixes #1656.
2026-04-15 16:38:08 +09:00
Mounir IDRASSI 631d0cc420 Build: fix macOS text self-test with wxWidgets 3.3.2 2026-04-15 14:58:43 +09:00
Mounir IDRASSI 5055382f08 macOS: fix macOS local arm64 build affecting Volume archive
Local macOS builds disable universal binaries. On Apple Silicon, that means
the regular objects are built for arm64 only, but Volume.make still selected
the macOS assembly bundle. Several of those assembly outputs are x86_64 only,
which makes ranlib reject Volume.a because it contains mixed cputypes.

Make local arm64 macOS builds use the existing arm64 crypto object path and
have the macOS build wrapper export CPU_ARCH/COMPILE_ASM consistently for
local builds.
2026-04-15 10:53:32 +09:00
Mounir IDRASSI 07f0b5fcaf Build: handle removed wxWidgets configure options
wxWidgets 3.3 removed the configure switches for explicitly enabling
Unicode and std_string support. Passing these options now makes configure
fail with "unrecognized options" when option checking is enabled.

Keep the legacy switches for older wxWidgets releases, but only add them
from the wxbuild recipe when the target configure script still supports the
corresponding Autoconf option variables.
2026-04-15 09:34:20 +09:00
audriusbuika f63c617431 Fix hibernation crash on fresh Windows 11 25H2 (BSOD Event 41) (#1671)
* Fix hibernation crash on fresh Windows 11 25H2 (BSOD Event 41)

* follow up on the hibernation fix review: fix MDL check order and drop the risky sleep.
2026-04-15 09:22:46 +09:00
Mounir IDRASSI 5b4fae60a8 Linux: honor nokernelcrypto during external formatting 2026-04-14 23:37:41 +09:00
Mounir IDRASSI 868dab4fca Windows: fix ARM64 MSI build 2026-04-14 20:22:59 +09:00
Mounir IDRASSI 976bb3767b Windows: Fix MSI traveler disk creation with WHQL-signed drivers
Make MSI-installed VeraCrypt use the IDRIX-signed COMReg package as the
source for traveler files, matching the EXE installer flow. COMReg now
packages the x64 traveler payload, so traveler creation no longer has to
copy the installed x64 driver from appDir\veracrypt.sys and verify it
against a Microsoft WHQL certificate fingerprint.

Keep Microsoft WHQL certificate verification only for the loose portable
driver fallback, where driver files cannot be signed with the IDRIX code
signing certificate. The normal VerifyModuleSignature path now remains
IDRIX-only.

Also validate that an MSI COMReg package actually contains the required
x64 traveler files before reporting success, avoiding partial traveler
directories when the package payload is incomplete.
2026-04-14 18:43:07 +09:00
Mounir IDRASSI 250a488a84 macOS: Use SMB backend for FUSE-T auxiliary mounts 2026-04-14 14:42:36 +09:00
Ragdoll 2ed98b50d3 Fix erroneous 2 TiB limit for hidden file containers in GUI wizard (#1672) 2026-04-13 16:55:37 +09:00
amail80 1ea0556cbe Fix ghost drive letter after CLI dismount (GH #337, GH #1426) (#1658)
When dismounting via CLI (/d /q /s), SHChangeNotify is called without
SHCNF_FLUSH flag, making it asynchronous. The process exits before
Explorer processes the notification, leaving a phantom drive letter
visible in Explorer as an inaccessible Local Disk until reboot.

Add SHCNF_FLUSH in Silent (CLI) mode to force synchronous shell
notification processing in both single-volume (UnmountVolumeBase)
and dismount-all (DismountAll) code paths. The flush is only added
in CLI mode to avoid adding latency to interactive GUI operations.

Co-authored-by: Contributor <contributor@example.com>
2026-04-13 15:07:32 +09:00
babastienne adfc768813 Fix: Incorrect tooltip on mouseover due to bad translation key (fix #1635) (#1637)
The commit 9ea5ccc4aa introduced this bug
by creating a translation key named "DISABLE_SCREEN_PROTECTION_WARNING"
but used the key "DISABLE_SCREEN_PROTECTION_HELP" into the installation
wizard.
2026-04-13 14:28:43 +09:00
Mounir IDRASSI cdc00dc4aa Linux: add support for building against FUSE3 2026-04-13 09:43:22 +09:00
Mounir IDRASSI f7c9e62909 macOS: fix typo in defaultDirs in Process::FindSystemBinary 2026-04-13 09:42:40 +09:00
Mounir IDRASSI 573f870175 Increment version to 1.26.17 is packaging files. 2025-09-21 16:49:05 +09:00
Mounir IDRASSI b1007c6135 Increment version to 1.26.27. Update Release notes, Windows driver, bootloader 2025-09-21 11:56:50 +09:00
Mounir IDRASSI b952201412 Windows: Add setting/CLI switch to enable IME during Secure Desktop. Fix Preferences tabs handling.
Now it is possible to enable IME during Secure Desktop using a setting in Preferences or using /enableIME switch.
This helps solve issues with some IME that causes VeraCrypt to freeze when selecting keyfile while VeraCrypt secure desktop is active.
See: https://sourceforge.net/p/veracrypt/discussion/general/thread/1e8b9aeacd
2025-09-20 22:31:13 +09:00
Mounir IDRASSI a7ebddc5f3 Windows driver: enhance IRP completion by avoiding inline ones and using CriticalWorkQueue for faster completion dispatch
This change adds more robustness in low memory case and avoid freezes.
It also protects cancel handling with cancel spin lock
2025-09-17 04:51:57 +09:00
Mounir IDRASSI e4e6b167e2 Windows driver: add safe MapIrpDataBuffer function to prevent rare BSOD when irp->MdlAddress is NULL
Introduce MapIrpDataBuffer to handle Direct/Buffered/Neither I/O, probing & locking pages and allocating a temp MDL when needed.
Replace blind MmGetSystemAddressForMdlSafe usage. clean up TempUserMdl in OnItemCompleted to avoid crashes when MdlAddress is NULL.

Issue reported at https://sourceforge.net/p/veracrypt/discussion/technical/thread/e43bde8d86/
2025-09-15 14:34:22 +09:00
Mounir IDRASSI f257d7b4a5 Windows driver: revert to single completion thread until proper implementation is in place 2025-09-15 11:25:05 +09:00
Mounir IDRASSI 41812674bb Windows: correct processor group affinity handling and off-by-one mapping
- Replace dynamic GetProcAddress usage with direct SetThreadGroupAffinity call since we run under Windows 10 minimum
- Compute affinity mask based on actual active processor count
- Fix off-by-one when assigning threads to processor groups (use > instead of >=), preventing premature group advance
- Improves correctness on multi-group (>=64 CPU) systems
2025-09-13 23:30:13 +09:00
Mounir IDRASSI f380dc13d9 Windows driver: fix VERIFY/TRIM offset & validation, label handling, CPU group affinity, and cleanup
- Use local volumeOffset, correct IOCTL_DISK_VERIFY & TRIM range translation/validation
- Enforce DataSetRangesLength alignment & per-range sanity checks
- Add missing returns after PsTerminateSystemThread
- Remove obsolete PsDereferenceImpersonationToken dynamic lookup
- Correct wide string size usage & zero label info buffer
- Fix DEBUG_TRACE macro check and GetCpuGroup off-by-one. proper affinity mask
- Minor safety/clarity cleanups
2025-09-13 23:26:12 +09:00
Mounir IDRASSI 54b81ed2d1 Windows driver: add defensive checks to TCCloseVolume implementation 2025-09-13 15:26:53 +09:00
Mounir IDRASSI 0b60d2a119 Windows: remove wrong static declaration of functions in Ntvol.h 2025-09-13 15:25:56 +09:00
Mounir IDRASSI 02e7b48836 Windows driver: revert IRP completion overhaul changes until more tests are conducted 2025-09-13 15:08:38 +09:00
Mounir IDRASSI f6f25eec8f Windows driver: simplify TCSleep to use KeDelayExecutionThread
Replace timer-based TCSleep (which allocated a KTIMER and waited on it) with an
implementation that calls KeDelayExecutionThread. This removes dynamic allocation
and kernel timer usage to simplify the code and reduce resource overhead.
Adds an IRQL <= APC_LEVEL assertion and documents the requirement.

This is safe because TCSleep is always called from code that runs at PASSIVE_LEVEL
2025-09-08 12:14:20 +09:00
Mounir IDRASSI 7df2c2957f Windows driver fix: Decrement IoThreadPendingRequestCount on allocation failure in MainThreadProc
Added InterlockedDecrement in the error path when GetPoolBuffer fails for EncryptedIoRequest to ensure accurate tracking of pending IO requests and prevent potential resource leaks.
2025-09-08 11:40:33 +09:00