CVE-2025-34075 — Vulnerability in vagrant — CVE Details
HashiCorp Vagrant has code injection vulnerability through default synced folders
Does your project use an affected vagrant version?
Paste your Gemfile.lock to check it for CVE-2025-34075 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
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.
Advisory Timeline
- First published July 2, 2025 (512 days ago).
- Last revised July 5, 2025 — 2 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
gem install vagrant -v 2.4.7
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: RubyGems (1).
| Package | Fixed In |
|---|---|
| vagrant RubyGems · Affected: 2.4.4, 2.4.5, 2.4.6 | 2.4.7 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 6.9 score means for each attack dimension.
CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
References
- https://nvd.nist.gov/vuln/detail/CVE-2025-34075ADVISORY
- https://github.com/hashicorp/vagrant/issues/13688WEB
- https://github.com/hashicorp/vagrant/commit/abe87b2fdc124ef426c016d44d2f6f4792f0cbe3WEB
- 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/rubysec/ruby-advisory-db/blob/master/gems/vagrant/CVE-2025-34075.ymlWEB
- https://raw.githubusercontent.com/rapid7/metasploit-framework/master/modules/exploits/multi/local/vagrant_synced_folder_vagrantfile_breakout.rbWEB
- https://vulncheck.com/advisories/hashicorp-vagrant-synced-folder-vagrantfile-breakoutWEB
Frequently Asked Questions
- What is CVE-2025-34075?
- HashiCorp Vagrant has code injection vulnerability through default synced folders. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 6.9/10).
- How do I check if my project is affected by CVE-2025-34075?
- CVE-2025-34075 affects vagrant. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2025-34075 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Exploitation requires specific conditions, or the impact is limited.
Also Known As
Related CVEs
- CVE-2026-128084MEDIUM
sqlite3-ruby: Possible SQL query truncation when a string is 4 GiB or larger
- CVE-2026-115472MEDIUM
Doorkeeper: When using public clients, any client can revoke any access token