🔍 CVE-2024-29018

5.9
CVSS Score
MEDIUM
2024-03-20
2026-06-17 07:22
✅ 완료

🇰🇷 한글 설명

Moby의 네트워크 구현 중 내부 네트워크(internal network) 설정 시 DNS 요청을 호스트의 루프백 장치로 전달하는 과정에서 보안 결함이 발견되었습니다. 이로 인해 외부와 차단되어야 할 내부 네트워크의 컨테이너가 호스트를 통해 외부 DNS 서버로 요청을 보낼 수 있어 데이터 유출 위험이 있습니다.

💡 쉬운 설명

보안을 위해 외부와 연결을 끊어놓은 컨테이너가 DNS라는 통로를 이용해 몰래 외부로 정보를 보낼 수 있는 취약점입니다. 공격자가 만든 가짜 주소로 데이터를 숨겨서 보내는 방식으로 정보를 빼갈 수 있습니다.

🇺🇸 원문 (English)

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.

📍 영향받는 시스템

Moby versions prior to 26.0.0, 25.0.4, and 23.0.11

⚔️ 공격 벡터

내부 네트워크에 속한 컨테이너가 DNS 쿼리를 생성하여 호스트의 루프백 리졸버를 통해 외부 공격자의 네임서버로 데이터를 유출하는 방식

🛡️ 대응 방법

Moby를 26.0.0, 25.0.4 또는 23.0.11 이상의 패치된 버전으로 업데이트하거나, 내부 네트워크 컨테이너에 커스텀 업스트림 DNS 주소를 설정하십시오.

🔧 검증 코드

출력된 버전이 패치된 버전(26.0.0, 25.0.4, 23.0.11 이상)인지 확인하십시오.

Shell / Script
docker version --format '{{.Server.Version}}'

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N

💻 영향받는 소프트웨어

Docker