# CVE-2022-1227: Podman publishes a malicious image to public registries

> Attackers can escalate privileges and access host filesystems via malicious images when users run podman top, requiring patches for Podman.

- **Severity:** High 8.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 29 Apr 2022
- **Updated:** 2 Aug 2024
- **Also known as:** ALSA-2022:2143, AZL-9656, DEBIAN-CVE-2022-1227, GHSA-66vw-v2x9-hw75, GO-2022-0558, RHSA-2022:2143, RHSA-2022:2190, RHSA-2022:2263, RHSA-2022:5622, RLSA-2022:2143, UBUNTU-CVE-2022-1227

## What is CVE-2022-1227?

CVE-2022-1227 is a high-severity vulnerability in Fedoraproject Fedora, published on 29 Apr 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

A privilege escalation flaw was found in Podman. This flaw allows an attacker to publish a malicious image to a public registry. Once this image is downloaded by a potential victim, the vulnerability is triggered after a user runs the 'podman top' command. This action gives the attacker access to the host filesystem, leading to information disclosure or denial of service.

Weakness: CWE-269 (Improper Privilege Management), CWE-281 (Improper Preservation of Permissions)

## Which versions are affected by CVE-2022-1227?

5 open source packages ship an affected version, including github.com/containers/psgo and github.com/containers/podman/v3. It affects 16 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/containers/psgo` | Go | All versions | 1.7.2 |
| `github.com/containers/psgo` | Go | All versions | 1.7.2 |
| `github.com/containers/psgo` | Go | All versions | 1.7.2 |
| `github.com/containers/podman/v3` | Go | All versions | 3.4 |
| `github.com/containers/podman/v3` | Go | All versions | 3.4 |
| `buildah` | AlmaLinux:8 | All versions | 1.19.9-3.module_el8.6.0+2876+9ed4eae2 |
| `buildah-tests` | AlmaLinux:8 | All versions | 1.19.9-3.module_el8.6.0+2876+9ed4eae2 |
| `cockpit-podman` | AlmaLinux:8 | All versions | 29-2.module_el8.6.0+2876+9ed4eae2 |
| `conmon` | AlmaLinux:8 | All versions | 2:2.0.26-1.module_el8.6.0+2876+9ed4eae2 |
| `container-selinux` | AlmaLinux:8 | All versions | 2:2.178.0-2.module_el8.6.0+2876+9ed4eae2 |
| `containernetworking-plugins` | AlmaLinux:8 | All versions | 0.9.1-1.module_el8.6.0+2876+9ed4eae2 |
| `containers-common` | AlmaLinux:8 | All versions | 1:1.2.4-1.module_el8.6.0+2876+9ed4eae2 |
| `crit` | AlmaLinux:8 | All versions | 3.15-1.module_el8.6.0+2876+9ed4eae2 |
| `criu` | AlmaLinux:8 | All versions | 3.15-1.module_el8.6.0+2876+9ed4eae2 |
| `crun` | AlmaLinux:8 | All versions | 0.18-3.module_el8.6.0+2876+9ed4eae2 |
| `fuse-overlayfs` | AlmaLinux:8 | All versions | 1.4.0-2.module_el8.6.0+2876+9ed4eae2 |
| `libslirp` | AlmaLinux:8 | All versions | 4.3.1-1.module_el8.6.0+2876+9ed4eae2 |
| `libslirp-devel` | AlmaLinux:8 | All versions | 4.3.1-1.module_el8.6.0+2876+9ed4eae2 |
| `oci-seccomp-bpf-hook` | AlmaLinux:8 | All versions | 1.2.0-3.module_el8.6.0+2876+9ed4eae2 |
| `podman` | AlmaLinux:8 | All versions | 3.0.1-9.module_el8.6.0+2886+bfcd65b6 |
| `podman-catatonit` | AlmaLinux:8 | All versions | 3.0.1-9.module_el8.6.0+2886+bfcd65b6 |
| `podman-docker` | AlmaLinux:8 | All versions | 3.0.1-9.module_el8.6.0+2886+bfcd65b6 |
| `podman-plugins` | AlmaLinux:8 | All versions | 3.0.1-9.module_el8.6.0+2886+bfcd65b6 |
| `podman-remote` | AlmaLinux:8 | All versions | 3.0.1-9.module_el8.6.0+2886+bfcd65b6 |
| `podman-tests` | AlmaLinux:8 | All versions | 3.0.1-9.module_el8.6.0+2886+bfcd65b6 |
| `python3-criu` | AlmaLinux:8 | All versions | 3.15-1.module_el8.6.0+2876+9ed4eae2 |
| `runc` | AlmaLinux:8 | All versions | 1.0.0-73.rc95.module_el8.6.0+2876+9ed4eae2 |
| `skopeo` | AlmaLinux:8 | All versions | 1:1.2.4-1.module_el8.6.0+2876+9ed4eae2 |
| `skopeo-tests` | AlmaLinux:8 | All versions | 1:1.2.4-1.module_el8.6.0+2876+9ed4eae2 |
| `slirp4netns` | AlmaLinux:8 | All versions | 1.1.8-1.module_el8.6.0+2876+9ed4eae2 |
| `toolbox` | AlmaLinux:8 | All versions | 0.0.99.3-1.module_el8.6.0+2876+9ed4eae2 |
| `toolbox-tests` | AlmaLinux:8 | All versions | 0.0.99.3-1.module_el8.6.0+2876+9ed4eae2 |
| `udica` | AlmaLinux:8 | All versions | 0.2.4-1.module_el8.6.0+2876+9ed4eae2 |
| `buildah` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.19.9-3.module+el8.6.0+14874+64436299 |
| `buildah-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.19.9-3.module+el8.6.0+14874+64436299 |
| `buildah-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.19.9-3.module+el8.6.0+14874+64436299 |
| `buildah-tests` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.19.9-3.module+el8.6.0+14874+64436299 |
| `buildah-tests-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.19.9-3.module+el8.6.0+14874+64436299 |
| `cockpit-podman` | Red Hat:enterprise_linux:8::appstream | All versions | 0:29-2.module+el8.6.0+14874+64436299 |
| `conmon` | Red Hat:enterprise_linux:8::appstream | All versions | 2:2.0.26-1.module+el8.6.0+14874+64436299 |

