Skip to main content

CVE-2025-34075 — Vulnerability in vagrant — CVE Details

MEDIUM

HashiCorp Vagrant has code injection vulnerability through default synced folders

Published July 2, 2025Updated July 5, 2025Source: OSV

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.

Check my Gemfile.lock

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.

Bundler
Update vagrant to 2.4.7 or later
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).

PackageFixed In
vagrant RubyGems · Affected: 2.4.4, 2.4.5, 2.4.62.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.

Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
A
Scope
X
Confidentiality
—
Integrity
—
Availability
—

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

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

CVSS Score
6.9

Exploitation requires specific conditions, or the impact is limited.

Also Known As

GHSA-hqp6-mjw3-f586

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my Gemfile.lock