4.0medium
PowerShell Command Injection in Podman HyperV Machine
- Severity
- 4.0medium CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.65% (higher than 52% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-hc8w-h2mf-hp59GO-2026-5421
Description
Podman is a tool for managing OCI containers and pods. Versions 4.8.0 through 5.8.1 contain a command injection vulnerability in the HyperV machine backend in pkg/machine/hyperv/stubber.go, where the VM image path is inserted into a PowerShell double-quoted string without sanitization, allowing $() subexpression injection. Because PowerShell evaluates subexpressions inside double-quoted strings before executing the outer command, an attacker who can control the VM image path through a crafted machine name or image directory can execute arbitrary PowerShell commands with the privileges of the Podman process. On typical Windows installations this means SYSTEM-level code execution, and only Windows is affected as the code is exclusive to the HyperV backend. This issue has been patched in version 5.8.2.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| containers podman | >= 4.8.0, < 5.8.2 | CVE List |
| podman-main | Not specified Not affected: from 5.8.2-1.hum1 before * | CVE List |
| podman | Not specified | CVE List |
| container-tools:rhel8/podman | Not specified | CVE List |
| rhcos | Not specified | CVE List |
| github.com/containers/podman/v4 (Go) | from 4.8.0 up to 4.9.5, from 4.8.0 | GitHub Advisory Database, Go Vulnerability Database |
| github.com/containers/podman/v5 (Go) | before 5.8.2 | GitHub Advisory Database, Go Vulnerability Database |
| github.com/containers/podman (Go) | all versions | Go Vulnerability Database |
| github.com/containers/podman/v2 (Go) | all versions | Go Vulnerability Database |
| github.com/containers/podman/v3 (Go) | all versions | Go Vulnerability Database |
| podman_project podman | from 4.8.0 before 5.8.2 | NVD |
All scores
| GitHub_M | 4.0medium CVSS:4.0 | CVSS:4.0/AV:L/AC:H/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:U |
| redhat-SADP | 8.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H |
| GitHub | 7.8medium CVSS:3.1 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:L/AC:H/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:U |
| NVD | 7.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H |
Classification
What each source says
CVE List
Podman is a tool for managing OCI containers and pods. Versions 4.8.0 through 5.8.1 contain a command injection vulnerability in the HyperV machine backend in pkg/machine/hyperv/stubber.go, where the VM image path is inserted into a PowerShell double-quoted string without sanitization, allowing $() subexpression injection. Because PowerShell evaluates subexpressions inside double-quoted strings before executing the outer command, an attacker who can control the VM image path through a crafted machine name or image directory can execute arbitrary PowerShell commands with the privileges of the Podman process. On typical Windows installations this means SYSTEM-level code execution, and only Windows is affected as the code is exclusive to the HyperV backend. This issue has been patched in version 5.8.2.
GitHub Advisory Database
Summary
A command injection vulnerability exists in Podman's HyperV machine backend. The VM image path is inserted into a PowerShell double-quoted string without sanitization, allowing $() subexpression injection.
Affected Code
File: pkg/machine/hyperv/stubber.go:647
resize := exec.Command("powershell", []string{
"-command",
fmt.Sprintf("Resize-VHD \"%s\" %d", imagePath.GetPath(), newSize.ToBytes()),
}...)
Root Cause
PowerShell evaluates $() subexpressions inside double-quoted strings before executing the outer command. The fmt.Sprintf call places the user-controlled image path directly into double quotes without escaping or sanitization.
Impact
An attacker who can control the VM image path (through a crafted machine name or image directory) can execute arbitrary PowerShell commands with the privileges of the Podman process on the Windows host. On typical Windows installations, this means SYSTEM-level code execution.
Patch
https://github.com/containers/podman/commit/571c842bd357ee626019ea97d030fb772fc654ed
The affected code is only used on Windows, all other operating systems are not affected by this and can thus ignore the CVE patch.
Credit
We like to thank Sang-Hoon Choi (@KoreaSecurity) for reporting this issue to us.
Go Vulnerability Database
PowerShell Command Injection in Podman HyperV Machine in github.com/containers/podman
NVD (es)
Podman es una herramienta para gestionar contenedores OCI y pods. Las versiones 4.8.0 a la 5.8.1 contienen una vulnerabilidad de inyección de comandos en el backend de máquina HyperV en pkg/machine/hyperv/stubber.go, donde la ruta de la imagen de la VM se inserta en una cadena de PowerShell entre comillas dobles sin sanitización, permitiendo la inyección de subexpresiones $(). Debido a que PowerShell evalúa subexpresiones dentro de cadenas entre comillas dobles antes de ejecutar el comando externo, un atacante que puede controlar la ruta de la imagen de la VM a través de un nombre de máquina o directorio de imagen manipulado puede ejecutar comandos arbitrarios de PowerShell con los privilegios del proceso de Podman. En instalaciones típicas de Windows, esto significa ejecución de código a nivel de SYSTEM, y solo Windows se ve afectado ya que el código es exclusivo del backend de HyperV. Este problema ha sido parcheado en la versión 5.8.2.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-33414 changed 2026-07-15 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-hc8w-h2mf-hp59 changed 2026-09-10 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2026-5421 changed 2026-06-25 | CC-BY-4.0 |
| NVD | CVE-2026-33414 changed 2026-07-24 | Public domain |