OA gives out all tokens to any app

Bug #1392380 reported by Michael Zanetti
266
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
High
David Barth
signon (Ubuntu)
Fix Released
Critical
Alberto Mardegan
Utopic
Won't Fix
Undecided
Unassigned
Vivid
Fix Released
Critical
Alberto Mardegan
signon (Ubuntu RTM)
Fix Released
Undecided
Alberto Mardegan
ubuntu-touch-meta (Ubuntu RTM)
Fix Released
Undecided
Unassigned

Bug Description

The attached app will steal all your tokens. All it takes is the "accounts" permission in the apparmor file.

Here's the code: https://pastebin.canonical.com/120398/

Related branches

CVE References

Revision history for this message
Michael Zanetti (mzanetti) wrote :
affects: unity-scope-gdrive → account-plugins
affects: account-plugins → ubuntu-system-settings-online-accounts
summary: - OA gives out all tokes to any app
+ OA gives out all tokens to any app
kevin gunn (kgunn72)
Changed in ubuntu-system-settings-online-accounts:
assignee: nobody → Ubuntu Security Team (ubuntu-security)
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Do you have signon-apparmor-extension installed?

Revision history for this message
Michael Zanetti (mzanetti) wrote :

I did not have that package installed. I installed it now, rebooted the phone but there's no change. The app still prints all the tokens.

Revision history for this message
David Barth (dbarth) wrote :

Is the app "authorized" to use those accounts, in System Settings > OA > Google Account > "badhat" ON|OFF ?

Revision history for this message
David Barth (dbarth) wrote :

To verify that the extension is properly activated, you can use the account tester application, at the bottom of the test plan:
https://wiki.ubuntu.com/Process/Merges/TestPlan/ubuntu-system-settings-online-accounts

In particular, once the extensions is active, you cannot retrieve the token (password in the case of the dummy account type used for testing).

Revision history for this message
Michael Zanetti (mzanetti) wrote :

No, the badapp does not show up in the accounts settings at all.

I installed the account-tester application and followed the test case (button background was red and then turned green once I granted access to the test app).

I realized that there is actually a difference after installing the signon-apparmor-extension. For password-based accounts like Ubuntu One, or the test account I do get Authentication failures after installing it. Before I didn't get them. However, even after installing the extension, the app gets access to token based accounts like my Evernote account and my Fitbit account.

Revision history for this message
Alberto Mardegan (mardy) wrote :

This is not a duplicate, it's a bug affecting signond and/or the authentication plugins, which shouldn't block the seeding of the signon-apparmor-extension.

Revision history for this message
Alberto Mardegan (mardy) wrote :

I can confirm this bug, and I understand why it happens. I still need to determine if the right place to fix it is signond or the signon-plugin-oauth2.
Indeed, only accounts using the oauth plugin are affected.

affects: ubuntu-system-settings-online-accounts → signon (Ubuntu)
Changed in signon (Ubuntu):
assignee: Ubuntu Security Team (ubuntu-security) → Alberto Mardegan (mardy)
status: New → Confirmed
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Is there any point keeping this private due to the lack of signon-apparmor-extension on devices?

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

This is CVE-2014-1423

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

This will need an update to utopic-security as well (for when rtm syncs back up).

information type: Private Security → Public Security
Revision history for this message
Alberto Mardegan (mardy) wrote :

Just to add some more information in order to have a more clear idea of the seriousness of this bug: accounts which are created when the signon-apparmor-extension is installed will work fine: apps won't be able to abuse them.

This bug only affects the accounts which were created when the extension was not installed: even if the extension gets installed later on, the ACL checks will be bypassed and any app can get access to any account.

Fixing this bug will make all accounts (regardless of when they were created) be protected by the ACL once the signon-apparmor-extension is installed.

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Adding rtm14 ota-1 touch-2014-11-27. This needs to be fixed for RTM branch when bug #1376445 is fixed, but bug #1376445 is targeted for ota-1.

Changed in signon (Ubuntu Utopic):
status: New → Confirmed
importance: Undecided → Critical
tags: added: ota-1 rtm14 touch-2014-11-27
tags: added: application-confinement
Alberto Mardegan (mardy)
Changed in signon (Ubuntu Vivid):
status: Confirmed → Fix Released
Changed in signon (Ubuntu RTM):
assignee: nobody → Alberto Mardegan (mardy)
status: New → In Progress
Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

Confirming as this security issue was agreed to be fixed in first update

Changed in canonical-devices-system-image:
importance: Undecided → High
milestone: none → ww51-2014
status: New → Confirmed
Revision history for this message
David Barth (dbarth) wrote :

To finish the landing of the fix, I think we need :
- a backport of signon-apparmor-extension to rtm-14.09
- the addition of the package to the corresponding touch seed

Thanks

Changed in canonical-devices-system-image:
milestone: ww51-2014 → ww05-2015
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-touch-meta - 1.200

---------------
ubuntu-touch-meta (1.200) 14.09; urgency=medium

  * Refreshed dependencies (LP: #1413622), (LP: #1392380)
  * Added signon-apparmor-extension
  * Added ubuntu-keyboard-azerbaijani
  * Added ubuntu-keyboard-bosnian
  * Added ubuntu-keyboard-catalan
  * Added ubuntu-keyboard-croatian
  * Added ubuntu-keyboard-emoji
 -- Oliver Grawert <email address hidden> Fri, 23 Jan 2015 22:04:23 +0100

Changed in ubuntu-touch-meta (Ubuntu RTM):
status: New → Fix Released
Changed in ubuntu-touch-meta (Ubuntu RTM):
status: Fix Released → New
Changed in canonical-devices-system-image:
status: Confirmed → In Progress
milestone: ww05-2015 → ww07-2015
Changed in canonical-devices-system-image:
assignee: nobody → David Barth (dbarth)
milestone: ww07-2015 → ww09-2015
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

FYI, after talking with David Barth, it looks like all the pieces landed in ubuntu-rtm, but signon-apparmor-extension is not installed yet on the images so the bug isn't quite fixed yet.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-touch-meta - 1.202

---------------
ubuntu-touch-meta (1.202) 14.09; urgency=medium

  * Refreshed dependencies (LP: #1392380)
  * Added signon-apparmor-extension
 -- Ricardo Salveti de Araujo <email address hidden> Tue, 17 Feb 2015 19:04:51 -0200

Changed in ubuntu-touch-meta (Ubuntu RTM):
status: New → Fix Released
Changed in canonical-devices-system-image:
status: In Progress → Fix Released
Changed in signon (Ubuntu RTM):
status: In Progress → Fix Released
Changed in signon (Ubuntu Utopic):
importance: Critical → Undecided
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public Security information  
Everyone can see this security related information.

Other bug subscribers

Remote bug watches

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