/

CVE-2026-57231

Severity:

HIGH RISK

(7.5)

Env Variable Leakage (CWE-200) in Podman Images

CVE-2026-57231

Analyzed

Vulnerability type

Category:

Information Disclosure via Environment Propagation

CWE:

CWE-200, CWE-668

Impact:

Sensitive Information Disclosure

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Podman incorrectly propagates host environment variables into containers when images define variables with a key but no value or use wildcard patterns.

A malicious container image can leverage this behavior to exfiltrate sensitive session-specific environment data from the host into the container, becoming risky whenever untrusted images are run.

Affected context

This vulnerability occurs when Podman is used to run OCI container images that declare environment variables with a key but no associated value, or that include wildcard notation in their environment configuration.

In such scenarios, Podman may unintentionally treat these declarations as instructions to copy corresponding environment variables from the host session into the container, including potentially sensitive values like credentials, tokens, and configuration secrets.

The risk is most pronounced in workflows that run images from untrusted or semi-trusted registries, automated pipelines, or shared development environments where host environment variables contain confidential information.

Exploit preconditions

  • Attack surface: Podman runtime environment when launching containers from crafted images.
  • Required access: Ability to supply or influence the container image being run (e.g., publishing a malicious image, compromising a registry, or influencing image selection).
  • Trigger point: Container start-up, where Podman processes environment directives from the image and merges them with the host environment.
  • Why exploitation is possible: Podman interprets environment keys without values or wildcard patterns as instructions to import corresponding environment variables from the host session, unintentionally exposing host-side secrets to the container.

Why this happens

The underlying issue is an unsafe environment propagation pattern in the container runtime that blends host and container environments without strict separation or explicit consent.

Podman's logic for handling environment variables defined in images treats key-only variables and wildcard specifications as cues to copy host variables into the container, violating the expected isolation between host and container execution contexts.

This maps primarily to CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, since sensitive host data becomes accessible inside the container, and to CWE-668: Exposure of Resource to Wrong Sphere, as host environment resources are unintentionally exposed to the container's security domain.

Potential impact

  • A malicious container can read and exfiltrate host environment variables present in the launching session.
  • Credentials, API keys, OAuth tokens, and other secrets stored in environment variables may be leaked.
  • Configuration details such as endpoints, feature flags, or internal network information can be exposed.
  • Attackers may pivot using leaked secrets to access back-end services, CI/CD systems, or cloud resources.
  • Privacy and compliance violations can occur if regulated data is embedded in environment variables.

General mitigation guidance

Mitigation patterns focus on reducing trust in container images and tightening boundaries between host and container environments.

Common approaches include:

  • Designing container runtime configurations so that host environment variables are not implicitly imported; favor explicit, minimal environment whitelists per container.
  • Treating environment variables as sensitive assets, avoiding storage of long-lived secrets in generic shell sessions, and isolating secret-bearing environments from day-to-day Podman usage.
  • Applying least-privilege principles to environment injection, only passing specific, necessary values to containers rather than broad patterns.
  • Using hardened base images and image policies that avoid ambiguous or wildcard-based environment declarations.
  • Employing external secret management systems instead of relying on host environment variables to supply confidential data to containers.

How teams detect issues like this

Effective detection typically combines configuration analysis with runtime inspection:

  • Static review of container images (Dockerfiles, Containerfiles) and metadata to identify environment variables defined without values or using wildcard-like patterns that could cause host environment importing.
  • Code review and policy checks in CI/CD pipelines to enforce strict environment-passing rules, flagging broad or implicit environment mappings.
  • Automated tools or scripts that analyze Podman run configurations and wrappers for unsafe environment propagation (e.g., excessive use of --env or patterns that mirror the host environment).
  • Runtime audits and logs to track which environment variables are visible inside containers, correlating unusual exposure with image configurations.
  • Organizational policies that require security sign-off on new images, especially those sourced from external registries, focusing on how they handle environment variables.

Sources

SourceLink
github.comgithub.com/podman-container-tools/podman/commit/6c431b73dbf8e4b20b778644d7a80caebdb75050
github.comgithub.com/podman-container-tools/podman/security/advisories/GHSA-4hq8-gpf5-8p68

Frequently asked

questions

Exploitability depends on who controls the container image and what sensitive data resides in host environment variables. If users run untrusted or third-party images while having valuable secrets in their session environment, a crafted image can reliably access and exfiltrate those values.

An attacker needs the ability to supply or influence the image that a user runs with Podman, such as publishing a malicious image to a registry, compromising an existing image, or convincing a user or pipeline to use that image. Direct host access is not required if the victim runs the attacker-controlled image.

The safest pattern is to enforce explicit, minimal environment passing to containers and avoid any behavior where host environments are imported automatically or via wildcards. Pair this with disciplined secret management so that sensitive values are not kept in general-purpose shell environments used to launch containers.

Long-term prevention involves treating environment variables as secrets by default, using dedicated secret management services, and codifying policies that require explicit, least-privilege environment mappings in container orchestration. Regular image and configuration audits, combined with automated checks in CI/CD, help ensure new images cannot abuse host environments.

Find out what's already
exploitable in your codebase.