Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update module github.com/moby/moby to v20 [SECURITY] - autoclosed #85

Closed

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Nov 20, 2022

Mend Renovate

This PR contains the following updates:

Package Type Update Change
github.com/moby/moby replace major v17.12.0-ce-rc1.0.20200618181300-9dc6525e6118+incompatible -> v20.10.20+incompatible

GitHub Vulnerability Alerts

CVE-2022-36109

Moby is an open-source project created by Docker to enable software containerization. A bug was found in Moby (Docker Engine) where supplementary groups are not set up properly. If an attacker has direct access to a container and manipulates their supplementary group access, they may be able to use supplementary group access to bypass primary group restrictions in some cases, potentially gaining access to sensitive information or gaining the ability to execute code in that container. This bug is fixed in Moby (Docker Engine) 20.10.18. Users should update to this version when it is available. Running containers should be stopped and restarted for the permissions to be fixed. For users unable to upgrade, this problem can be worked around by not using the "USER $USERNAME" Dockerfile instruction. Instead by calling ENTRYPOINT ["su", "-", "user"] the supplementary groups will be set up properly.

Thanks to Steven Murdoch for reporting this issue.


Impact

If an attacker has direct access to a container and manipulates their supplementary group access, they may be able to use supplementary group access to bypass primary group restrictions in some cases, potentially gaining access to sensitive information or gaining the ability to execute code in that container.

Patches

This bug is fixed in Moby (Docker Engine) 20.10.18. Users should update to this version when it is available.

Workarounds

This problem can be worked around by not using the "USER $USERNAME" Dockerfile instruction. Instead by calling ENTRYPOINT ["su", "-", "user"] the supplementary groups will be set up properly.

References

https://www.benthamsgaze.org/2022/08/22/vulnerability-in-linux-containers-investigation-and-mitigation/

For more information

If you have any questions or comments about this advisory:

GHSA-vp35-85q5-9f25

Description

Moby is the open source Linux container runtime and set of components used to build a variety of downstream container runtimes, including Docker CE, Mirantis Container Runtime (formerly Docker EE), and Docker Desktop. Moby allows for building container images using a set of build instructions (usually named and referred to as a "Dockerfile"), and a build context, which is not unlike the CWD in which the Dockerfile instructions are executed.

Containers may be built using a variety of tools and build backends available in the Moby ecosystem; in all cases, builds may not include files outside of the build context (such as using absolute or relative-parent paths). This is enforced through both checks in the build backends, and the containerization of the build process itself.

Versions of Git where CVE-2022-39253 is present and exploited by a malicious repository, when used in combination with Moby, are subject to an unexpected inclusion of arbitrary filesystem paths in the build context, without any visible warning to the user.

This issue was originally reported by Wenxiang Qian of Tencent Blade Team, and the root-cause analysis was performed by Cory Snider of Mirantis, with assistance from Bjorn Neergaard of the same. The issue was then reported to the Git project, and Taylor Blau led the process resolving the root issue in Git.

Impact

This vulnerability originates in Git, but can be used to violate assumptions that may have security implications for users of Moby and related components. Users may rely on the fact that a build context ensures that outside files cannot be referenced or incorporated using multiple enforcement mechanisms, or expect a warning if this does not hold true. A maliciously crafted Git repository exploiting CVE-2022-39253 can violate this assumption, and potentially include sensitive files that are subsequently uploaded to a container image repository, or disclosed by code inside the resulting container image.

As this issue cannot be triggered remotely, except by users who already have full control over the daemon through the API, and it requires exploiting a vulnerability in Git by convincing a user to build a maliciously crafted repository, the impact in Moby is considered low.

Patches

