Reject outgoing transfers from already expired secondary zones

perfloop-oss/coredns · Uncatalogued correctness

https://perfloop.ai/t/oss/case_kcavsbb5dw

Verdict

VERIFIED · settled 2026-11-15 · merged as coredns/coredns#8776

What happened: The check fails before this change and passes with it.

Hypothesis

An expired secondary still supplies its obsolete zone through new outgoing transfers even though ordinary queries are rejected. This violates the zone-expiration contract and could pass obsolete data to downstream secondaries. A supported refresh-failure lifecycle reproduces the behavior; deployment frequency and downstream consequences remain unmeasured.

The secondary plugin embeds file.File, and its README explicitly documents re-exporting received zones through transfer. Zone.UpdateWithTransfer sets Expired under the zone lock when failed refreshes outlast expiration. File.ServeDNS checks that state and returns SERVFAIL. File.Transfer checks only exact zone identity and non-nil data, and Zone.Transfer captures the apex and tree without checking expiry. Both full-transfer and single-SOA paths therefore remain available. An admission check at the shared zone-transfer owner covers both paths before record production; a writer-only filter would be too late. This request concerns transfers begun after expiration is established, not cancellation of transfers already in flight.

Property prop_wrdjkzhysq ran `go test ./plugin/file -run '^TestPerfloopExpiredTransferLifecycle$' -count=1 -timeout=90s -v`. checkProperty call_bANGszwWZQFM3CImtaxgwdCk used one populated zone and a local TCP primary that immediately closed SOA-query connections. The real Zone.Update loop reached Expired within the check's 20-second bound and was stopped before the transfer calls. The ordinary-query control returned SERVFAIL without writing an answer. A new serial-zero transfer then returned five records, and an equal-serial request returned one SOA; both returned nil error and a producer channel. Live-zone and post-setData recovery controls met their assertions. The run failed only the two expiry assertions and returned both requests as explicit replay inputs. These timing constants are a bounded reproducer, not required production settings or a frequency estimate.

RFC 1034 section 4.3.5 requires a secondary unable to serial-check its zone for the EXPIRE interval to treat its copy as obsolete and discard it (https://www.rfc-editor.org/rfc/rfc1034.txt). This is an existing authority rule, not optional hardening for an imagined actor. The smallest useful Case check sends permitted TCP AXFR and IXFR through a secondary-plus-transfer handler before expiry, after expiry and after recovery. A guard using the existing zone synchronization is a local change, but its error choice, data visibility and healthy-provider fallback need regression checks. The retained native test layout is provisional.

The complete upstream PR listing was read. I inspected the actual secondary.go and zone.go hunks in https://github.com/coredns/coredns/pull/7693 at head 88b4e26ca3ce92233dee89d5e9eeb8d33ad85769: they add TSIG support, not expiry admission. https://github.com/coredns/coredns/pull/8586 changes duplicate storage, not this state check. The contribution guide identifies GitHub PR review. Local history is shallow and recent path-history reads returned HTTP 403, leaving a history gap.

Change to test: Reject new transfers from an expired zone before starting its record producer, using an error compatible with provider selection. Keep expiry and generation admission coherent, and preserve transfers from healthy or successfully refreshed zones.

Where it lives

perfloop-oss/coredns · plugin/transfer/transfer.go

Evidence

The check fails before this change and passes with it: `For a populated file zone already marked expired, File.Transfer returns transfer.ErrNotAuthoritative and no producer channel for full transfers and equal-serial IXFR requests.`

Checks: 2 of 2 passed. Verification: no defect found.

Timeline