Advisory

GHSA-hqp6-mjw3-f586

Also known as: CVE-2025-34075

Summary

HashiCorp Vagrant has code injection vulnerability through default synced folders

Details

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.

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2025-07-02 21:32 UTC
Modified
2025-07-05 02:25 UTC

Affected packages and fixes

vagrant

RubyGems · All systems

Affected

  • introduced 2.2.10, fixed 2.4.7 (ecosystem)

Fixed versions

2.4.7

Fix

The export has no generic command for this ecosystem.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences