Host machine exposed to tenant networks via IPv6

Bug #1534652 reported by Dustin Lundquist
266
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Security Advisory
Won't Fix
Undecided
Unassigned
OpenStack Security Notes
Fix Released
Undecided
Vinay Potluri
networking-midonet
Fix Released
High
YAMAMOTO Takashi
neutron
Fix Released
High
Dustin Lundquist
Kilo
New
Undecided
Unassigned

Bug Description

When creating a new interface Neutron creates interface and brings link up without disabling default IPv6 binding. By default Linux brings IPv6 link local addresses to all interfaces, this is different behavior than IPv4 where an administrator must explicitly configure an address on the interface.

The is significantly exposed in LinuxBridgeManager ensure_vlan() and ensure_vxlan() where a new VLAN or VXLAN interface is created and set link up before being enslaved in the bridge. In the case of compute node joining and existing network, there is a time window in which VLAN or VXLAN interface is created and has connectivity to the tenant network before it has been enslaved in bridge. Under normal circumstances this time window is less than the time needed to preform IPv6 duplicate address detection, but under high load this assumption may not hold.

I recommend explicitly disabling IPv6 via sysctl on each interface which will be attached to a bridge prior bringing the interface link up. This is already done for the bridge interfaces themselves, but should be done for all Neutron configured interfaces in the default namespace.

This issue was referenced in https://bugs.launchpad.net/neutron/+bug/1459856
Related issue addressed being addressed in Nova: https://review.openstack.org/#/c/198054/

Revision history for this message
Dustin Lundquist (dlundquist) wrote :

I have a fix ready for this.

Changed in neutron:
assignee: nobody → Dustin Lundquist (dlundquist)
Revision history for this message
Jeremy Stanley (fungi) wrote :

Since this report concerns a possible security risk, an incomplete security advisory task has been added while the core security reviewers for the affected project or projects confirm the bug and discuss the scope of any vulnerability along with potential solutions.

Changed in ossa:
status: New → Incomplete
description: updated
Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

If this is already somewhat public domain, does it make sense to go through this process? Btw, is

https://review.openstack.org/#/c/196199

The fix you are referring to?

Revision history for this message
Dustin Lundquist (dlundquist) wrote :

No, https://review.openstack.org/#/c/196199 is not the patch. Attached is patch, unit tests still require modifications.

Revision history for this message
Jeremy Stanley (fungi) wrote :

If the issue described here is already considered public knowledge or has been discussed in modest detail in a public venue, then we should switch the report to either Public Security (or just Public it doesn't seem like something for which we'd issue a security advisory). If this issue is not yet publicly known, then the VMT generally leaves it up to the bug reporter and security reviewers for the affected project(s) to determine whether the risk is significant enough to require any embargo period.

Revision history for this message
Dustin Lundquist (dlundquist) wrote :

I don't believe the explicit example of the of the LinuxBridge agent's VLAN and VXLAN interface are well known, but generally it is known that IPv6 binds to Neutron/Nova interfaces on the host and there have been a number of cases where IPv6 is exposed to the underlying host. Considering https://bugs.launchpad.net/nova/+bug/1470931 and https://bugs.launchpad.net/neutron/+bug/1302080 I don't think there is much value continue the embargo.

Revision history for this message
Dustin Lundquist (dlundquist) wrote :

Updated patch including unit tests.

Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

Based on the chat I had with Dustin, I'd say we can make this public, as done already.

Changed in neutron:
status: New → Confirmed
importance: Undecided → High
milestone: none → mitaka-2
Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

@Dustin: please post the patch through the usual review process.

Revision history for this message
Jeremy Stanley (fungi) wrote :

I've switched the bug from Private Security to Public Security based on comments 3, 6, 8 and 9 above.

information type: Private Security → Public Security
Changed in neutron:
status: Confirmed → In Progress
description: updated
Changed in neutron:
milestone: mitaka-2 → mitaka-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/268373
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=fc8ebae0351f5b6596951cdfc5cb4259501d84f2
Submitter: Jenkins
Branch: master

