CVE-2025-34075
Severity CVSS v4.0:
MEDIUM
Type:
CWE-94
Code Injection
Publication date:
02/07/2025
Last modified:
03/07/2025
Description
An authenticated virtual machine escape vulnerability exists in HashiCorp Vagrant when using the default synced folder configuration. By design, Vagrant automatically mounts the host system’s project directory into the guest VM under /vagrant (or C:\vagrant on Windows). This includes the Vagrantfile configuration file, which is a Ruby script evaluated by the host every time a vagrant command is executed in the project directory. If a low-privileged attacker obtains shell access to the guest VM, they can append arbitrary Ruby code to the mounted Vagrantfile. When a user on the host later runs any vagrant command, the injected code is executed on the host with that user’s privileges.<br />
<br />
While this shared-folder behavior is well-documented by Vagrant, the security implications of Vagrantfile execution from guest-writable storage are not explicitly addressed. This effectively enables guest-to-host code execution in multi-tenant or adversarial VM scenarios.
Impact
Base Score 4.0
5.40
Severity 4.0
MEDIUM
References to Advisories, Solutions, and Tools
- https://developer.hashicorp.com/vagrant
- https://developer.hashicorp.com/vagrant/docs/synced-folders/basic_usage
- https://developer.hashicorp.com/vagrant/docs/vagrantfile
- https://raw.githubusercontent.com/rapid7/metasploit-framework/master/modules/exploits/multi/local/vagrant_synced_folder_vagrantfile_breakout.rb
- https://vulncheck.com/advisories/hashicorp-vagrant-synced-folder-vagrantfile-breakout
- https://raw.githubusercontent.com/rapid7/metasploit-framework/master/modules/exploits/multi/local/vagrant_synced_folder_vagrantfile_breakout.rb