Skip to content

doh: cap the maximum TTL to 24 hours#22122

Closed
bagder wants to merge 4 commits into
masterfrom
bagder/doh-ttl
Closed

doh: cap the maximum TTL to 24 hours#22122
bagder wants to merge 4 commits into
masterfrom
bagder/doh-ttl

Conversation

@bagder

@bagder bagder commented Jun 21, 2026

Copy link
Copy Markdown
Member

To avoid mistakes or abuse to cause problems. Many public DNS providers cap their cache times to this.

@bagder bagder added the name lookup DNS and related tech label Jun 21, 2026
@bagder bagder marked this pull request as ready for review June 22, 2026 06:09
@bagder bagder requested a review from Copilot June 22, 2026 06:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a safety cap to DNS-over-HTTPS (DoH) decoded TTL values to avoid excessively large cache lifetimes (whether due to misconfiguration or abuse), aligning behavior with common public DNS resolver practices.

Changes:

  • Introduces a maximum TTL cap of 24 hours for DoH-decoded responses.
  • Applies the cap during response decoding before selecting the minimum TTL across answers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/doh.c Outdated
Comment thread lib/doh.c
bagder and others added 4 commits June 22, 2026 08:43
To avoid mistakes or abuse to cause problems. Many public DNS provides
cap their cache times to this.
unsigned

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the tests label Jun 22, 2026
@bagder bagder closed this in e8e3af2 Jun 22, 2026
@bagder bagder deleted the bagder/doh-ttl branch June 22, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

name lookup DNS and related tech tests

Development

Successfully merging this pull request may close these issues.

2 participants