commit fc8ebae0351f5b6596951cdfc5cb4259501d84f2
Author: Dustin Lundquist <email address hidden>
Date: Thu Jan 14 23:04:43 2016 -0800

    Prevent binding IPv6 addresses to Neutron interfaces

    Explicitly disable IPv6 on Neutron created interfaces in the default
    namespace before setting link up. Since the default behavior of IPv6 is
    to bind to all interfaces as opposed to IPv4 where an address must be
    explicitly configured we disable IPv6 on each interface before enabling
    the interface. This avoids leaving a time window between when the
    interface is enabled and when it is attached to bridge device during
    which the host could be access from a tenant network.

    Move disable_ipv6() from BridgeDevice to base IPDevice class so it is
    usable by all interfaces. Then we explicitly disable IPv6 on veth
    interfaces in the default namespaces and VXLAN and VLAN interfaces
    created by the LinuxBridge agent.

    In addition vlan interface is moved from LinuxBridgeManager to IPWrapper
    so it can return an IPDevice object.

    Closes-Bug: #1534652
    Change-Id: Id879075f2d5ee42f8ff153e813e7519a4424447b

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
YAMAMOTO Takashi (yamamoto) wrote :

MidonetInterfaceDriver in networking-midonet repo has the same issue.

Changed in networking-midonet:
assignee: nobody → YAMAMOTO Takashi (yamamoto)
importance: Undecided → High
milestone: none → 2.0.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to networking-midonet (master)

Fix proposed to branch: master
Review: https://review.openstack.org/287074

Changed in networking-midonet:
status: New → In Progress
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/neutron 8.0.0.0b3

This issue was fixed in the openstack/neutron 8.0.0.0b3 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-midonet (master)

Reviewed: https://review.openstack.org/287074
Committed: https://git.openstack.org/cgit/openstack/networking-midonet/commit/?id=6cb84079f9e791b7f2da6e65bc670c008e6f55fd
Submitter: Jenkins
Branch: master

commit 6cb84079f9e791b7f2da6e65bc670c008e6f55fd
Author: YAMAMOTO Takashi <email address hidden>
Date: Wed Mar 2 19:02:36 2016 +0900

    Prevent binding IPv6 addresses to Neutron interfaces

    Closes-Bug: #1534652
    Neutron change: Id879075f2d5ee42f8ff153e813e7519a4424447b
    Change-Id: I7ae0d1ad540e81c99681aa00d609f2ad1baa4511

Changed in networking-midonet:
status: In Progress → Fix Released
Revision history for this message
Miguel Angel Ajo (mangelajo) wrote :

Does this affect kilo/liberty ? I'm adding the potential backport flags for just in case, feel free to remove.

tags: added: kilo-backport-potential liberty-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/291275

Revision history for this message
Dustin Lundquist (dlundquist) wrote :

Backported to Liberty. This patch would require significant work to backport to Kilo due to changes in LinuxBridge agent.

Revision history for this message
Ihar Hrachyshka (ihar-hrachyshka) wrote :

Dustin, do you plan to follow up with Kilo patch?

Revision history for this message
Dustin Lundquist (dlundquist) wrote :

Ihar, I could do that.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/296659

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/liberty)

Reviewed: https://review.openstack.org/291275
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=ccdfd17666698b81074ead89dc865949074295e5
Submitter: Jenkins
Branch: stable/liberty

commit ccdfd17666698b81074ead89dc865949074295e5
Author: Dustin Lundquist <email address hidden>
Date: Thu Jan 14 23:04:43 2016 -0800

    Prevent binding IPv6 addresses to Neutron interfaces

    Explicitly disable IPv6 on Neutron created interfaces in the default
    namespace before setting link up. Since the default behavior of IPv6 is
    to bind to all interfaces as opposed to IPv4 where an address must be
    explicitly configured we disable IPv6 on each interface before enabling
    the interface. This avoids leaving a time window between when the
    interface is enabled and when it is attached to bridge device during
    which the host could be access from a tenant network.

    Move disable_ipv6() from BridgeDevice to base IPDevice class so it is
    usable by all interfaces. Then we explicitly disable IPv6 on veth
    interfaces in the default namespaces and VXLAN and VLAN interfaces
    created by the LinuxBridge agent.

    In addition vlan interface is moved from LinuxBridgeManager to IPWrapper
    so it can return an IPDevice object.

    Conflicts:
     neutron/agent/linux/bridge_lib.py
     neutron/tests/unit/plugins/ml2/drivers/linuxbridge/agent/test_linuxbridge_neutron_agent.py

    Closes-Bug: #1534652
    Change-Id: Id879075f2d5ee42f8ff153e813e7519a4424447b
    (cherry picked from commit fc8ebae0351f5b6596951cdfc5cb4259501d84f2)

tags: added: in-stable-liberty
Revision history for this message
Tristan Cacqueray (tristan-cacqueray) wrote :

Is it only the compute host that is exposed before the v[x]lan is enslaved to the bridge ?

If so, then I'd like to remove the OSSA task for the same reason of previous similar bug reports: the compute host needs to be secured properly.

Revision history for this message
Dustin Lundquist (dlundquist) wrote :

@Tristan, Any host which is hosting ports for a given Neutron network: usually this would be a compute or network node role. I agree these hosts should be properly secured, but it would be unexpected to an operator for a tenant instance to be connecting to a hypervisor hosts via IPv6 link-local.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/kilo)

Reviewed: https://review.openstack.org/296659
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=b69bce8a8fe6382549850717be51623239d38769
Submitter: Jenkins
Branch: stable/kilo

commit b69bce8a8fe6382549850717be51623239d38769
Author: Dustin Lundquist <email address hidden>
Date: Thu Jan 14 23:04:43 2016 -0800

    Prevent binding IPv6 addresses to Neutron interfaces

    Explicitly disable IPv6 on Neutron created interfaces in the default
    namespace before setting link up. Since the default behavior of IPv6 is
    to bind to all interfaces as opposed to IPv4 where an address must be
    explicitly configured we disable IPv6 on each interface before enabling
    the interface. This avoids leaving a time window between when the
    interface is enabled and when it is attached to bridge device during
    which the host could be access from a tenant network.

    Move disable_ipv6() from BridgeDevice to base IPDevice class so it is
    usable by all interfaces. Then we explicitly disable IPv6 on veth
    interfaces in the default namespaces and VXLAN and VLAN interfaces
    created by the LinuxBridge agent.

    In addition vlan interface is moved from LinuxBridgeManager to IPWrapper
    so it can return an IPDevice object.

    Conflicts:
     neutron/agent/linux/bridge_lib.py
     neutron/agent/linux/interface.py
     neutron/agent/linux/ip_lib.py
     neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py
     neutron/tests/unit/plugins/ml2/drivers/linuxbridge/agent/test_linuxbridge_neutron_agent.py

    Closes-Bug: #1534652
    Change-Id: Id879075f2d5ee42f8ff153e813e7519a4424447b
    (cherry picked from commit fc8ebae0351f5b6596951cdfc5cb4259501d84f2)

tags: added: in-stable-kilo
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/311573

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (stable/mitaka)

Change abandoned by Tristan Cacqueray (<email address hidden>) on branch: stable/mitaka
Review: https://review.openstack.org/311573
Reason: Oups, mea-culpa... I didn't realised master change was merged before stable/mitaka. This backport is void.

Henry Gessau (gessau)
tags: added: ipv6
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/neutron 2015.1.4

This issue was fixed in the openstack/neutron 2015.1.4 release.

Revision history for this message
Tristan Cacqueray (tristan-cacqueray) wrote :