Moby 20.10.20, and Mirantis Container Runtime (formerly Docker Enterprise Edition) 20.10.14 will contain mitigations for CVE-2022-39253 when a Git clone is performed by Moby components (on either the daemon or API client side). However, as these mitigations only apply to certain scenarios (build of git+<protocol>://... URL contexts) and cannot protect against a malicious repository already on disk, users should update to a version of Git containing patches for CVE-2022-39253 on all their systems running both API clients and daemons.

Specifically, patches in Moby (including patches incorporated from BuildKit) protect against the following:

  • docker build with the legacy builder (e.g. DOCKER_BUILDKIT unset or set to 0) of a Git URL context. Note that depending on available API versions and the CLI version, the Git clone operation can take place on either the client or the daemon side. Both must be updated (or have Git updated) to fully protect this build method.
  • docker build with the BuildKit builder (e.g. DOCKER_BUILDKIT=1) of a Git URL context.
  • docker buildx build with BUILDKIT_CONTEXT_KEEP_GIT_DIR=1 of a Git URL context.

Patches in BuildKit incorporated into Docker Compose protect against CVE-2022-39253 during Compose-driven builds of Git URL contexts.

Patches in Moby and related projects such as BuildKit, the Docker CLI, and Docker Compose cannot fully protect against CVE-2022-39253, as it may be triggered by a malicious repository already on disk that a unpatched Git client has interacted with (specifically, commands that check out submodules such as git clone --recursive, git submodule update, etc. may have already triggered the Git vulnerability).

Workarounds

While this behavior is unexpected and undesirable, and has resulted in this security advisory, users should keep in mind that building a container entails arbitrary code execution. Users should not build a repository/build context they do not trust, as containerization cannot protect against all possible attacks.

When building with BuildKit (e.g. docker buildx build or docker build with DOCKER_BUILDKIT=1), this issue cannot be exploited unless --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=1 was also passed, as by default BuildKit will discard the .git directory of a Git URL context immediately after cloning and checking out the repository.

For more information

If you have any questions or comments about this advisory:


Release Notes

moby/moby

v20.10.20+incompatible

Compare Source

v20.10.19+incompatible

Compare Source

v20.10.18+incompatible

Compare Source

v20.10.17+incompatible

Compare Source

v20.10.16+incompatible

Compare Source

v20.10.15+incompatible

Compare Source

v20.10.14+incompatible

Compare Source

v20.10.13+incompatible

Compare Source

v20.10.12+incompatible

Compare Source

v20.10.11+incompatible

Compare Source

v20.10.10+incompatible

Compare Source

v20.10.9+incompatible

Compare Source

v20.10.8+incompatible

Compare Source

v20.10.7+incompatible

Compare Source

v20.10.6+incompatible

Compare Source

v20.10.5+incompatible

Compare Source

v20.10.4+incompatible

Compare Source

v20.10.3+incompatible

Compare Source

v20.10.2+incompatible

Compare Source

v20.10.1+incompatible

Compare Source

v20.10.0+incompatible

Compare Source

v17.12.0-ce-rc4+incompatible

Compare Source

v17.12.0-ce-rc3+incompatible

Compare Source


Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate
Copy link
Author

renovate bot commented Nov 20, 2022

⚠ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: go.sum
Command failed: docker run --rm --name=renovate_go --label=renovate_child -v "/mnt/renovate/gh/appuio/seiso":"/mnt/renovate/gh/appuio/seiso" -v "/tmp/renovate-cache":"/tmp/renovate-cache" -v "/tmp/containerbase":"/tmp/containerbase" -e GOPATH -e GOPROXY -e GOFLAGS -e CGO_ENABLED -e GIT_CONFIG_KEY_0 -e GIT_CONFIG_VALUE_0 -e GIT_CONFIG_KEY_1 -e GIT_CONFIG_VALUE_1 -e GIT_CONFIG_KEY_2 -e GIT_CONFIG_VALUE_2 -e GIT_CONFIG_COUNT -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/mnt/renovate/gh/appuio/seiso" docker.io/renovate/go:1.19.3 bash -l -c "go get -d -t ./..."
go: helm.sh/helm/v3@v3.7.1 requires
	github.com/docker/docker@v17.12.0-ce-rc1.0.20200618181300-9dc6525e6118+incompatible: missing github.com/moby/moby/go.mod and .../v20/go.mod at revision v20.10.20

@renovate renovate bot added the dependency label Nov 20, 2022
@renovate renovate bot changed the title Update module github.com/moby/moby to v20 [SECURITY] Update module github.com/moby/moby to v20 [SECURITY] - autoclosed Mar 16, 2023
@renovate renovate bot closed this Mar 16, 2023
@renovate renovate bot deleted the renovate/go-github.com/moby/moby-vulnerability branch March 16, 2023 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

0 participants