# Netfoil TTL decrement logic flaw

Source: https://junglewise.ai/threats/netfoil-doesn-t-decrement-ttl-f0272cfd  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-11-03. Updated: 2026-11-05  
License: CC BY 4.0 with a link back

Severity: medium · Published 2026-11-03

Netfoil, a DNS or caching library written in Go, fails to properly decrement the Time-To-Live (TTL) value on cached records. This allows stale or expired records to be served indefinitely, potentially serving outdated data to applications relying on the cache.

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?** Medium severity, published 3 November 2026.

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

**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.

**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 vulnerability stems from missing TTL decrement logic in the caching mechanism (CWE-672). When cached DNS or similar records are retrieved, their TTL should be reduced to reflect the time elapsed; failure to do so means records remain valid indefinitely even after they should have expired. This affects versions 0.3.0 through 0.6.0 of the library.

## Affected products

- Tinfoil Factory Netfoil 0.3.0 to 0.6.0

## 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/pull/44](https://github.com/tinfoil-factory/netfoil/pull/44)

## Related threats

- [Netfoil TTL not decremented in DNS responses](https://junglewise.ai/threats/go-2026-6906-netfoil-doesn-t-decrement-ttl-in-github-com-tinfoil-a5094761)
- [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)