Based on a similar report (bug 1302080), I've closed the OSSA task. However I've added an OSSN task to discuss an eventual Note about compute and controller firewalling requirements.

Changed in ossa:
status: Incomplete → Won't Fix
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/neutron 7.1.0

This issue was fixed in the openstack/neutron 7.1.0 release.

Luke Hinds (lhinds)
Changed in ossn:
assignee: nobody → Luke Hinds (lhinds)
Changed in ossa:
assignee: nobody → Vinay Potluri (vinay-potluri)
Changed in ossn:
status: New → Confirmed
assignee: Luke Hinds (lhinds) → Vinay Potluri (vinay-potluri)
Changed in ossa:
assignee: Vinay Potluri (vinay-potluri) → nobody
Revision history for this message
Luke Hinds (lhinds) wrote :

Hmm ok, I was already working on this. Did you want to take over it?

Revision history for this message
Vinay Potluri (vinay-potluri) wrote :

Luke Hinds,
I'm new to OpenSource and started working on it at the midcycle. If you have already worked on it we can combine our work on the bug.

Revision history for this message
Luke Hinds (lhinds) wrote :

Vinay, no problem. Can I share a doc with your gmail account? I can send you what I have researched, and support you in submitting a patch and getting a note published.

Its always good to have new folk come on to help :)

Revision history for this message
Vinay Potluri (vinay-potluri) wrote : Re: [Bug 1534652] Re: Host machine exposed to tenant networks via IPv6

Sure Luke, please share it with me. It will be very helpful.
On Aug 17, 2016 5:26 PM, "Luke Hinds" <email address hidden> wrote:

> Vinay, no problem. Can I share a doc with your gmail account? I can send
> you what I have researched, and support you in submitting a patch and
> getting a note published.
>
> Its always good to have new folk come on to help :)
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/1534652
>
> Title:
> Host machine exposed to tenant networks via IPv6
>
> Status in networking-midonet:
> Fix Released
> Status in neutron:
> Fix Released
> Status in neutron kilo series:
> New
> Status in OpenStack Security Advisory:
> Won't Fix
> Status in OpenStack Security Notes:
> Confirmed
>
> Bug description:
> When creating a new interface Neutron creates interface and brings
> link up without disabling default IPv6 binding. By default Linux
> brings IPv6 link local addresses to all interfaces, this is different
> behavior than IPv4 where an administrator must explicitly configure an
> address on the interface.
>
> The is significantly exposed in LinuxBridgeManager ensure_vlan() and
> ensure_vxlan() where a new VLAN or VXLAN interface is created and set
> link up before being enslaved in the bridge. In the case of compute
> node joining and existing network, there is a time window in which
> VLAN or VXLAN interface is created and has connectivity to the tenant
> network before it has been enslaved in bridge. Under normal
> circumstances this time window is less than the time needed to preform
> IPv6 duplicate address detection, but under high load this assumption
> may not hold.
>
> I recommend explicitly disabling IPv6 via sysctl on each interface
> which will be attached to a bridge prior bringing the interface link
> up. This is already done for the bridge interfaces themselves, but
> should be done for all Neutron configured interfaces in the default
> namespace.
>
> This issue was referenced in https://bugs.launchpad.net/
> neutron/+bug/1459856
> Related issue addressed being addressed in Nova:
> https://review.openstack.org/#/c/198054/
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/networking-midonet/+bug/1534652/+subscriptions
>

Revision history for this message
Luke Hinds (lhinds) wrote :

If there are any core Neutron reviewers, could you please look at the review[1]. We need a +1 before we can send out the security note.

[1] https://bugs.launchpad.net/ossn/+bug/1534652

Luke Hinds (lhinds)
Changed in ossn:
status: Confirmed → Fix Released
tags: removed: kilo-backport-potential liberty-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 2015.1.4

This issue was fixed in the openstack/neutron 2015.1.4 release.

To post a comment you must log in.
This report contains Public Security information  
Everyone can see this security related information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.