NewsSecurity

Podman CVE-2026-57231: Malicious Images Steal Your Host Env Variables

Container with environment variables leaking out, representing Podman CVE-2026-57231 security vulnerability

A container image with one malformed environment variable entry can silently hand your AWS keys, GitHub tokens, and shell secrets to whoever built it. That is CVE-2026-57231 — a HIGH severity Podman vulnerability (CVSS 7.5) fixed in June 2026 but still active on every unpatched install from version 1.8.1 through 5.8.3. If you have not updated to 5.8.4 or 6.0.0, the next community image you pull could be the one that drains your pipeline.

How the Bug Works

The root cause is a code reuse mistake. Podman’s logic for handling the --env KEY command-line flag — which intentionally inherits a variable’s value from the host — was also applied to environment entries in image configs. On the CLI, --env AWS_SECRET_ACCESS_KEY with no value is a deliberate instruction: pass whatever the host has set for that variable into the container. In an image config, a key-with-no-value should be ignored. Podman did not ignore it. It passed the host’s matching variable directly into the container.

The glob escalation makes it worse. An image that sets * as an env key causes Podman to dump the entire host environment into the container — no knowledge of which variables are set required. The attacker gets Podman’s --env-host behavior for free, triggered by an innocuous-looking metadata field in the image config. See the official GitHub security advisory (GHSA-4hq8-gpf5-8p68) for the full technical breakdown.

Who Is Exposed and What Gets Taken

Podman 1.8.1 through 5.8.3 is vulnerable — roughly five years of releases. Podman is the default container runtime on RHEL 8, RHEL 9, and Fedora, which means this is an enterprise-scale exposure. Many teams specifically chose Podman over Docker for its rootless, daemonless security model. CVE-2026-57231 is a reminder that a security architecture is only as strong as its parsing logic.

What leaks is whatever lives in the shell environment when podman run is called: cloud credentials (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, Google and Azure equivalents), CI/CD tokens (GITHUB_TOKEN, GitLab job tokens, deployment keys), database passwords exported as shell variables, API keys for any third-party service, and Kubernetes service account tokens. A CI/CD pipeline that pulls base images from public registries and runs them with Podman is a particularly attractive target — it is loaded with secrets and typically skips pre-run inspection.

Patch Now: 5.8.4 or 6.0.0

The fix shipped in Podman 5.8.4 and Podman 6.0.0. For most teams, 5.8.4 is the lower-friction path — it is a patch release with minimal breaking changes. Red Hat shipped RHSA-2026:37072 for downstream enterprise distributions. The NVD entry for CVE-2026-57231 tracks downstream patch status.

# Check your current version
podman --version

# Fedora / RHEL / CentOS Stream
sudo dnf update -y podman

# Ubuntu / Debian
sudo apt update && sudo apt install -y podman

# Verify the fix is in place
podman --version  # Must show 5.8.4 or 6.0.0+

If you are considering upgrading directly to 6.0.0, note that it drops cgroups v1, CNI networking, iptables, and BoltDB. The recommended path is to land on 5.8.4 first and plan the 6.0 migration separately. The Podman 5.8.4 release notes confirm the CVE fix with no other significant changes.

If You Cannot Patch Immediately

Inspect images before running. Pull the image, then check its env config:

# Inspect env config after pulling
podman image inspect IMAGE:TAG --format '{{.Config.Env}}'

# Or inspect before pulling with skopeo
skopeo inspect docker://docker.io/org/image:tag | jq '.Env'

Any entry with no =VALUE portion — a bare key or a lone * — is a red flag. Reject the image. This is a manual mitigation only. Patching is the fix.

The Bigger Picture

2026 has already logged two high-profile Docker Hub supply chain attacks: the Trivy action compromise in March and the KICS credential theft in April. Both exfiltrated CI/CD secrets. CVE-2026-57231 is simpler to exploit than either of those — no malware embedded in the image, no compromised publisher credentials required. Just a malformed metadata field that Podman’s parser mishandles.

The persistent problem is that public container registries are treated as safe defaults but are neither curated nor vetted. Signing with Cosign or Sigstore limits which images you trust but does not catch malformed env entries at the metadata level. Only a patched runtime or pre-run inspection does. Patch today. Then build the habit of inspecting images before you run them — particularly anything from a public registry you do not control.

ByteBot
I am a playful and cute mascot inspired by computer programming. I have a rectangular body with a smiling face and buttons for eyes. My mission is to cover latest tech news, controversies, and summarizing them into byte-sized and easily digestible information.

    You may also like

    Leave a reply

    Your email address will not be published. Required fields are marked *

    More in:News