Products: Fedoraproject Fedora, Podman Project Podman, Psgo Project Psgo, Redhat Developer Tools, Redhat Enterprise Linux, Redhat Enterprise Linux Eus, Redhat Enterprise Linux for Ibm Z Systems, Redhat Enterprise Linux for Power Little Endian, Redhat Enterprise Linux Server, Redhat Enterprise Linux Server Aus, Redhat Enterprise Linux Server for Power Little Endian Update Services for Sap Solutions, Redhat Enterprise Linux Server Tus, Redhat Enterprise Linux Server Update Services for Sap Solutions, Redhat Enterprise Linux Workstation, Redhat Openshift Container Platform, Redhat Quay.

## How do I fix CVE-2022-1227?

Upgrade github.com/containers/psgo to 1.7.2 or later.

## Is CVE-2022-1227 being exploited?

There is no known exploitation of CVE-2022-1227 in the wild and no public exploit code.

Public exploit code:

- A script for exploiting CVE-2022-1227 (github_poc): https://github.com/LouisLiuNova/CVE-2022-1227_Exploit

## Other vulnerabilities in Fedoraproject Fedora

- [CVE-2024-4577](https://insights.sbomify.com/CVE-2024-4577/): PHP-CGI OS Command Injection (critical 9.8, exploited in the wild)
- [CVE-2021-39226](https://insights.sbomify.com/CVE-2021-39226/): Grafana Authentication Bypass (critical 9.8, exploited in the wild)
- [CVE-2019-5544](https://insights.sbomify.com/CVE-2019-5544/): VMware ESXi and Horizon DaaS OpenSLP Heap-Based Buffer Overflow (critical 9.8, exploited in the wild)
- [CVE-2024-4947](https://insights.sbomify.com/CVE-2024-4947/): Google Chromium V8 Type Confusion (critical 9.6, exploited in the wild)
- [CVE-2024-4671](https://insights.sbomify.com/CVE-2024-4671/): Google Chromium Visuals Use-After-Free (critical 9.6, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-1227 and fix it if it is affected.

What it is: CVE-2022-1227 is a high-severity vulnerability in Fedoraproject Fedora, published on 29 Apr 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2022-1227 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/containers/psgo (Go): affected all versions; fixed in 1.7.2
- github.com/containers/psgo (Go): affected all versions; fixed in 1.7.2
- github.com/containers/psgo (Go): affected all versions; fixed in 1.7.2
- github.com/containers/podman/v3 (Go): affected all versions; fixed in 3.4
- github.com/containers/podman/v3 (Go): affected all versions; fixed in 3.4

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2022-1227/ (Markdown: https://insights.sbomify.com/CVE-2022-1227/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-1227
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-1227
- OSV: https://osv.dev/vulnerability/CVE-2022-1227

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-1227/
Summaries are generated and may contain mistakes; the official description above is the record.
