CVE-2021-41089
JSON

2.8low

`docker cp` allows unexpected chmod of host files

Severity
2.8low CVSS:3.1 by GitHub_M
Exploit likelihood
0.29% (higher than 23% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-v994-f8vw-g7j4GO-2024-2913

Description

Moby is an open-source project created by Docker to enable software containerization. A bug was found in Moby (Docker Engine) where attempting to copy files using `docker cp` into a specially-crafted container can result in Unix file permission changes for existing files in the host’s filesystem, widening access to others. This bug does not directly allow files to be read, modified, or executed without an additional cooperating process. This bug has been fixed in Moby (Docker Engine) 20.10.9. Users should update to this version as soon as possible. Running containers do not need to be restarted.

Affected

Product or packageVersionsReported by
moby moby< 20.10.9CVE List
github.com/docker/docker (Go)before 20.10.9, before 20.10.9+incompatibleGitHub Advisory Database, Go Vulnerability Database
github.com/moby/moby (Go)before 20.10.9+incompatibleGo Vulnerability Database
mobyproject mobybefore 20.10.9NVD
fedoraproject fedora34, 35NVD

All scores

GitHub_M2.8low CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:L/I:N/A:N
GitHub2.8low CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:L/I:N/A:N
NVD6.3medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:L
NVD4.4medium CVSS:2.0AV:L/AC:M/Au:N/C:P/I:P/A:P

Classification

What each source says

CVE List

Moby is an open-source project created by Docker to enable software containerization. A bug was found in Moby (Docker Engine) where attempting to copy files using `docker cp` into a specially-crafted container can result in Unix file permission changes for existing files in the host’s filesystem, widening access to others. This bug does not directly allow files to be read, modified, or executed without an additional cooperating process. This bug has been fixed in Moby (Docker Engine) 20.10.9. Users should update to this version as soon as possible. Running containers do not need to be restarted.

GitHub Advisory Database

Impact

A bug was found in Moby (Docker Engine) where attempting to copy files using docker cp into a specially-crafted container can result in Unix file permission changes for existing files in the host’s filesystem, widening access to others. This bug does not directly allow files to be read, modified, or executed without an additional cooperating process.

Patches

This bug has been fixed in Moby (Docker Engine) 20.10.9. Users should update to this version as soon as possible. Running containers do not need to be restarted.

Workarounds

Ensure you only run trusted containers.

Credits

The Moby project would like to thank Lei Wang and Ruizhi Xiao for responsibly disclosing this issue in accordance with the Moby security policy.

For more information

If you have any questions or comments about this advisory:

Go Vulnerability Database

Unexpected chmod of host files via 'docker cp' in Moby Docker Engine in github.com/docker/docker

NVD (es)

Moby es un proyecto de código abierto creado por Docker para permitir la contenedorización de software. Se ha encontrado un fallo en Moby (Docker Engine) en el que el intento de copiar archivos mediante `docker cp` en un contenedor especialmente diseñado puede dar lugar a cambios en los permisos de archivos Unix para los archivos existentes en el sistema de archivos del host, ampliando el acceso a otros. Este fallo no permite directamente la lectura, modificación o ejecución de archivos sin un proceso adicional que coopere. Este error ha sido corregido en Moby (Docker Engine) 20.10.9. Los usuarios deben actualizar a esta versión lo antes posible. Los contenedores en ejecución no necesitan ser reiniciados

References

https://github.com/moby/moby/security/advisories/GHSA-v994-f8vw-g7j4advisory, third-party-advisory, web
https://github.com/moby/moby/commit/bce32e5c93be4caf1a592582155b9cb837fc129afix, patch, third-party-advisory, web
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ZNFADTCHHYWVM6W4NJ6CB4FNFM2VMBIB/vendor-advisory
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/B5Q6G6I4W5COQE25QMC7FJY3I3PAYFBB/vendor-advisory
https://cert-portal.siemens.com/productcert/pdf/ssa-222547.pdfweb
https://nvd.nist.gov/vuln/detail/CVE-2021-41089advisory
https://github.com/moby/mobypackage
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/B5Q6G6I4W5COQE25QMC7FJY3I3PAYFBBweb
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZNFADTCHHYWVM6W4NJ6CB4FNFM2VMBIBweb
https://pkg.go.dev/vuln/GO-2024-2913web

Related

Sources

SourceRecordLicence
CVE ListCVE-2021-41089 changed 2024-08-04CVE Terms of Use
GitHub Advisory DatabaseGHSA-v994-f8vw-g7j4 changed 2026-09-10CC-BY-4.0
Go Vulnerability DatabaseGO-2024-2913 changed 2026-02-04CC-BY-4.0
NVDCVE-2021-41089 changed 2026-06-17Public domain