HashiCorp Vagrant has code injection vulnerability through default synced folders
An authenticated virtual machine escape vulnerability exists in HashiCorp Vagrant versions 2.4.6 and below 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. 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.
describes (1)
Related CVEs.
| ID | severity | exploitable | ||
|---|---|---|---|---|
| CVE-2025-34075US | —OT elevated | — | ||
Rejected reason: This CVE ID has been rejected or withdrawn by its CVE Numbering Authority.
Initially assigned to document an issues that allows guest VM to modify the host’s Vagr… | ||||
references
External citations — patches, advisories, analysis.
- https://developer.hashicorp.com/vagrantWEB
- https://developer.hashicorp.com/vagrant/docs/synced-folders/basic_usageWEB
- https://developer.hashicorp.com/vagrant/docs/vagrantfileWEB
- https://github.com/advisories/GHSA-hqp6-mjw3-f586ADVISORY
- https://github.com/hashicorp/vagrantPACKAGE
- https://github.com/hashicorp/vagrant/commit/abe87b2fdc124ef426c016d44d2f6f4792f0cbe3WEB
- https://github.com/hashicorp/vagrant/issues/13688WEB
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/vagrant/CVE-2025-34075.ymlWEB
Advisories like this name the exposed products attackers go after on your perimeter. See what is exposed on your perimeter with a free passive scan.
Free scan