Red Hat Bugzilla – Full Text Bug Listing
|Summary:||CVE-2012-3411 libvirt needs to use new dnsmasq option to avoid open DNS proxy|
|Product:||[Other] Security Response||Reporter:||Eric Blake <eblake>|
|Component:||vulnerability||Assignee:||Red Hat Product Security <security-response-team>|
|Status:||ASSIGNED ---||QA Contact:|
|Version:||unspecified||CC:||awilliam, berrange, clalancette, dougsland, dwmw2, eblake, gczarcinski, itamar, jforbes, jlieskov, jreznik, jrusnack, laine, libvirt-maint, robatino, security-response-team, simon, tflink, thozza, veillard, virt-maint|
|Fixed In Version:||Doc Type:||Bug Fix|
|Doc Text:||Story Points:||---|
|oVirt Team:||---||RHEL 7.3 requirements from Atomic Host:|
|Bug Depends On:||882265, 882309|
Comment 1 Eric Blake 2012-11-08 12:08:58 EST
Reposting the relevant portions as a non-private comment: ... Yes, I think libvirt needs to be patched to use the new "--bind-dynamic" option. ... Aha, this works better: /sbin/dnsmasq --strict-order --bind-dynamic --local=// --domain-needed --pid-file=/var/run/libvirt/network/net3.pid --conf-file= --interface virbr1 --dhcp-range XXXXX --dhcp-leasefile=/var/lib/libvirt/dnsmasq/net3.leases --dhcp-lease-max=13 --dhcp-no-override --dhcp-hostsfile=/var/lib/libvirt/dnsmasq/net3.hostsfile --addn-hosts=/var/lib/libvirt/dnsmasq/net3.addnhosts That is, I have to use '--interface virbr1' instead of '--except-interface lo --listen-address 188.8.131.52'. It still accepts requests received from lo, which confused me momentarily, but it *is* correctly dropping requests received from elsewhere. Although it would be better to reject them with UDP port unreachable errors, rather than reject. Dropping packets is always a bad thing.
Comment 2 Laine Stump 2012-11-08 13:28:41 EST
(I just posted this same comment to the original bug) If libvirt changes its usage of dnsmasq to use --bind-dynamic , it *must* be done in a way that libvirt will continue to operate properly (including calling dnsmasq in an appropriate manner) even on systems that don't have a dnsmasq with --bind-dynamic. So, what must be done is to do a preliminary run of "dnsmasq --help", then parse the output to see if it contains --bind-dynamic, and *only then* change the behavior. Doing otherwise will adversely affect all the libvirt users who don't have a sufficiently modern dnsmasq (the vast majority of which will see no behavioral change from this commandline change anyway - see the next paragraph), and I don't see that as acceptable. Note that this situation only arises when a network is defined with <forward mode='route'>, and that is arguably the *least* common method of setting up a libvirt network by far (it's much more common to use <forward mode='nat'>) (Beyond that, in the general sense, I think this is actually how a listener on a publicly visible IP of a multihomed host for a port that has been opened for incoming connections "on all interfaces" is normally expected to operate (and remember that all the addresses in a libvirt network using <forward mode='route' are considered to be public). Granted, this is a slightly different situation, since this second interface is really there for the benefit of the guests, but truthfully once I read through all the comments and fully understood what was happening, my thought was "well of course it's responding." If it was the case that this dnsmasq instance was answering queries sent to the server's *external* IP address, or if queries from the external network to a truly private address (e.g. 192.168.122.1 of libvirt's "default" network which uses forward mode='nat') were responded to, that would be a more serious issue.) I'll happily cede that point though, and agree that we should make libvirt's DNS server instances only answer queries that originate from guests on that network's bridge. Collapse All Comments Expand All Comments Add Comment
Comment 3 David Woodhouse 2012-11-08 15:23:41 EST
If you're going to make it optional with a fallback for older versions of dnsmasq, then you should probably check for a non-RFC1918 IP address and refuse to run dnsmasq in that scenario. Better to fail and instruct the user to upgrade, than to be vulnerable.
Comment 4 Daniel Berrange 2012-11-08 16:00:38 EST
I agree with David's point to refuse use of non-RFC1918 address ranges in the fallback case.
Comment 5 David Woodhouse 2012-11-09 03:51:15 EST
Note also that you'll have a similar issue if you're using dnsmasq to serve DNS over IPv6 to guests.
Comment 6 Gene Czarcinski 2012-11-19 15:09:12 EST
For IPv6 see RFC4193. The equivalent for the IPv4 RFC1918 addresses is FC00::/7 ... or really (as I see it) FD00::/8 for local IPv6 stuff. I am sure that someone has a valid reason to run real addresses on virtual network interfaces, these should be configured with extreme care. I can see a valid configuration with real addresses when testing ... but only if these addresses are used on virtual network interfaces with NO gateway addresses defined so that nothing can get to them from the virtualization host. Of course, I have always been a bit paranoid ;)
Comment 7 David Woodhouse 2012-11-19 15:55:55 EST
This is (In reply to comment #6) > I am sure that someone has a valid reason to run real addresses on virtual > network interfaces, these should be configured with extreme care. This is nonsense. There are just as many reasons to run with real addresses on virtual machines, as there are to run with real addresses on real machines. Any time you want *proper* connectivity, with the Internet Protocol(s) working end-to-end as designed, and you want the protocols that run on top (like SIP, FTP, etc.) to also work as designed without either breaking completely (as is often the case with SIP and all incoming connections including just being able to SSH into the virtual machine from the outside), or being subject to horrid unreliable ALG hacks to fudge around the problem (like FTP, IPSec, many others), you want to use real addresses.
Comment 8 Dave Allan 2012-11-19 20:33:34 EST
(In reply to comment #7) > This is nonsense This type of comment is not helpful in reaching an optimal technical solution. I appreciate your thoughts on the technical merits of the proposals, but please try to keep your comments constructive.
Comment 9 David Woodhouse 2012-11-20 04:00:54 EST
> (In reply to comment #7) > This type of comment is not helpful in reaching an optimal technical > solution. I'm not sure I agree. A comment such as comment 6, effectively claiming that real addresses shouldn't normally be used on virtual interfaces and suggesting that those who *do* should just have to be wary of security bugs like this one, is completely out of place in this bug. It *is* nonsense, and it definitely needs to be treated as such. Saying that is not a personal attack, and I'm not saying the person who said it is a bad person or smells or has fleas or anything like that. I am not promoting an attitude of violence. This is not a kindergarten; it is a technical discussion. A point of view was presented which has no technical merit in this context — and I was pointing out, correctly, that it should be discounted. And why. The view presented in comment 6 should *not* be taken into consideration when attempting to reach a technical solution. It's *not* good enough simply to say 'caveat emptor'. If you'd like to rephrase that in language more suitable for the kindergarten where we need to be sure we don't make someone cry, then please go ahead and do that in your own head while *reading* it. I shall continue to assume an adult readership when using bugzilla.
Comment 10 David Woodhouse 2012-11-20 04:22:50 EST
Please, if you wish to continue the kindergarten-related metadiscussion, let's do it somewhere other than the context of this bug. For now let's focus on your response to comment 6. This bug is specifically about the vulnerable behaviour of libvirt *WHEN CONFIGURED WITH REAL ADDRESSES* with full connectivity. Any discussion of RFC1918 or site-local or ULA addressing is entirely off-topic. That *isn't* the configuration being discussed. Saying "don't use real addresses" is about as helpful in this bug as saying "don't use libvirt" would be. It's not clear what actual technical recommendation, if any, was being implied by comment 6. Was it being suggested that libvirt should *disallow* the use of real addresses completely, thus rendering it useless for any purpose where full connectivity is required? Was it being suggested that users who configure it thus should *anticipate* that it would have CVE-worthy vulnerabilities, and that we should not bother to fix the problem? And if so, does that same attitude apply to *any* CVE-worthy security bug in Fedora? Just say "oh, don't connect it to the Internet properly and it'll be fine", and don't bother to fix it? Or did I miss something that rendered comment 6 actually *useful* and relevant?
Comment 11 Dave Allan 2012-11-20 12:51:04 EST
I am suggesting is that you refrain from referring to other people's comments as nonsense, particularly when those people are submitting patches and you are not. Whether you choose to accept that feedback is up to you, but you should consider whether your communications style contributes to or detracts from your ability to get what you want.
Comment 12 David Woodhouse 2012-11-20 15:58:38 EST
Can we stick to the technical discussion, please? I don't mind you doing the kindergarten thing and asking me not to refer to nonsense as 'nonsense' just in case I make someone cry (although I did ask for that to be elsewhere than in this bug). But the *important* thing — regardless of whether the words used were suitable for a child's environment — is that in the technical sense we understand that it *was* nonsense, and completely irrelevant and unhelpful in the context of this bug. I wouldn't want such wrong-headed thinking to derail a fix for a security bug when we already appear to have it fairly much wrapped up; it's just a case of *shipping* the fix. (I think you missed the fact that I *did* supply a patch to dnsmasq to fix this, btw. Although the maintainer chose to implement it a different way in the end, and didn't use my patch.)
Comment 13 Laine Stump 2012-11-21 22:02:05 EST
I've posted a series of 3 patches resolving the libvirt part of the bug to libvir-list. After it is pushed, I will backport to the various distros: https://www.redhat.com/archives/libvir-list/2012-November/msg00942.html Please respond to the patch emails with specific comments/suggestions. Gene - thanks for pointing out the RFC for IPv6 local addresses. I wouldn't have thought to add that otherwise. David - thanks for reporting the problem, testing the dnsmasq fix, and providing the exact dnsmasq commandline that fixes the problem; that helped remove the guess work in getting the change correct. Also to Gene - you may notice that these patches end up replacing "--listen-address" with "--interface", so your patch for that will no longer be necessary :-)
Comment 14 David Woodhouse 2012-11-22 07:06:43 EST
In your patch 2/3, you don't include the fec0::/10 "site local" range. Admittedly, site-local is deprecated but it's still actually really useful (for site-local networks which aren't connected to the outside world, and RFC3484 still gets everything *right*). Since it's unlikely to be re-used any time soon for anything *other* than site-local addressing, perhaps it's worth including that range in your list of 'private' addresses?
Comment 15 Laine Stump 2012-11-29 15:33:28 EST
I've pushed the necessary libvirt patches upstream and into the v0.10.2-maint branch, so they will be in the next libvirt build for F18. I still need to backport to v0.9.11-maint for F17. David - I did add FEC0::/10 as you suggested. Thanks for pointing it out.
Comment 17 Laine Stump 2012-11-30 11:01:01 EST
Now that this BZ (which was originally opened against libvirt in F17) has been taken over for package "vulnerability", and is set for all Fedora releases rather than just F17, what Bug should we use to specifically track putting the libvirt fix into F17? Similar question for libvirt fix in F18? I've pushed the changes to their respective -maint branches (v0.9.11-maint and v0.10.2-maint, respectively) in upstream libvirt, and Fedora builds of libvirt are now always made from the upstream -maint branches, but there is now no bug that we can specify in a fedpkg update so that it will be automatically set to ON_QA when the package is pushed to updates-testing, and CLOSED when it is promoted to updates.
Comment 18 Stefan Cornelius 2012-11-30 11:12:59 EST
Created libvirt tracking bugs for this issue Affects: fedora-all [bug 882309]
Comment 20 Tim Flink 2012-11-30 15:37:38 EST
The impact of this is "moderate" which is less than "important" and thus this bug does not qualify as a release blocking bug for F18 final. The release criterion in question  is: The release must contain no known security bugs of 'important' or higher impact according to the Red Hat severity classification scale which cannot be satisfactorily resolved by a package update (e.g. issues during installation) -1 blocker, +1 NTH
Comment 21 Adam Williamson 2012-12-01 03:30:35 EST
ditto tflink, -1 blocker, +1 nth.
Comment 22 Jaroslav Reznik 2012-12-04 07:11:54 EST
Based on final release criterion (as mentioned above), -1 blocker, +1 nth
Comment 23 Tim Flink 2012-12-04 15:46:59 EST
That makes for -3 blocker, moving to rejected
Comment 24 Tim Flink 2012-12-04 15:48:44 EST
Sorry for the noise, forgot to move it to accepted NTH - a tested fix would be considered past freeze for F18 final.
Comment 25 Fedora Update System 2013-01-03 02:24:20 EST
libvirt-0.9.11.8-2.fc17 has been pushed to the Fedora 17 stable repository. If problems still persist, please make note of it in this bug report.