CVE-2026-57231: Podman: Malformed Image can trick podman run into leaking host environment variables into the container
Summary
An container image that contains a environment variable with just a key and no value can trick podman into passing that variable from the host into the container. This is made worse by the fact that using an asterisk () will cause podman to pass all host variables into the container. So essentially a malicious image can exfiltrate all podman environment variables that are set in the session from where the container is launched.
Details
podman run allows --env VAR1 or --env VAR which will read the variable values from the current environment and then passes them into the container. However because the same parsing logic was reused for the image config env section that means that an image variable could also gain access to that.
Patch
That image spec requires the env variables to be in the form of key=value, so to address this invalid formatted variables get rejected and the container will not run.
Fixed in https://github.com/podman-container-tools/podman/commit/6c431b73dbf8e4b20b778644d7a80caebdb75050
Workaround
Do not run untrusted images. Before running an image consider inspecting the config with podman image inspect --format '{{.Config.Env}}' <image> and check for any variables that do not have a value assigned.
Other sources
Podman is a tool for managing OCI containers and pods. From 1.8.1 until 5.8.4, a container image that contains a environment variable with just a key and no value can trick podman into passing that variable from the host into the container. This is made worse by the fact that using an asterisk () will cause podman to pass all host variables into the container. So essentially a malicious image can exfiltrate all podman environment variables that are set in the session from where the container is launched. This vulnerability is fixed in 5.8.4 and 6.0.0.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
go/go.podman.io/podman/v6to a version that resolves this vulnerability.Fixed in 6.0.0 - Upgrade
Upgrade
go/github.com/containers/podman/v5to a version that resolves this vulnerability.Fixed in 5.8.4 - Upgrade
Upgrade
Podmanto a version that resolves this vulnerability.Fixed in 5.8.4 - Upgrade
Upgrade
Podmanto a version that resolves this vulnerability.Fixed in 6.0.0 - Compensating control
Before running an image, inspect its environment configuration with `podman image inspect --format '{{.Config.Env}}' <image>` and check for variables that have a key but no assigned value.
- Compensating control
Do not run untrusted container images.
Event History
Frequently Asked Questions
What is the severity of CVE-2026-57231?
The severity of CVE-2026-57231 is rated high with a score of 7.5.
How do I fix CVE-2026-57231?
To fix CVE-2026-57231, upgrade Podman to version 5.8.5 or later.
What type of issue is CVE-2026-57231?
CVE-2026-57231 is classified as an information leak vulnerability.
What versions of Podman are affected by CVE-2026-57231?
Podman versions from 1.8.1 to 5.8.4 are affected by CVE-2026-57231.
How does CVE-2026-57231 affect the host environment?
CVE-2026-57231 can lead to the leaking of host environment variables into the container due to malformed images.