<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.freebsd.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.freebsd.org/bugzilla/"
          
          maintainer="bugmeister@FreeBSD.org"
>

    <bug>
          <bug_id>278721</bug_id>
          
          <creation_ts>2024-05-03 16:07:30 +0000</creation_ts>
          <short_desc>ldns uses nameserver commented out in resolv.conf (host, drill)</short_desc>
          <delta_ts>2024-07-22 18:52:22 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Base System</product>
          <component>bin</component>
          <version>13.3-RELEASE</version>
          <rep_platform>Any</rep_platform>
          <op_sys>Any</op_sys>
          <bug_status>Closed</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>https://github.com/NLnetLabs/ldns/issues/237</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>---</priority>
          <bug_severity>Affects Many People</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Gmelin">grembo</reporter>
          <assigned_to name="Dag-Erling Smørgrav">des</assigned_to>
          <cc>cperciva</cc>
    
    <cc>des</cc>
    
    <cc>emaste</cc>
    
    <cc>jaap</cc>
    
    <cc>lwhsu</cc>
    
    <cc>secteam</cc>
          

      

      

      <flag name="mfc-stable14"
          id="80941"
          type_id="11"
          status="+"
          setter="des"
    />
    <flag name="mfc-stable13"
          id="80942"
          type_id="10"
          status="+"
          setter="des"
    />
    <flag name="needs_errata"
          id="80943"
          type_id="12"
          status="?"
          setter="des"
          requestee="secteam"
    />

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1307382</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Gmelin">grembo</who>
    <bug_when>2024-05-03 16:07:30 +0000</bug_when>
    <thetext>Given this innocent /etc/resolv.conf:

  # Generated by resolvconf
  # nameserver 192.168.1.1
  
  # nameserver 8.8.8.8
  nameserver 127.0.0.1
  options edns0

(the third line needs to be empty)

ldns actually sends requests to google DNS.

Stripped down example:

  cat &gt;/etc/resolv.conf &lt;&lt;EOF
  # g
  
  # nameserver 8.8.8.8
  EOF
  drill www.google.com
  host www.google.com

(there is no resolver running on localhost)

This problem can lead to information leakage and (which hit me) break our setup, where local_unbound is serving a private zone, but google was contacted instead.

Filed upstream, more details (and suggested solutions) can be found here:
https://github.com/NLnetLabs/ldns/issues/237

CCed des and emaste, as they did the last import of ldns in 13.3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1307432</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Gmelin">grembo</who>
    <bug_when>2024-05-04 10:21:28 +0000</bug_when>
    <thetext>This also affects 14.0-RELEASE, 14.1-BETA1 and CURRENT</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1308373</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Gmelin">grembo</who>
    <bug_when>2024-05-10 07:40:35 +0000</bug_when>
    <thetext>There is an upstream fix available now (not merged yet):
https://github.com/NLnetLabs/ldns/pull/238</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1309110</commentid>
    <comment_count>3</comment_count>
    <who name="">commit-hook</who>
    <bug_when>2024-05-15 11:57:32 +0000</bug_when>
    <thetext>A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=3b092e4936c433889cc668ea9563c8fd437d1a3e

