#638 [Linux] Mounted file-hosted container can be silently overwritten/truncated by a browser download, destroying volume header and filesystem
Describe the bug
On Linux, a mounted file-hosted VeraCrypt container has zero protection against being overwritten or truncated in-place by another userspace process (such as a web browser saving a downloaded file).
While my container was actively mounted, I accidentally saved a file from a browser over the container's path. The browser overwrote/truncated the mounted container file silently with no error, no lock, and no warning. This instantly wiped out the VeraCrypt volume header and destroyed the internal ext4 filesystem. Because the host drive is an NVMe SSD with TRIM enabled, the overwritten data is permanently unrecoverable.
Steps to reproduce
- Create and mount a file-hosted VeraCrypt container (e.g., formatted with
ext4) on Linux. - While the container is actively mounted, download any file in a web browser and save it to the same filename/path as the mounted container.
- Observe that the file write succeeds without blocking or warning.
Expected behavior
An actively mounted encrypted volume should not be trivially destroyed by a single accidental browser download, unlike Windows where the open file lock prevents overwriting a mounted container.
VeraCrypt on Linux should implement safeguards against accidental in-place overwriting/truncation of mounted containers (for example, strict locking/lease mechanisms, protective permissions/flags while mounted, or explicit warnings and automatic header backup handling).
Environment
- OS: Ubuntu 24.04 LTS (Linux)
- Container type: File-hosted container (
ext4inside) - Storage: NVMe SSD (with TRIM)
Additional context
Thank you so much for this amazing "feature" that lets a single browser download nuke an entire mounted encrypted container, its header, and its filesystem without a single complaint. Great job, freaks.