[MIR] xdg-desktop-portal-gtk

Bug #1750069 reported by Ken VanDine
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
xdg-desktop-portal-gtk (Ubuntu)
Fix Released
Undecided
Ken VanDine
Xenial
Fix Released
Undecided
Ken VanDine
Bionic
Fix Released
Undecided
Ken VanDine

Bug Description

Availability
============
Actively maintained in debian and we'll sync from debian again when 0.10 is avaiable.

Built for all supported architectures.

Rationale
=========
Required for snaps.

Security
========
No known security issues, but due to the nature of this package, a security review is probably needed.

https://security-tracker.debian.org/tracker/source-package/xdg-desktop-portal-gtk
https://launchpad.net/xdg-desktop-portal-gtk/+cve

Quality assurance
=================
- The Desktop Packages bug team is subscribed.

https://bugs.launchpad.net/ubuntu/+source/xdg-desktop-portal-gtk
https://bugs.debian.org/cgi-bin/pkgreport.cgi?src=xdg-desktop-portal-gtk
https://github.com/flatpak/xdg-desktop-portal-gtk/issues

Dependencies
============
No universe binary dependencies

Standards compliance
====================
4.1.3

debhelper compat 10, dh 7 style simple rules

Maintenance
===========
- Actively developed upstream. Last release was 0.10, this week.
https://github.com/flatpak/xdg-desktop-portal-gtk/commits/master

