CVEfocus › CVE database › CVE-2024-29018

CVE-2024-29018External DNS requests from 'internal' networks could lead to data exfiltration

CVSS 5.9 MediumEPSS 0.9% (higher than 56% of CVEs)Published 2024-03-20Updated 2024-08-13Assigner: GitHub_M

Moby is an open source container framework that is a key component of Docker Engine, Docker Desktop, and other distributions of container tooling or runtimes. Moby's networking implementation allows for many networks, each with their own IP address range and gateway, to be defined. This feature is frequently referred to as custom networks, as each network can have a different driver, set of parameters and thus behaviors. When creating a network, the `--internal` flag is used to designate a network as _internal_. The `internal` attribute in a docker-compose.yml file may also be used to mark a network _internal_, and other API clients may specify the `internal` parameter as well. When containers with networking are created, they are assigned unique network interfaces and IP addresses. The host serves as a router for non-internal networks, with a gateway IP that provides SNAT/DNAT to/from container IPs. Containers on an internal network may communicate between each other, but are precluded from communicating with any networks the host has access to (LAN or WAN) as no default route is configured, and firewall rules are set up to drop all outgoing traffic. Communication with the gateway IP address (and thus appropriately configured host services) is possible, and the host may communicate with any container IP directly. In addition to configuring the Linux kernel's various networking features to enable container networking, `dockerd` directly provides some services to container networks. Principal among these is serving as a resolver, enabling service discovery, and resolution of names from an upstream resolver. When a DNS request for a name that does not correspond to a container is received, the request is forwarded to the configured upstream resolver. This request is made from the container's network namespace: the level of access and routing of traffic is the same as if the request was made by the container itself. As a consequence of this design, containers solely attached to an internal network will be unable to resolve names using the upstream resolver, as the container itself is unable to communicate with that nameserver. Only the names of containers also attached to the internal network are able to be resolved. Many systems run a local forwarding DNS resolver. As the host and any containers have separate loopback devices, a consequence of the design described above is that containers are unable to resolve names from the host's configured resolver, as they cannot reach these addresses on the host loopback device. To bridge this gap, and to allow containers to properly resolve names even when a local forwarding resolver is used on a loopback address, `dockerd` detects this scenario and instead forward DNS requests from the host namework namespace. The loopback resolver then forwards the requests to its configured upstream resolvers, as expected. Because `dockerd` forwards DNS requests to the host loopback device, bypassing the container network namespace's normal routing semantics entirely, internal networks can unexpectedly forward DNS requests to an external nameserver. By registering a domain for which they control the authoritative nameservers, an attacker could arrange for a compromised container to exfiltrate data by encoding it in DNS queries that will eventually be answered by their nameservers. Docker Desktop is not affected, as Docker Desktop always runs an internal resolver on a RFC 1918 address. Moby releases 26.0.0, 25.0.4, and 23.0.11 are patched to prevent forwarding any DNS requests from internal networks. As a workaround, run containers intended to be solely attached to internal networks with a custom upstream address, which will force all upstream DNS queries to be resolved from the container's network namespace.

CWE-669

What to do

Fixed builds are available from Alpine, Debian, Go: see the table below for the fixed version per release.

Debian, Ubuntu have not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

10Fixed
9Fix pending
20Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.04docker.ioNot affected
vulnerable_code_not_present
Ubuntu 26.04docker.io-appNot affected
vulnerable_code_not_present
Ubuntu 25.10docker.ioNot affected
vulnerable_code_not_present
Ubuntu 25.10docker.io-appNot affected
vulnerable_code_not_present
Ubuntu 24.04docker.ioFix pendingUBUNTU-CVE-2024-29018
Ubuntu 24.04docker.io-appFix pending27.5.1-0ubuntu3~24.04.2 (Ubuntu Pro)UBUNTU-CVE-2024-29018
Ubuntu 22.04docker.ioFix pendingUBUNTU-CVE-2024-29018
Ubuntu 22.04docker.io-appFix pending27.5.1-0ubuntu3~22.04.2 (Ubuntu Pro)UBUNTU-CVE-2024-29018
Ubuntu 20.04docker.ioFix pendingUBUNTU-CVE-2024-29018
Ubuntu 20.04docker.io-appFix pending26.1.3-0ubuntu1~20.04.1+esm1 (Ubuntu Pro)UBUNTU-CVE-2024-29018
Ubuntu 18.04docker.ioFix pending20.10.21-0ubuntu1~18.04.3+esm2 (Ubuntu Pro)UBUNTU-CVE-2024-29018
Ubuntu 16.04docker.ioFix pending18.09.7-0ubuntu1~16.04.9+esm2 (Ubuntu Pro)UBUNTU-CVE-2024-29018
Debian 14docker.ioFixed26.1.4+dfsg1-9DEBIAN-CVE-2024-29018
Debian 13docker.ioFixed26.1.4+dfsg1-9DEBIAN-CVE-2024-29018
Debian 12docker.ioFix pendingDEBIAN-CVE-2024-29018
Red Hat Enterprise Linux 9grafanaNot affected
Red Hat Enterprise Linux 9grafana-selinuxNot affected
Red Hat Enterprise Linux 8containers-commonNot affected
Red Hat Enterprise Linux 8podmanNot affected
Red Hat Enterprise Linux 8podman-catatonitNot affected
Red Hat Enterprise Linux 8podman-dockerNot affected
Red Hat Enterprise Linux 8podman-gvproxyNot affected
Red Hat Enterprise Linux 8podman-manpagesNot affected
Red Hat Enterprise Linux 8podman-pluginsNot affected
Red Hat Enterprise Linux 8podman-remoteNot affected
Red Hat Enterprise Linux 8podman-testsNot affected
Red Hat Enterprise Linux 8skopeoNot affected
Red Hat Enterprise Linux 8skopeo-testsNot affected
Red Hat Enterprise Linux 7dockerNot affected
Red Hat Enterprise Linux 7podmanNot affected
Red Hat Enterprise Linux 7skopeoNot affected
Alpine Linux 3.24dockerFixed26.0.0-r0ALPINE-CVE-2024-29018
Alpine Linux 3.23dockerFixed26.0.0-r0ALPINE-CVE-2024-29018
Alpine Linux 3.22dockerFixed26.0.0-r0ALPINE-CVE-2024-29018
Alpine Linux 3.21dockerFixed26.0.0-r0ALPINE-CVE-2024-29018
Alpine Linux 3.20dockerFixed26.0.0-r0ALPINE-CVE-2024-29018
Alpine Linux 3.19dockerFixed25.0.5-r0ALPINE-CVE-2024-29018
Alpine Linux 3.18dockerFixed25.0.2-r0ALPINE-CVE-2024-29018
Go librarygithub.com/docker/dockerFixed26.0.0-rc3+incompatibleGHSA-mq39-4gv4-mvpx

What the vendor says

As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.