CVE-2025-58063: CoreDNS: DNS Cache Pinning via etcd Lease ID Confusion
7.1
Basic Information
Technical Details
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| github.com/coredns/coredns | go | >= 1.2.0, < 1.12.4 | 1.12.4 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability lies in the etcd plugin of CoreDNS, specifically within the TTL method of the Etcd struct. The provided patch e1768a5d272e9da649dfb8588595e5c6e4e640bf clearly shows the vulnerable code and the subsequent fix.
The root cause is the incorrect type conversion of an etcd lease ID into a TTL value. The original code took the kv.Lease (a 64-bit integer representing a lease ID) and directly cast it to a uint32 to be used as the TTL. As demonstrated in the vulnerability description, lease IDs can be very large numbers, and when truncated to a uint32, they can represent a TTL of many years. This allows an attacker with write access to etcd to create a DNS record with a near-permanent cache entry in downstream resolvers, effectively preventing any updates to that record.
The fix replaces this direct cast with a call to the etcd client's TimeToLive method, which correctly retrieves the remaining time for the given lease. Additionally, the patch introduces configurable minimum and maximum TTL values (min-lease-ttl and max-lease-ttl) to clamp the retrieved TTL, preventing abuse even if the lease duration itself is excessively long.
The function Etcd.TTL is the central point where the malicious input (a crafted etcd record with a large lease ID) is processed to generate the vulnerable output (a DNS response with an extremely long TTL). Therefore, this function would be the primary indicator in a runtime profile during the exploitation of this vulnerability.