CVE-2023-0778: Github.com/containers/podman/v4 Podman Time-of-check Time-of-use (TOCTOU) Race Vulnerability

MODERATE
Advisory Identifier: GHSA-qwqv-rqgf-8qh8
CVSS 6.8
CWE-367
Published
Advisory Summary

CVE-2023-0778 is a MODERATE (CVSS 6.8) podman time-of-check time-of-use (toctou) race vulnerability (CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition) affecting Github.com/containers/podman/v4 libraries in the Go ecosystem. The issue involves podman time-of-check time-of-use (toctou) race condition. Remediation is available by upgrading affected packages to version 4.4.2.

CVE-2023-0778 at a Glance

CVE Identifier CVE-2023-0778
GHSA Identifier GHSA-qwqv-rqgf-8qh8
Severity MODERATE
CVSS v3.1 Base Score 6.8
CWE Classification CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition
Affected Product Github.com/containers/podman/v4
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2023-0778

To remediate this vulnerability, upgrade all affected Github.com/containers/podman/v4 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/containers/podman/v4 fixed: 4.4.2
Upgrade github.com/containers/podman/v4 to 4.4.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/containers/podman/v4

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-0778, inspect your project dependencies for Github.com/containers/podman/v4:

inspect dependencies for github.com/containers/podman/v4

Analyze the terminal output to locate any version of Github.com/containers/podman/v4 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.4.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition, where the product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check. In Github.com/containers/podman/v4, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

A Time-of-check Time-of-use (TOCTOU) flaw was found in podman. This issue may allow a malicious user to replace a normal file in a volume with a symlink while exporting the volume, allowing for access to arbitrary files on the host file system.

CVE-2023-0778 Affected Github.com/containers/podman/v4 Versions

1 component(s)
Fixed Versions:
4.4.2
Product / Package Ecosystem Affected Versions Fixed Version
github.com/containers/podman/v4
Go
< 4.4.2
4.4.2

References

Frequently Asked Questions

What is CVE-2023-0778?
CVE-2023-0778 is a security vulnerability in Github.com/containers/podman/v4 involving Podman Time-of-check Time-of-use (TOCTOU) Race Condition under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition.
Which Github.com/containers/podman/v4 versions are affected?
Affected versions include releases prior to 4.4.2 across affected packages: github.com/containers/podman/v4.
What version fixes CVE-2023-0778?
Upgrading to 4.4.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/containers/podman/v4 affected?
Yes, github.com/containers/podman/v4 is affected in releases prior to 4.4.2. Upgrade your dependency to 4.4.2 or later.
What is the CVSS score of CVE-2023-0778?
CVE-2023-0778 has a CVSS v3.1 base score of 6.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2023-0778?
CVE-2023-0778 is classified under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition (The product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check.).
How can I check Go dependencies for CVE-2023-0778?
Run the dependency tree command: 'inspect dependencies for github.com/containers/podman/v4'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-qwqv-rqgf-8qh8",
  "modified" : "2024-05-20T21:50:04Z",
  "published" : "2023-03-27T21:30:26Z",
  "aliases" : [ "CVE-2023-0778" ],
  "summary" : "Podman Time-of-check Time-of-use (TOCTOU) Race Condition",
  "details" : "A Time-of-check Time-of-use (TOCTOU) flaw was found in podman. This issue may allow a malicious user to replace a normal file in a volume with a symlink while exporting the volume, allowing for access to arbitrary files on the host file system.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/containers/podman/v4"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.4.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-0778"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/containers/podman/pull/17528"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/containers/podman/pull/17532"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/containers/podman/commit/6ca857feb07a5fdc96fd947afef03916291673d8"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/security/cve/CVE-2023-0778"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=2168256"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/containers/podman"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2023-1681"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-367" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-03-27T22:33:20Z",
    "nvd_published_at" : "2023-03-27T21:15:00Z"
  }
}