Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 404959 (CVE-2012-1191) - <net-dns/djbdns-1.05-r32: Cache overwrite vulnerability (CVE-2012-1191)
Summary: <net-dns/djbdns-1.05-r32: Cache overwrite vulnerability (CVE-2012-1191)
Status: RESOLVED FIXED
Alias: CVE-2012-1191
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Gentoo Security
URL:
Whiteboard: B4 [noglsa cve]
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-20 05:00 UTC by GLSAMaker/CVETool Bot
Modified: 2017-01-18 13:45 UTC (History)
1 user (show)

See Also:
Package list:
=net-dns/djbdns-1.05-r32
Runtime testing required: ---
stable-bot: sanity-check+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description GLSAMaker/CVETool Bot gentoo-dev 2012-02-20 05:00:26 UTC
CVE-2012-1191 (http://nvd.nist.gov/nvd.cfm?cvename=CVE-2012-1191):
  The resolver in dnscache in Daniel J. Bernstein djbdns 1.05 overwrites
  cached server names and TTL values in NS records during the processing of a
  response to an A record query, which allows remote attackers to trigger
  continued resolvability of revoked domain names via a "ghost domain names"
  attack.
Comment 1 Michael Orlitzky gentoo-dev 2012-07-15 15:59:01 UTC
Does anyone have an opinion about whether or not we should patch this? The fix recommended in the paper is easy to implement: we just ignore NS updates unless they come from the delegating parent.

As mentioned in the paper, this has two negative side effects:

1. Performance. You have to go one level up the hierarchy to get NS updates. In my opinion not a big deal.

2. Some misconfigurations may stop working. If example.com's parent has different NS records for example.com than the nameservers for example.com do, the fix could expose that fact. The DNS spec forbids this, but I have no idea how prevalent it is in practice.
Comment 2 Markos Chandras (RETIRED) gentoo-dev 2012-10-28 17:31:49 UTC
Maybe this should go upstream first? Let them decide what to do
Comment 3 Michael Orlitzky gentoo-dev 2012-10-28 17:59:01 UTC
(In reply to comment #2)
> Maybe this should go upstream first? Let them decide what to do

Upstream is essentially dead. DJB released the code into the public domain and no patches have been merged with the official source ever since.

There are a few people maintaining forks. Some just apply patches, others attempt to do away with the build system and daemontools. None of them really have critical mass yet though so I'm wary of switching.

None of the forks have patched this issue, but there was some discussion and a patch on the mailing list.
Comment 4 Michael Weber (RETIRED) gentoo-dev 2013-07-09 00:14:58 UTC
(In reply to Michael Orlitzky from comment #3)
> None of the forks have patched this issue, but there was some discussion and
> a patch on the mailing list.
Do you have a link to that mail/discussion?
Comment 5 Michael Orlitzky gentoo-dev 2013-07-09 15:07:15 UTC
(In reply to Michael Weber from comment #4)
> (In reply to Michael Orlitzky from comment #3)
> > None of the forks have patched this issue, but there was some discussion and
> > a patch on the mailing list.
> Do you have a link to that mail/discussion?

http://marc.info/?t=134184388900003&r=1&w=2
Comment 6 Aaron Bauman (RETIRED) gentoo-dev 2016-11-27 12:52:52 UTC
@maintainer, what can be done here?  Please let us know... thanks!
Comment 7 Thomas Deutschmann (RETIRED) gentoo-dev 2016-11-28 16:55:39 UTC
@ Maintainer: Please consider https://github.com/pjps/ndjbdns/commit/c90dbbbac5622e2744733f39e037263e63b51266 (that's the patch RH is using; Do to different code style you will have to adjust the patch but it does apply between line 794 and 795).

And maybe consider moving to ndjbdns src in general, see http://pjp.dgplug.org/ndjbdns/ for additional missing fixes.
Comment 8 Michael Orlitzky gentoo-dev 2016-12-02 17:05:23 UTC
This isn't a serious vulnerability, it's an obscure flaw in the way the DNS protocol was designed. The proof-of-concept is cool, but not practical, and there are no real-world situations where

  1. An attacker can influence my DNS cache,

  2. That attacker is trying to send me to an expired domain,

  3. It's problematic if I can still resolve the expired name.

More practically: no one should be using dnscache any more. I recommend net-dns/unbound instead, but unfortunately, dnscache comes with net-dns/djbdns, and the latter still provides some other useful daemons like tinydns.

I can set up dnscache locally, but the proof-of-concept is complex. So, there's a trade-off to consider:

  1. We can do nothing. This leaves users of dnscache "vulnerable," but to
     what, I have no idea. If someone can think of a practical attack, I'll
     change my position on the matter.

  2. I can use the patch. It doesn't apply cleanly, I don't understand the
     code, I don't use dnscache in production, and the proof-of-concept is
     too complex so we won't even know if the issue is fixed or not.

The question is, which option above is more dangerous? I'm guessing option #2 is more likely to cause some kind of problem.
Comment 9 Thomas Deutschmann (RETIRED) gentoo-dev 2016-12-02 17:44:44 UTC
(In reply to Michael Orlitzky from comment #8)
> [...]
>   2. I can use the patch. It doesn't apply cleanly, I don't understand the
>      code, I don't use dnscache in production, and the proof-of-concept is
>      too complex so we won't even know if the issue is fixed or not.
> 
> The question is, which option above is more dangerous? I'm guessing option
> #2 is more likely to cause some kind of problem.

I can provide a backport if needed. It is only a code formation issue.


But before we do that, some additional questions:

1) Switching to ndjbdns is not an option? Their patch set is more complete and actively maintained than the cherry-picked patch set we have.

2) We could also get rid of dnscache, i.e. remove it from $D in src_install.
Comment 10 Michael Orlitzky gentoo-dev 2016-12-02 18:10:06 UTC
(In reply to Thomas Deutschmann from comment #9)
> 
> But before we do that, some additional questions:
> 
> 1) Switching to ndjbdns is not an option? Their patch set is more complete
> and actively maintained than the cherry-picked patch set we have. 

ndjbdns would need to be a new, separate, package (see bug #420013). In particular, ndjbdns uses a different build and init system, so it's not a drop-in replacement, and the ebuild would be completely different. It's also missing ipv6 support which we patch in.

I do actively maintain our patch set; the latest addition was on 2016-08-05. But I'm not very familiar with the code, so I try to be judicious about what I blindly apply, especially when I can't test the result and the benefit is dubious.


> 2) We could also get rid of dnscache, i.e. remove it from $D in src_install.

I'm not strongly against this. DNS cache configuration is simple, so while net-dns/unbound isn't a drop-in replacement, you can do it in about 15 minutes.

But, I'm sure we do have active dnscache users. Do we really want to annoy them over this CVE? Anyone can get a CVE for something silly, and I'm not impressed by this one.
Comment 11 Thomas Deutschmann (RETIRED) gentoo-dev 2016-12-02 19:01:26 UTC
PR created, see https://github.com/gentoo/gentoo/pull/2988
Comment 12 Thomas Deutschmann (RETIRED) gentoo-dev 2016-12-04 22:21:49 UTC
PR was merged, https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f19fd949c1e9d06252fdb59c0f1fb0142cb7d9c8


@ Arches,

please test and mark stable: =net-dns/djbdns-1.05-r32
Comment 13 Tobias Klausmann (RETIRED) gentoo-dev 2016-12-05 15:49:14 UTC
Stable on alpha.
Comment 14 Agostino Sarubbo gentoo-dev 2016-12-06 11:50:35 UTC
amd64 stable
Comment 15 Agostino Sarubbo gentoo-dev 2016-12-06 11:53:25 UTC
x86 stable
Comment 16 Jeroen Roovers (RETIRED) gentoo-dev 2017-01-10 09:54:52 UTC
Stable for HPPA.
Comment 17 Agostino Sarubbo gentoo-dev 2017-01-11 10:36:12 UTC
sparc stable
Comment 18 Agostino Sarubbo gentoo-dev 2017-01-15 15:50:25 UTC
ppc stable
Comment 19 Agostino Sarubbo gentoo-dev 2017-01-18 10:02:59 UTC
ppc64 stable.

Maintainer(s), please cleanup.
Security, please vote.
Comment 20 Michael Orlitzky gentoo-dev 2017-01-18 13:29:45 UTC
All vulnerable versions have been removed, thanks.
Comment 21 Aaron Bauman (RETIRED) gentoo-dev 2017-01-18 13:45:09 UTC
GLSA Vote: No