Skip to content

Conversation

@pieterlexis
Copy link
Contributor

Short description

It was reported that the DNS parser was not strict enough regarding SVC Param ordering and uniqueness.
This could lead us to cache inconsistent data when an MitM or bad authoritative would send double or our of order SVCB Params.
This PR fixes this issue. It also adds a bunch of unit tests and another length validation for ALPN SVC Params.

  • chore(SVCB): Add comparison operators
  • fix(dnsparser): disallow out of order or multiple SVC Params
  • fix(dnsparser): bound check inner ALPN length against tota size
  • chore(dnsparser): Add some more unit tests
  • chore(formatting): clang-format svcb-records.{cc,hh}

Checklist

I have:

  • read the CONTRIBUTING.md document
  • read and accepted the Developer Certificate of Origin document, including the AI Policy, and added a "Signed-off-by" to my commits
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)

miodvallat
miodvallat previously approved these changes Jan 8, 2026
@coveralls
Copy link

coveralls commented Jan 8, 2026

Pull Request Test Coverage Report for Build 20813894197

Details

  • 243 of 247 (98.38%) changed or added relevant lines in 5 files are covered.
  • 34 unchanged lines in 10 files lost coverage.
  • Overall coverage increased (+0.03%) to 73.393%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pdns/dnsparser.cc 6 8 75.0%
pdns/svc-records.cc 49 51 96.08%
Files with Coverage Reduction New Missed Lines %
modules/lmdbbackend/lmdbbackend.cc 2 72.86%
pdns/dnsdistdist/dnsdist-async.cc 2 83.33%
pdns/query-local-address.cc 2 90.43%
pdns/recursordist/aggressive_nsec.cc 2 66.47%
pdns/remote_logger.cc 3 58.19%
pdns/tsigverifier.cc 3 77.22%
pdns/auth-secondarycommunicator.cc 4 66.49%
pdns/recursordist/syncres.cc 4 81.13%
pdns/rcpgenerator.cc 5 90.71%
pdns/dnsdistdist/dnsdist-tcp.cc 7 77.23%
Totals Coverage Status
Change from base Build 20811448004: 0.03%
Covered Lines: 129242
Relevant Lines: 165289

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants