GHSA-hc8w-h2mf-hp59 is a high-severity (CVSS 7.8) remote code execution vulnerability in github.com/containers/podman/v4. O3 Security confirms whether GHSA-hc8w-h2mf-hp59 is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.
PowerShell Command Injection in Podman HyperV Machine
Real-World Exposure
github.com/containers/podman/v4🐹github.com/containers/podman/v5Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
Description
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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/containers/podman/v4 | ≥ 4.8.0 | No fix |
| 🐹Go | github.com/containers/podman/v5 | all versions | 5.8.2 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/containers/podman/v4. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
No patched version of github.com/containers/podman/v4 has shipped for GHSA-hc8w-h2mf-hp59 yet. Where your build allows, override or pin the dependency away from the vulnerable range, and apply any maintainer-recommended mitigation.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-hc8w-h2mf-hp59 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-hc8w-h2mf-hp59. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-hc8w-h2mf-hp59 in your dependencies?
O3 detects GHSA-hc8w-h2mf-hp59 across Go dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.