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

22 Commits

Author SHA1 Message Date
Mounir IDRASSI
078d1410dd Linux/FreeBSD: Prevent mounting volumes on system directories and PATH (CVE-2025-23021, reported by SivertPL @__tfr)
Added security checks to prevent mounting VeraCrypt volumes on system directories (like /usr/bin) or directories in the user's PATH, which could theoretically allow execution of malicious binaries instead of legitimate system binaries.

Key changes:
- Block mounting on protected system directories (/usr, /bin, /lib, etc.)
  This restriction cannot be overridden
- Block mounting on directories present in user's PATH environment variable
  This can be overridden with --allow-insecure-mount flag
- Add visual warnings (red border, "[INSECURE MODE]") when mounting on PATH directories is allowed
- Handle symlinks properly when checking paths
- Add new error messages for blocked mount points

To override PATH-based restrictions only (system directories remain protected):
veracrypt --allow-insecure-mount [options] volume mountpoint

Security Impact: Low to Medium
The attack requires either:
- User explicitly choosing a system directory as mount point instead of using VeraCrypt's default mount points
- Or attacker having both filesystem access to modify favorites configuration AND knowledge of the volume password
Default mount points are not affected by this vulnerability.

Security: CVE-2025-23021
2025-01-14 14:59:45 +01:00
Mounir IDRASSI
2cca2e1daf Linux/FreeBSD: Add absolute paths for system binaries to prevent path hijacking (CVE-2024-54187, collaboration with SivertPL @__tfr)
This commit fixes a critical security vulnerability where VeraCrypt could be tricked into executing malicious binaries with elevated privileges. The vulnerability has two severe implications:

1. When sudo's secure_path option is disabled, attackers could execute malicious binaries with root privileges by placing them in user-writable PATH directories (e.g., making "sudo mount" execute a malicious mount binary)

2. By placing a malicious sudo binary in PATH, attackers could intercept and steal the user's password when VeraCrypt prompts for sudo authentication

The vulnerability allowed attackers to place malicious binaries in user-writable directories that appear in PATH before system directories, potentially leading to privilege escalation and credential theft.

Key changes:
- Implement FindSystemBinary() to locate executables in secure system paths
- Replace all relative binary paths with absolute paths for system commands
- Add security checks for executable permissions
- Update process execution to use absolute paths for:
  * sudo
  * mount
  * fsck
  * terminal emulators
  * file managers
  * system utilities (hdiutil, mdconfig, vnconfig, lofiadm)

The fix ensures all system binaries are called using their absolute paths from secure system directories, preventing both privilege escalation through PATH manipulation and password theft through sudo hijacking.

Security: CVE-2024-54187
2025-01-14 14:59:40 +01:00
Mounir IDRASSI
1b35abb191 Increment version to 1.26.18. Update copyright date. Update Release Notes. Update Windows drivers. 2025-01-14 12:26:28 +01:00
Mounir IDRASSI
ca331b8b34 Linux/macOS: Simplify sudo session detection logic and extend it to macOS
This update simplifies the logic for detecting active sudo sessions by checking the exit code of the sudo -n -l command, which reliably returns 0 if a session is active.

Additionally, this approach is now applicable to recent macOS versions, as they no longer have the sudo bug that previously prevented us from using this method.
2024-12-25 11:29:32 +01:00
Mounir IDRASSI
455a4f2176 Avoid conflict with C++17 features std::byte by using uint8 type instead of byte 2024-06-12 12:30:04 +02:00
Jertzukka
bd1e772657 FreeBSD: Fix privilege escalation prompts not showing up (#1349)
The behaviour of `wc -l` is different on FreeBSD, in which the stdout
result is padded by spaces in the beginning, which causes that the
result[0] is not actually the value we care about. This patch adds
a translate removing all whitespace from the output.
2024-06-03 08:09:54 +02:00
Jertzukka
0ffd61a55c Linux/FreeBSD: Fix privilege escalation prompts being ignored (#1100)
Currently if you fail the privilege escalation prompt, the second
one and consecutively every second will be ignored. This is because
if we do not --use-dummy-sudo-password and are on Linux/FreeBSD,
we will be prompted for password twice for one evaluation in the
while(!ElevatedServiceAvailable) loop.

For the fix, we make sure that we run the prompt only once for each
case.
2023-06-10 01:07:27 +02:00
Mounir IDRASSI
e7b3ca7334 Linux: try to fix some rare issues when invoking sudo using fork by waiting 1 second for forked process to start 2021-11-28 00:50:26 +01:00
Mounir IDRASSI
885cc1d01d Linux/MacOSX: Erase sensitive memory explicitly instead of relying on the compiler not optimizing calls to method Memory::Erase 2020-06-28 01:06:39 +02:00
Mounir IDRASSI
5fb407cffe Linux/MacOSX: use standard std::shared_ptr instead of our custom implementation which is kept for compatibility with older compilers. We also introduce compatibility code for old compilers that don't define std::unique_ptr 2020-06-26 01:22:18 +02:00
Christopher Bergqvist
0a2c565aa9 Switch from auto_ptr to unique_ptr (#638) 2020-06-11 18:02:28 +02:00
Mounir IDRASSI
ce78f89017 Linux/FreeBSD: Add CLI switch to force use of old sudo behavior of sending a dummy password
The new switch is --use-dummy-sudo-password
2019-11-04 00:10:08 +01:00
Mounir IDRASSI
80cc18f667 Linux/FreeBSD: Fix regression causing admin password to be requested too many times in some cases 2019-11-03 15:38:42 +01:00
Mounir IDRASSI
3bb661244c Linux: fix compilation error under CentOS 6 2019-10-17 14:09:33 +02:00
El Mostafa Idrassi
9463a628a6 Linux/FreeBSD: Use of 'sudo -n uptime' command to check whether user has an active 'sudo' session instead of the use of a 'dummy' password. (#513)
Signed-off-by: El Mostafa IDRASSI <el-mostafa.idrassi@prestalab.net>
2019-10-08 18:11:50 +02:00
Mounir IDRASSI
0ebc26e125 Update IDRIX copyright year 2017-06-23 22:15:59 +02:00
David Foerster
11716ed2da Remove trailing whitespace 2016-05-10 22:18:34 +02:00
Mounir IDRASSI
bda7a1d0bd Copyright: update dates to include 2016. 2016-01-20 00:53:24 +01:00
Mounir IDRASSI
041024fbb9 Update license information to reflect the use of a dual license Apache 2.0 and TrueCrypt 3.0. 2015-08-06 00:04:25 +02:00
Mounir IDRASSI
41a22ca4e7 Change namespace from TrueCrypt to VeraCrypt. Rename method from Resources Resources::GetTrueCryptIcon to Resources::GetVeraCryptIcon. 2014-11-08 23:20:14 +01:00
Mounir IDRASSI
edc9f36322 Replace TrueCrypt references in added sources and resources by VeraCrypt ones. 2014-11-08 23:19:03 +01:00
Mounir IDRASSI
7ffce028d0 Add TrueCrypt 7.1a MacOSX/Linux specific source files. 2014-11-08 23:18:59 +01:00