*** This bug is a security vulnerability ***

You have been subscribed to a public security bug by Seth Arnold (seth-arnold):

uuid.uuid1() has been used for the FileStorage.key field. This field is
used to create unguessable URLs that we can hand out from MAAS to refer
back to that file. However, uuid1() is not random enough:

  def uuid1(node=None, clock_seq=None):
      """Generate a UUID from a host ID, sequence number, and the
      current time. If 'node' is not given, getnode() is used to obtain
      the hardware address. If 'clock_seq' is given, it is used as the
      sequence number; otherwise a random 14-bit sequence number is
      chosen."""

The host ID is, afaik, based on the machine's MAC address, so this is
easily discoverable. The current time is assumed to be nanoseconds, but
in practice appears to be microseconds; check time.time() output.

An attacker, with the knowledge of the machine's MAC address, would need
to search 58982400000000 UUIDs to discover every file created during a 1
hour timespan (3600e6 microseconds * 2^14). That's a lot of UUIDs, but I
doubt it's even close to "secure".

I think uuid.uuid4() would be a better choice here, as it is entirely
made from random data. Or we could go direct and encode (e.g. base
16/32/64) 16 bytes straight from /dev/urandom.

This follows on from discussion in bug 1212205.

** Affects: maas
     Importance: Critical
     Assignee: Blake Rouse (blake-rouse)
         Status: Fix Released

** Affects: maas/1.2
     Importance: Critical
         Status: Won't Fix

** Affects: maas/1.5
     Importance: Critical
         Status: Won't Fix

** Affects: maas/1.6
     Importance: Critical
         Status: Won't Fix

** Affects: maas/1.7
     Importance: Undecided
         Status: Won't Fix

** Affects: maas/1.9
     Importance: Critical
     Assignee: Blake Rouse (blake-rouse)
         Status: Fix Released

** Affects: maas/trunk
     Importance: Critical
     Assignee: Blake Rouse (blake-rouse)
         Status: Fix Released

-- 
uuid.uuid1() is not suitable as an unguessable identifier/token
https://bugs.launchpad.net/bugs/1379826
You received this bug notification because you are a member of Ubuntu Bugs, 
which is subscribed to the bug report.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to