Well-maintained in Debian by Simon McVittie (Debian's Flatpak maintainer). Team-maintained.
https://salsa.debian.org/debian/xdg-desktop-portal-gtk

Background information
======================
This is needed to make xdg-desktop-portal useful in Ubuntu Desktop. See xdg-desktop-portal MIR bug LP: #1749672

Tags: bionic
tags: added: bionic
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xdg-desktop-portal-gtk (Ubuntu):
status: New → Confirmed
Nish Aravamudan (nacc)
Changed in xdg-desktop-portal-gtk (Ubuntu):
assignee: nobody → Nish Aravamudan (nacc)
Nish Aravamudan (nacc)
Changed in xdg-desktop-portal-gtk (Ubuntu):
assignee: Nish Aravamudan (nacc) → Ubuntu Security Team (ubuntu-security)
Revision history for this message
Nish Aravamudan (nacc) wrote :

This seems fine from a MIR perspective, but needs a security review.

Revision history for this message
Seth Arnold (seth-arnold) wrote :

I will probably finish this MIR in ~two weeks, I thought I'd share the notes I've collected so far in case they are useful to anyone:

Some unclean logs:

update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
/usr/include/glib-2.0/glib/gmem.h:124:8: warning: mutter_session_proxy may be used uninitialized in this function [-Wmaybe-uninitialized]
src/remotedesktopdialog.c:148:16: warning: device_type_name may be used uninitialized in this function [-Wmaybe-uninitialized]
dh_install: Please use dh_missing --list-missing/--fail-missing instead
E: Lintian run failed (policy violation)
Lintian: fail

And some notes on the code:

- image_button_clicked() does image previews
- compose_mail_thunderbird() and compose_mail_evolution() would probably
  allow attaching arbitrary files via malicious addresses -- are the
  addresses shown specifically to the user to confirm them first? The
  thunderbird variant may also allow the same attack via subject and
  body text.

- supports
  file chooser
  app chooser
  print
  screenshot
  notification
  inhibit
  access
  account
  email
  screen cast
  remote desktop

- launch_preview() appears to use unsafe string-based execution with
  user-supplied content rather than safe array-based execution.

Thanks

Revision history for this message
Seth Arnold (seth-arnold) wrote :
Download full text (3.7 KiB)

I reviewed xdg-desktop-portal-gtk version 0.11-1 as checked into cosmic.
This isn't a full security audit but rather a quick gauge of
maintainability.

xdg-desktop-portal-gtk is a "backend" for the portal system to try to make
linux namespacing more ergonomic. It provides dialogs that serve dual
purposes: the standard file-pickers, etc., while simultaneously serving as
unobtrusive access control tools. (Aka "powerbox".)

- No CVE history

- xdg-desktop-portal-gtk is the user-facing portion of the portals
  toolkit; sandboxed applications will use xdk-desktop-portal to call
  into this package or other similar ones for different environments,
  users will make access control decisions, and the results will be
  passed back into the sandboxed applications.

  All the interactions are handled over dbus.

- Build-Depends: dbus, debhelper, libdbus-1-dev, libglib2.0-dev,
  libgtk-3-dev, xdg-desktop-portal-dev, xmlto
- Does not itself do networking
- No pre/post inst/rm scripts
- No init scripts
- systemd user unit file to start
  /usr/lib/xdg-desktop-portal/xdg-desktop-portal-gtk on the dbus service
  org.freedesktop.impl.portal.desktop.gtk
- No setuid files
- No binaries in PATH
- No sudo fragments
- No udev rules
- No test suite
- No cron jobs
- Build logs have some errors

- subprocesses are spawned. The launch_preview() function looks unsafe and
  may need a CVE. The mail compose methods probably allow a malicious
  file to exfiltrate data off the system if the operator isn't paying
  close attention.

- memory management looked careful
- logging looked careful
- sets GIO_USE_VFS environment variable
- No cryptography
- Does not itself do networking, gnome vfs might
- Privileged vs unprivileged portions of code are difficult to untangle
  via casual inspection; I believe this entire package is privileged, but
  I'm not sure if filenames, inputs, etc., are therefore completely
  trusted or completely untrusted or somewhere in the middle.
- No temporary files
- No WebKit
- No PolKit

Here's some of the messy logs:

update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
/usr/include/glib-2.0/glib/gmem.h:124:8: warning: mutter_session_proxy may be used uninitialized in this function [-Wmaybe-uninitialized]
src/remotedesktopdialog.c:148:16: warning: device_type_name may be used uninitialized in this function [-Wmaybe-uninitialized]
dh_install: Please use dh_missing --list-missing/--fail-missing instead
E: Lintian run failed (policy violation)
Lintian: fail

- image_button_clicked() does image previews
- compose_mail_thunderbird() and compose_mail_evolution() would probably
  allow attaching arbitrary files via malicious addresses -- are the
  addresses shown specifically to the user to confirm them first? The
  thunderbird variant may also allow the same attack via subject and
  body text.

- supports
  file chooser
  app chooser
  print
  screenshot
  notification
  inhibit
  access
  account
  email
  screen cast
  remote desktop

- launch_preview() appears to use unsafe string-based execution with
  user-supplied content rather than safe array-based execution.

A trusted helper tool like this is probably g...

Read more...

Changed in xdg-desktop-portal-gtk (Ubuntu):
assignee: Ubuntu Security Team (ubuntu-security) → nobody
Revision history for this message
Sebastien Bacher (seb128) wrote :

Override component to main
xdg-desktop-portal-gtk 1.0.2-2 in cosmic: universe/misc -> main
xdg-desktop-portal-gtk 1.0.2-2 in cosmic amd64: universe/gnome/optional/100% -> main
xdg-desktop-portal-gtk 1.0.2-2 in cosmic arm64: universe/gnome/optional/100% -> main
xdg-desktop-portal-gtk 1.0.2-2 in cosmic armhf: universe/gnome/optional/100% -> main
xdg-desktop-portal-gtk 1.0.2-2 in cosmic i386: universe/gnome/optional/100% -> main
xdg-desktop-portal-gtk 1.0.2-2 in cosmic ppc64el: universe/gnome/optional/100% -> main
xdg-desktop-portal-gtk 1.0.2-2 in cosmic s390x: universe/gnome/optional/100% -> main
Override [y|N]? y
7 publications overridden.

Changed in xdg-desktop-portal-gtk (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Ken VanDine (ken-vandine) wrote :

@seth-arnold You approved this for cosmic only. What's the status of getting this approved for bionic and xenial? Getting this in bionic and xenial would greatly improve the snap desktop support.

Revision history for this message
Seth Arnold (seth-arnold) wrote :

Thanks for the reminder Ken, I completely forgot to file issues on the gui backend.

My intention was for this package to be exposed to wider use and wider inspection for three or four months before encouraging use in our previous LTS releases. I'm still worried that this package hasn't received sufficient community review for it to take such an important role in our ecosystem.

Thanks

Revision history for this message
Seth Arnold (seth-arnold) wrote :
Changed in xdg-desktop-portal-gtk (Ubuntu):
assignee: nobody → Ken VanDine (ken-vandine)
Changed in xdg-desktop-portal-gtk (Ubuntu Xenial):
assignee: nobody → Ken VanDine (ken-vandine)
Changed in xdg-desktop-portal-gtk (Ubuntu Bionic):
assignee: nobody → Ken VanDine (ken-vandine)
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Marked the xenial and bionic tasks as incomplete. Seth gave some guidance but the desktop team needs to respond on how to handle it before anything is done with the seeding.

Changed in xdg-desktop-portal-gtk (Ubuntu Xenial):
status: New → Incomplete
Changed in xdg-desktop-portal-gtk (Ubuntu Bionic):
status: New → Incomplete
Revision history for this message
Seth Arnold (seth-arnold) wrote :

Security team ACK for promoting xdg-desktop-portal-gtk and xdg-desktop-portal to main for bionic and xenial.

Thanks

Revision history for this message
Jeremy Bícha (jbicha) wrote :

(Setting the bug back to Triaged per comment 10)

Changed in xdg-desktop-portal-gtk (Ubuntu Xenial):
status: Incomplete → Triaged
Changed in xdg-desktop-portal-gtk (Ubuntu Bionic):
status: Incomplete → Triaged
Revision history for this message
Steve Langasek (vorlon) wrote :

Override component to main
xdg-desktop-portal-gtk 1.0.2-0ubuntu1.1 in bionic: universe/misc -> main
xdg-desktop-portal-gtk 1.0.2-0ubuntu1.1 in bionic amd64: universe/gnome/optional/100% -> main
xdg-desktop-portal-gtk 1.0.2-0ubuntu1.1 in bionic arm64: universe/gnome/optional/100% -> main
xdg-desktop-portal-gtk 1.0.2-0ubuntu1.1 in bionic armhf: universe/gnome/optional/100% -> main
xdg-desktop-portal-gtk 1.0.2-0ubuntu1.1 in bionic i386: universe/gnome/optional/100% -> main
xdg-desktop-portal-gtk 1.0.2-0ubuntu1.1 in bionic ppc64el: universe/gnome/optional/100% -> main
xdg-desktop-portal-gtk 1.0.2-0ubuntu1.1 in bionic s390x: universe/gnome/optional/100% -> main
7 publications overridden.

Changed in xdg-desktop-portal-gtk (Ubuntu Bionic):
status: Triaged → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote :

Override component to main
xdg-desktop-portal-gtk 1.0.2-0ubuntu0.0 in xenial: universe/gnome -> main
xdg-desktop-portal-gtk 1.0.2-0ubuntu0.0 in xenial amd64: universe/gnome/optional/100% -> main
xdg-desktop-portal-gtk 1.0.2-0ubuntu0.0 in xenial arm64: universe/gnome/optional/100% -> main
xdg-desktop-portal-gtk 1.0.2-0ubuntu0.0 in xenial armhf: universe/gnome/optional/100% -> main
xdg-desktop-portal-gtk 1.0.2-0ubuntu0.0 in xenial i386: universe/gnome/optional/100% -> main
xdg-desktop-portal-gtk 1.0.2-0ubuntu0.0 in xenial powerpc: universe/gnome/optional/100% -> main
xdg-desktop-portal-gtk 1.0.2-0ubuntu0.0 in xenial ppc64el: universe/gnome/optional/100% -> main
xdg-desktop-portal-gtk 1.0.2-0ubuntu0.0 in xenial s390x: universe/gnome/optional/100% -> main
8 publications overridden.

Changed in xdg-desktop-portal-gtk (Ubuntu Xenial):
status: Triaged → Fix Released
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.