Snap uses hardcoded key and salt for password and cookie encryption

Bug #2038875 reported by Evan Carroll
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
chromium-browser (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

A working Ubuntu install includes Gnome which includes the gnome-keyring. The snap version of Ubuntu does not make use of it. On an install of Debian with Gnome, the key ring is used. However, with Ubuntu everything is encrypted with the static key of peanuts and the salt of saltysalt, and openly accessible as sqlite databases in ~/snap/chromium/common/chromium, including passwords from the browser and the cookies.

This should probably be fixed. If a laptop is physically compromised it's trivial to decrypt this with a tool like xbrowser.

You can verify that gnome-libcrypt isn't chosen by default with --enable-logging=stderr --v=1 redirect stderr to a log and look for Crypt.

You can see /why/ gnome-libcrypt isn't chosen with chromium --password-store=gnome-libcrypt --enable-logging=stderr --v=1 and again looking for messages with Crypt.

I don't think this is a vulnerability per se, Chrome ships in Debian with the ability to use a basic store too. But it's an undesirable configuration and a regression from Debian when it's run on a platform with gnome and libsecret, and only doesn't work because of snap.

summary: - Snap does not use v11 encryption for cookie store
+ Snap uses hardcoded key and salt for password and cookie encryption
Revision history for this message
Evan Carroll (evancarroll) wrote (last edit ):

You know if you're using the insecure v10 cookies by looking at the first three bytes of encrypted data in the sqlite database. If it reads \x76\x31\x30 you've got v10.. literally. if the third byte is \x31 you've got v11 the desirable variant.

Revision history for this message
Nathan Teodosio (nteodosio) wrote : Re: [Bug 2038875] Re: Snap uses hardcoded key and salt for password and cookie encryption

Hi Evan, thank you for the thorough report.

Are you aware of Chromium having the password-manager-interface? Then it
will use the keyring.

Revision history for this message
Evan Carroll (evancarroll) wrote (last edit ):

The Chrome password manager does not mean it uses the Operating System's key ring. If the key ring is not available or the configuration doesn't detect it (as in the case of the snap) it will use key "peanuts" with salt "saltysalt".

Revision history for this message
Nathan Teodosio (nteodosio) wrote :

If password-manager-service is connected with

   snap connect chromium:password-manager-service

then it uses the operating system's key ring.

So are you pointing out that Chromium ought to use gnome-libcrypt
instead of basic when no key ring is detected?

tags: added: password-storage
Revision history for this message
Evan Carroll (evancarroll) wrote (last edit ):

I'm pointing that when I add chromium on a fresh Ubuntu install it does not configure itself to use the libsecret keyring. When I add chromium on a fresh Debian/Gnome Desktop install it does. This difference is in packaging, and presumably came when chromium was migrated to use snap. But I would think what should happen is the prior behavior, if you're on a gnome de with libsecret, it by default should use the OS key ring.

Revision history for this message
Nathan Teodosio (nteodosio) wrote :

Found the duplicate target; See there that the interface auto-connection was denied by Snap Store.

Revision history for this message
Evan Carroll (evancarroll) wrote :

@Nathan That's not the same bug from my reading. That's about an upgrade. I'm saying on a totally fresh install the default behavior is not to use the OS keyring, despite it being available.

Revision history for this message
Nathan Teodosio (nteodosio) wrote :

Well true, I'm removing the duplicate mark, however it does explain why we cannot do this:

https://forum.snapcraft.io/t/auto-connecting-the-cups-control-and-password-manager-service-interfaces-for-the-chromium-snap/4592/6

Changed in chromium-browser (Ubuntu):
status: New → Won't Fix
Revision history for this message
Evan Carroll (evancarroll) wrote :

That's a truly bizarre argument, but I've responded to it there.

Revision history for this message
Erlenmayr (erlenmayr) wrote :

This appears to be related with Bug LP:1996267.

Revision history for this message
Nathan Teodosio (nteodosio) wrote :

That is a good target for a duplicate, marking it accordingly, thanks for the heads-up.

Revision history for this message
Evan Carroll (evancarroll) wrote :

I don't think this is an exact dupe but it's pretty damn close. That issue is about passwords; this one cookies. That issue is being mega distracted by whether or not passwords are stored clear, or through symmetric encryption. This one acknowledges that it's stored with symmetric encryption.

I'll follow up with that one though, after I extend xbrowser to demonstrate the exploitation of the password side.

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

Other bug subscribers

Remote bug watches

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