github.com/coredns/coredns
Affected
- introduced
1.2.0, fixed1.12.4(semver)
Fixed versions
1.12.4
Fix
- Fixed version
1.12.4go get github.com/coredns/[email protected]
Advisory
Also known as: CVE-2025-58063, GO-2025-3942
CoreDNS: DNS Cache Pinning via etcd Lease ID Confusion
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:
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:
Some resolvers implement TTL caps, but values and defaults vary widely and are not guaranteed.
PoC
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 &
cat > Corefile << 'EOF'
skydns.local {
etcd {
path /skydns
endpoint http://localhost:2379
debug
}
log
errors
}
EOF
coredns -conf Corefile -dns.port=1053
large-lease-service with a lease grant of 1 hour: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
$ etcdctl lease timetolive $LEASE_ID
lease 7c4a98dd35b75c23 granted with TTL(3600s), remaining(3252s)
$ 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.
The bug was introduced in #1702 as part of the CoreDNS v1.2.0 release.
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 for disclovering this vulnerability and contributing a fix.
For more information
Please consult our security guide for more information regarding our security process.
High Basis: The source's own band: HIGH
1.2.0, fixed 1.12.4 (semver)1.12.4
1.12.4go get github.com/coredns/[email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0