commit 3b092e4936c433889cc668ea9563c8fd437d1a3e
Merge: 154ad8e0f88f 4891157c57cc
Author:     Dag-Erling Smørgrav &lt;des@FreeBSD.org&gt;
AuthorDate: 2024-05-15 10:16:24 +0000
Commit:     Dag-Erling Smørgrav &lt;des@FreeBSD.org&gt;
CommitDate: 2024-05-15 10:20:15 +0000

    ldns: Ignore commented-out lines in resolv.conf.

    This merges upstream PR 238 + an additional bug fix.

    PR:             278721
    MFC after:      1 week

 contrib/ldns/ldns/parse.h |  2 ++
 contrib/ldns/parse.c      | 35 +++++++++++++++++++++++++++----
 contrib/ldns/resolver.c   | 53 ++++++++---------------------------------------
 3 files changed, 42 insertions(+), 48 deletions(-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1309234</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Gmelin">grembo</who>
    <bug_when>2024-05-16 06:21:53 +0000</bug_when>
    <thetext>Upstream merged the commit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1309831</commentid>
    <comment_count>5</comment_count>
    <who name="">commit-hook</who>
    <bug_when>2024-05-20 09:08:43 +0000</bug_when>
    <thetext>A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=7daf36028411c3a9c73e0c75732f9cbcbf66362e

commit 7daf36028411c3a9c73e0c75732f9cbcbf66362e
Author:     Dag-Erling Smørgrav &lt;des@FreeBSD.org&gt;
AuthorDate: 2024-05-15 10:16:24 +0000
Commit:     Dag-Erling Smørgrav &lt;des@FreeBSD.org&gt;
CommitDate: 2024-05-20 09:04:54 +0000

    ldns: Ignore commented-out lines in resolv.conf.

    This merges upstream PR 238 + an additional bug fix.

    PR:             278721
    MFC after:      1 week

    (cherry picked from commit 3b092e4936c433889cc668ea9563c8fd437d1a3e)

 contrib/ldns/ldns/parse.h |  2 ++
 contrib/ldns/parse.c      | 35 +++++++++++++++++++++++++++----
 contrib/ldns/resolver.c   | 53 ++++++++---------------------------------------
 3 files changed, 42 insertions(+), 48 deletions(-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1309832</commentid>
    <comment_count>6</comment_count>
    <who name="">commit-hook</who>
    <bug_when>2024-05-20 09:35:47 +0000</bug_when>
    <thetext>A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=e95e16191f63240971687634a23c2defed64d713

commit e95e16191f63240971687634a23c2defed64d713
Author:     Dag-Erling Smørgrav &lt;des@FreeBSD.org&gt;
AuthorDate: 2024-05-15 10:16:24 +0000
Commit:     Dag-Erling Smørgrav &lt;des@FreeBSD.org&gt;
CommitDate: 2024-05-20 09:04:59 +0000

    ldns: Ignore commented-out lines in resolv.conf.

    This merges upstream PR 238 + an additional bug fix.

    PR:             278721
    MFC after:      1 week

    (cherry picked from commit 3b092e4936c433889cc668ea9563c8fd437d1a3e)

 contrib/ldns/ldns/parse.h |  2 ++
 contrib/ldns/parse.c      | 35 +++++++++++++++++++++++++++----
 contrib/ldns/resolver.c   | 53 ++++++++---------------------------------------
 3 files changed, 42 insertions(+), 48 deletions(-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1309916</commentid>
    <comment_count>7</comment_count>
    <who name="">commit-hook</who>
    <bug_when>2024-05-20 20:39:14 +0000</bug_when>
    <thetext>A commit in branch releng/14.1 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=5df49242be716cd8736fd10086dc6b31af1eafbd

commit 5df49242be716cd8736fd10086dc6b31af1eafbd
Author:     Dag-Erling Smørgrav &lt;des@FreeBSD.org&gt;
AuthorDate: 2024-05-15 10:16:24 +0000
Commit:     Dag-Erling Smørgrav &lt;des@FreeBSD.org&gt;
CommitDate: 2024-05-20 20:37:46 +0000

    ldns: Ignore commented-out lines in resolv.conf.

    This merges upstream PR 238 + an additional bug fix.

    PR:             278721
    MFC after:      1 week

    (cherry picked from commit 3b092e4936c433889cc668ea9563c8fd437d1a3e)
    (cherry picked from commit 7daf36028411c3a9c73e0c75732f9cbcbf66362e)

    Approved by:    re (cperciva)

 contrib/ldns/ldns/parse.h |  2 ++
 contrib/ldns/parse.c      | 35 +++++++++++++++++++++++++++----
 contrib/ldns/resolver.c   | 53 ++++++++---------------------------------------
 3 files changed, 42 insertions(+), 48 deletions(-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1313763</commentid>
    <comment_count>8</comment_count>
    <who name="">commit-hook</who>
    <bug_when>2024-06-19 20:37:22 +0000</bug_when>
    <thetext>A commit in branch releng/14.0 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=bdf75e830a77a16ec0baf1c9367f64c6b96c5e02

commit bdf75e830a77a16ec0baf1c9367f64c6b96c5e02
Author:     Dag-Erling Smørgrav &lt;des@FreeBSD.org&gt;
AuthorDate: 2024-05-15 10:16:24 +0000
Commit:     Gordon Tetlow &lt;gordon@FreeBSD.org&gt;
CommitDate: 2024-06-18 17:32:56 +0000

    ldns: Ignore commented-out lines in resolv.conf.

    This merges upstream PR 238 + an additional bug fix.

    PR:             278721
    Approved by:    so
    Security:       FreeBSD-EN-24:11.ldns

    (cherry picked from commit 3b092e4936c433889cc668ea9563c8fd437d1a3e)
    (cherry picked from commit 7daf36028411c3a9c73e0c75732f9cbcbf66362e)

 contrib/ldns/ldns/parse.h |  2 ++
 contrib/ldns/parse.c      | 35 +++++++++++++++++++++++++++----
 contrib/ldns/resolver.c   | 53 ++++++++---------------------------------------
 3 files changed, 42 insertions(+), 48 deletions(-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1313764</commentid>
    <comment_count>9</comment_count>
    <who name="">commit-hook</who>
    <bug_when>2024-06-19 20:37:24 +0000</bug_when>
    <thetext>A commit in branch releng/13.3 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=d45cf1d2f1249d5b30c9fa0d35476dc9b9ee0321

commit d45cf1d2f1249d5b30c9fa0d35476dc9b9ee0321
Author:     Dag-Erling Smørgrav &lt;des@FreeBSD.org&gt;
AuthorDate: 2024-05-15 10:16:24 +0000
Commit:     Gordon Tetlow &lt;gordon@FreeBSD.org&gt;
CommitDate: 2024-06-18 17:25:37 +0000

    ldns: Ignore commented-out lines in resolv.conf.

    This merges upstream PR 238 + an additional bug fix.

    PR:             278721
    Approved by:    so
    Security:       FreeBSD-EN-24:11.ldns

    (cherry picked from commit 3b092e4936c433889cc668ea9563c8fd437d1a3e)
    (cherry picked from commit e95e16191f63240971687634a23c2defed64d713)

 contrib/ldns/ldns/parse.h |  2 ++
 contrib/ldns/parse.c      | 35 +++++++++++++++++++++++++++----
 contrib/ldns/resolver.c   | 53 ++++++++---------------------------------------
 3 files changed, 42 insertions(+), 48 deletions(-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1317614</commentid>
    <comment_count>10</comment_count>
    <who name="">commit-hook</who>
    <bug_when>2024-07-22 18:48:16 +0000</bug_when>
    <thetext>A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7fe9f4303fad76f1d2a9f709a3feb89093bce80c

commit 7fe9f4303fad76f1d2a9f709a3feb89093bce80c
Author:     Jaap Akkerhuis &lt;jaap@NLnetLabs.nl&gt;
AuthorDate: 2024-07-22 18:39:53 +0000
Commit:     Vladimir Druzenko &lt;vvd@FreeBSD.org&gt;
CommitDate: 2024-07-22 18:39:53 +0000

    dns/{,py}ldns, dns/p5-DNS-Ldns: update 1.8.3 → 1.8.4

    The most prominent fix is for the bug where ldns would, under certain
    conditions, use a commented out resolver in /etc/resolv.conf:
    https://github.com/NLnetLabs/ldns/issues/237

    Changelog:
    https://github.com/NLnetLabs/ldns/blob/1.8.4/Changelog

    PR:     280404 278721
    MFH:    2024Q3

 dns/ldns/Makefile                |  8 ++---
 dns/ldns/distinfo                |  6 ++--
 dns/ldns/files/patch-swig (gone) | 64 ----------------------------------------
 dns/ldns/pkg-plist               |  2 +-
 dns/py-ldns/pkg-plist            |  6 ++--
 5 files changed, 10 insertions(+), 76 deletions(-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1317619</commentid>
    <comment_count>11</comment_count>
    <who name="">commit-hook</who>
    <bug_when>2024-07-22 18:52:22 +0000</bug_when>
    <thetext>A commit in branch 2024Q3 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9be587b5da8d7dea89b60c4f2a6a529d11bcce2e

commit 9be587b5da8d7dea89b60c4f2a6a529d11bcce2e
Author:     Jaap Akkerhuis &lt;jaap@NLnetLabs.nl&gt;
AuthorDate: 2024-07-22 18:39:53 +0000
Commit:     Vladimir Druzenko &lt;vvd@FreeBSD.org&gt;
CommitDate: 2024-07-22 18:49:37 +0000

    dns/{,py}ldns, dns/p5-DNS-Ldns: update 1.8.3 → 1.8.4

    The most prominent fix is for the bug where ldns would, under certain
    conditions, use a commented out resolver in /etc/resolv.conf:
    https://github.com/NLnetLabs/ldns/issues/237

    Changelog:
    https://github.com/NLnetLabs/ldns/blob/1.8.4/Changelog

    PR:     280404 278721
    MFH:    2024Q3
    (cherry picked from commit 7fe9f4303fad76f1d2a9f709a3feb89093bce80c)

 dns/ldns/Makefile                |  8 ++---
 dns/ldns/distinfo                |  6 ++--
 dns/ldns/files/patch-swig (gone) | 64 ----------------------------------------
 dns/ldns/pkg-plist               |  2 +-
 dns/py-ldns/pkg-plist            |  6 ++--
 5 files changed, 10 insertions(+), 76 deletions(-)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>