{"id":"CVE-2026-26018","aliases":["CVE-2026-26018","GHSA-h75p-j8xm-m278","GO-2026-4635"],"related":["CGA-9q85-3q4w-w3cv"],"kind":"vulnerability","state":"published","title":"CoreDNS Loop Detection Denial of Service Vulnerability","summary":"CoreDNS is a DNS server that chains plugins. Prior to version 1.14.2, a denial of service vulnerability exists in CoreDNS's loop detection plugin that allows an attacker to crash the DNS server by sending specially crafted DNS queries. The vulnerability stems from the use of a predictable pseudo-random number generator (PRNG) for generating a secret query name, combined with a fatal error handler that terminates the entire process. This issue has been patched in version 1.14.2.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"CoreDNS is a DNS server that chains plugins. Prior to version 1.14.2, a denial of service vulnerability exists in CoreDNS's loop detection plugin that allows an attacker to crash the DNS server by sending specially crafted DNS queries. The vulnerability stems from the use of a predictable pseudo-random number generator (PRNG) for generating a secret query name, combined with a fatal error handler that terminates the entire process. This issue has been patched in version 1.14.2.","source":"cvelist"},{"lang":"en","text":"## Executive Summary\n\nA Denial of Service vulnerability exists in CoreDNS's loop detection plugin that allows an attacker to crash the DNS server by sending specially crafted DNS queries. The vulnerability stems from the use of a predictable pseudo-random number generator (PRNG) for generating a secret query name, combined with a fatal error handler that terminates the entire process.\n\n---\n## Technical Details\n\n### Vulnerability Description\n\nThe CoreDNS `loop` plugin is designed to detect forwarding loops by performing a self-test during server startup. The plugin generates a random query name (`qname`) using Go's `math/rand` package and sends an HINFO query to itself. If the server receives multiple matching queries, it assumes a forwarding loop exists and terminates.\n\n**The vulnerability arises from two design flaws:**\n\n1. **Predictable PRNG Seed**: The random number generator is seeded with `time.Now().UnixNano()`, making the generated qname predictable if an attacker knows the approximate server start time.\n\n2. **Fatal Error Handler**: When the plugin detects what it believes is a loop (3+ matching HINFO queries), it calls `log.Fatalf()` which invokes `os.Exit(1)`, immediately terminating the process without cleanup or recovery.\n\n### Affected Code\n\n**File: `plugin/loop/setup.go`**\n```go\n// PRNG seeded with predictable timestamp\nvar r = rand.New(time.Now().UnixNano())\n\n// Qname generation using two consecutive PRNG calls\nfunc qname(zone string) string {\n    l1 := strconv.Itoa(r.Int())\n    l2 := strconv.Itoa(r.Int())\n    return dnsutil.Join(l1, l2, zone)\n}\n```\n\n**File: `plugin/loop/loop.go`**\n```go\nfunc (l *Loop) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {\n    // ... validation checks ...\n    \n    if state.Name() == l.qname {\n        l.inc()  // Increment counter\n    }\n\n    if l.seen() > 2 {\n        // FATAL: Terminates entire process\n        log.Fatalf(\"Loop (%s -> %s) detected for zone %q...\", ...)\n    }\n    \n    // ...\n}\n```\n\n**File: `plugin/pkg/log/log.go`**\n```go\nfunc Fatalf(format string, v ...any) {\n    logf(fatal, format, v...)\n    os.Exit(1)  // Immediate process termination\n}\n```\n\n### Exploitation Window\n\nThe loop plugin remains active during the following conditions:\n\n| Condition | Window Duration | Attack Feasibility |\n|-----------|-----------------|-------------------|\n| Healthy startup | 2 seconds | Requires precise timing |\n| Self-test failure (upstream unreachable) | 30 seconds | **HIGH** - Extended window |\n| Network degradation | Variable | Depends on retry behavior |\n\n### Attack Scenario\n\n**Primary Attack Vector: Network Degradation**\n\nWhen the upstream DNS server is unreachable (network partition, misconfiguration, outage), the loop plugin's self-test fails repeatedly. During this period:\n\n1. The loop plugin remains active for up to 30 seconds\n2. Each self-test attempt generates an HINFO query visible in CoreDNS logs\n3. An attacker with log access (shared Kubernetes cluster, centralized logging) can observe the qname\n4. The attacker sends 3 HINFO queries with the observed qname\n5. The server immediately crashes\n\n```\n┌──────────────────────────────────────────────────────────────────────────┐\n│                         ATTACK TIMELINE                                  │\n├──────────────────────────────────────────────────────────────────────────┤\n│ T+0s     CoreDNS starts, PRNG seeded with UnixNano()                     │\n│ T+0.5s   Self-test HINFO query sent (visible in logs)                    │\n│ T+2s     Self-test fails (upstream timeout)                              │\n│ T+3s     Retry #1 - counter resets, qname unchanged                      │\n│ T+5s     Retry #2 - attacker observes qname in logs                      │\n│ T+5.1s   ATTACKER: Send HINFO #1 → counter = 1                           │\n│ T+5.2s   ATTACKER: Send HINFO #2 → counter = 2                           │\n│ T+5.3s   ATTACKER: Send HINFO #3 → counter = 3 → os.Exit(1)              │\n│ T+5.3s   SERVER CRASHES                                                  │\n└──────────────────────────────────────────────────────────────────────────┘\n```\n\n---\n\n## Impact Assessment\n\n### Attack Requirements\n\n| Requirement | Notes |\n|-------------|-------|\n| Network Access | Must be able to send UDP packets to CoreDNS port |\n| Log Access | Required to observe the qname (common in shared clusters) |\n| Timing | Extended window during network degradation |\n| Authentication | None required |\n\n### Real-World Impact\n\nCoreDNS is the default DNS server for Kubernetes clusters. A successful attack would:\n\n1. **Disruption**: All DNS resolution fails within the cluster\n2. **Cascading Failures**: Services unable to discover each other\n3. **Restart Loop**: If attack persists, CoreDNS enters crash-restart cycle\n4. **Data Plane Impact**: Application-level failures across the cluster\n\n## References\n\n- CoreDNS GitHub: https://github.com/coredns/coredns\n- Loop Plugin Documentation: https://coredns.io/plugins/loop/\n- Go math/rand Documentation: https://pkg.go.dev/math/rand","format":"markdown","source":"ghsa"},{"lang":"en","text":"CoreDNS Loop Detection Denial of Service Vulnerability in github.com/coredns/coredns","format":"markdown","source":"go"},{"lang":"es","text":"CoreDNS es un servidor DNS que encadena plugins. Antes de la versión 1.14.2, existe una vulnerabilidad de denegación de servicio en el plugin de detección de bucles de CoreDNS que permite a un atacante colapsar el servidor DNS al enviar consultas DNS especialmente diseñadas. La vulnerabilidad se deriva del uso de un generador de números pseudoaleatorios (PRNG) predecible para generar un nombre de consulta secreto, combinado con un gestor de errores fatal que finaliza el proceso completo. Este problema ha sido parcheado en la versión 1.14.2.","source":"nvd"}],"published":"2026-03-06T15:35:50.801Z","modified":"2026-09-10T03:50:39.384Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"redhat-SADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-337","CWE-400","CWE-770","CWE-1241"],"affected":[{"ranges":[{"version":"< 1.14.2","status":"affected"}],"vendor":"coredns","product":"coredns","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1782924920","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Advanced Cluster Management for Kubernetes 2.13","package":"rhacm2/lighthouse-agent-rhel9","cpe":"cpe:/a:redhat:acm:2.13::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1782924937","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Advanced Cluster Management for Kubernetes 2.13","package":"rhacm2/lighthouse-coredns-rhel9","cpe":"cpe:/a:redhat:acm:2.13::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1780204232","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Advanced Cluster Management for Kubernetes 2.14","package":"rhacm2/lighthouse-agent-rhel9","cpe":"cpe:/a:redhat:acm:2.14::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1780204249","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Advanced Cluster Management for Kubernetes 2.14","package":"rhacm2/lighthouse-coredns-rhel9","cpe":"cpe:/a:redhat:acm:2.14::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1774086225","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Advanced Cluster Management for Kubernetes 2.15","package":"rhacm2/lighthouse-coredns-rhel9","cpe":"cpe:/a:redhat:acm:2.15::el9","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Connectivity Link 1","package":"rhcl-1/coredns-rhel9","cpe":"cpe:/a:redhat:connectivity_link:1","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat OpenShift Container Platform 4","package":"openshift4/ose-coredns-rhel9","cpe":"cpe:/a:redhat:openshift:4","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.14.2"}],"ecosystem":"Go","package":"github.com/coredns/coredns","purl":"pkg:golang/github.com/coredns/coredns","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.14.2"}],"ecosystem":"Go","package":"github.com/coredns/coredns","purl":"pkg:golang/github.com/coredns/coredns","source":"go"},{"ranges":[{"status":"affected","fixed":"1.14.2"}],"vendor":"coredns.io","product":"coredns","cpe":"cpe:2.3:a:coredns.io:coredns:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/coredns/coredns/security/advisories/GHSA-h75p-j8xm-m278","tags":["advisory","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/coredns/coredns/releases/tag/v1.14.2","tags":["product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://access.redhat.com/security/cve/CVE-2026-26018","tags":["vdb-entry","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2445242","tags":["issue-tracking","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-26018.json","tags":["x-sadp-csaf-vex"],"sources":["cvelist","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:36873","tags":["vendor-advisory","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:25127","tags":["vendor-advisory","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:8151","tags":["vendor-advisory","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-26018","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/coredns/coredns","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-03-06T16:07:22.371Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-26018","url":"https://www.cve.org/CVERecord?id=CVE-2026-26018","licence":"CVE Terms of Use","modified":"2026-07-15T01:15:33.876Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-h75p-j8xm-m278","url":"https://github.com/advisories/GHSA-h75p-j8xm-m278","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:39.384Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-4635","url":"https://pkg.go.dev/vuln/GO-2026-4635","licence":"CC-BY-4.0","modified":"2026-03-23T04:53:19.375Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-26018","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-26018","licence":"Public domain","modified":"2026-07-15T02:18:59.577Z"}],"updatedAt":"2026-11-25T22:59:15.407Z","epss":{"score":0.01223,"percentile":0.69605,"date":"2026-12-01T12:00:22.000Z"}}