# Netfoil TTL not decremented in DNS responses

Source: https://junglewise.ai/threats/go-2026-6906-netfoil-doesn-t-decrement-ttl-in-github-com-tinfoil-a5094761  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-11-05. Updated: 2026-11-07  
License: CC BY 4.0 with a link back

Severity: info · Published 2026-11-05

Netfoil is a DNS caching and proxying library for Go applications. Due to a bug, DNS records' time-to-live (TTL) values are not properly decremented as time passes, causing stale or expired records to continue being served to clients instead of being refreshed from authoritative sources.

Technologies: [github.com/tinfoil-factory/netfoil (Go)](https://junglewise.ai/threats/technologies/github-com-tinfoil-factory-netfoil), [Tinfoil Factory Netfoil](https://junglewise.ai/threats/technologies/netfoil). Vendors: [Go](https://junglewise.ai/threats/vendors/go), [Tinfoil Factory](https://junglewise.ai/threats/vendors/tinfoil-factory).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Informational severity, published 5 November 2026.

**Which products and versions are affected?** github.com/tinfoil-factory/netfoil (Go) SEMVER:introduced=0.3.0,fixed=0.6.1; Tinfoil Factory Netfoil 0.3.0 to 0.6.0.

**Is there a fix for This vulnerability?** Yes. github.com/tinfoil-factory/netfoil (Go): upgrade to 0.6.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is attacked over the network, in a software library.

**Am I affected?** Check whether you run github.com/tinfoil-factory/netfoil (Go) or Tinfoil Factory Netfoil at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- github.com/tinfoil-factory/netfoil (Go): upgrade to 0.6.1 or later

  ```sh
  go get github.com/tinfoil-factory/netfoil@v0.6.1
  ```


## Technical details

The rewriteTTLs function in the DNS proxy component fails to modify TTL values in cached DNS responses because it iterates over a cloned slice by value rather than by reference, leaving the original cached records unchanged. This causes DNS responses to be served indefinitely without TTL expiration, potentially serving stale address records if upstream changes occur.

## Affected products

- tinfoil-factory netfoil 0.3.0 to 0.6.0

## Identifiers

- GHSA-9ppr-wfw9-xvr2
- GO-2026-6906

## Timeline

- 2026-06-25: disclosed
- 2026-11-05: patched

## References

- [https://github.com/tinfoil-factory/netfoil/security/advisories/GHSA-9ppr-wfw9-xvr2](https://github.com/tinfoil-factory/netfoil/security/advisories/GHSA-9ppr-wfw9-xvr2)
- [https://github.com/tinfoil-factory/netfoil/commit/ea42977900c864b7b1c42f26c5870c86008118a0](https://github.com/tinfoil-factory/netfoil/commit/ea42977900c864b7b1c42f26c5870c86008118a0)

## Related threats

- [Netfoil TTL decrement logic flaw](https://junglewise.ai/threats/netfoil-doesn-t-decrement-ttl-f0272cfd)
- [GO-2026-6277 - netfoil vulnerable to improper handling of untrusted DoH response data in github.com/tinfoil-factory/netfoil](https://junglewise.ai/threats/go-2026-6277-netfoil-vulnerable-to-improper-handling-of-untrusted-doh-3c188b0a)
- [netfoil improper output neutralization for logs in DoH response handling](https://junglewise.ai/threats/netfoil-improper-output-neutralization-for-logs-in-doh-response-c6a8161c)
- [GO-2026-6143 - netfoil: Incorrect block responses could lead to localhost traffic in github.com/tinfoil-factory/netfoil](https://junglewise.ai/threats/go-2026-6143-netfoil-incorrect-block-responses-could-lead-to-localhost-10a9eea0)
- [tinfoil-factory netfoil protection mechanism failure in DNS block responses](https://junglewise.ai/threats/tinfoil-factory-netfoil-protection-mechanism-failure-in-dns-block-e16a1288)
