Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SecureDrop desktop shortcuts not displayed correctly on Tails 3.3 #2586

Closed
DonnchaC opened this issue Nov 17, 2017 · 13 comments
Closed

SecureDrop desktop shortcuts not displayed correctly on Tails 3.3 #2586

DonnchaC opened this issue Nov 17, 2017 · 13 comments

Comments

@DonnchaC
Copy link
Contributor

DonnchaC commented Nov 17, 2017

Bug

The desktop shortcuts for the SecureDrop Source and Journalist interfaces do not show the correct title and logo on Tail 3.3. Tails 3.3 introduces a fix for the .desktop file security issue. The fix requires .desktop files to have a trusted metadata parameter set before the .desktop file is parsed and displayed with a custom name and icon.

The shortcuts are displayed with a name like source.desktop and requires a user to click "Trust and Launch" before the shortcut is displayed with the correct name and icon. Requiring users to click-through this warning could cause warning fatigue and result in unsafe user behavior.

Steps to reproduce

Click a SecureDrop .desktop shortcut on a Journalist Workstation running Tails 3.3.

Expected Behavior

The SecureDrop .onion opens in Tor Browser.

Actual Behavior

The user receives a warning about an untrusted .desktop file.

Comments

The SecureDrop tails-config Ansible role should set the Nautilus metadata::trusted parameter for both the Source and Journalist .desktop files.

@ghost ghost added this to the 0.5 milestone Nov 17, 2017
@DonnchaC DonnchaC changed the title SecureDrop desktop shortcuts not display correctly on Tails 3.3 SecureDrop desktop shortcuts not displayed correctly on Tails 3.3 Nov 17, 2017
@redshiftzero
Copy link
Contributor

Thanks for filing @DonnchaC. We need to run gio set name_of_file.desktop metadata::trusted yes for each desktop shortcut. This metadata won't persist so this needs to be executed at the start of the Tails session.

@redshiftzero
Copy link
Contributor

Hey @kushaldas and @emkll since y'all are going to take a look at fixing this for 0.5 - recall that in the tails-config role, we have securedrop_init.py to persist state in the journalist/admin workstations. That would be a good place to add the gio command from this comment.

@kushaldas
Copy link
Contributor

I tried manually run the gio command on a given desktop file, it still kept asking me to trust the desktop file first.

On the other hand, the verified Tails 3.3 ISO failed to boot after installation from a USB device in a VM. initramfs fails to find any bootable live image. It boots from the ISO perfect.

@kushaldas
Copy link
Contributor

I will submit a small python code based PR for the securedrop_init.py, but first I have to find a better to verify that the given commands as it is supposed to be.

@emkll
Copy link
Contributor

emkll commented Nov 21, 2017

@kushaldas I had the same problem: It seems like the metadata doesn't get applied to the ~/Desktop/source.desktop or ~/Desktop/journalist.desktop (because of symlink?) One needs to edit the metadata of /lib/live/mount/persistence/TailsData_unlocked/dotfiles/Desktop/ and recreate the symlinks on the Desktop.

@kushaldas
Copy link
Contributor

@emkll I was trying on a real file on the Desktop directory in my test.

@kushaldas
Copy link
Contributor

Finally found the issue into my code.

For the record, this commit has the formal fix in the upstream Nautilus code.

For any new desktop file, I had to follow two steps.
gio set source.desktop metadata::trusted yes and the chmod +x source.desktop.

This also explains the comment about setting the metadata on the real link instead of the symlink, as gio generally follows the symlink as I understand.

@emkll
Copy link
Contributor

emkll commented Nov 22, 2017

One other issue I've encountered is that these commands throw an error when you are uid 0, which is the privileges with which securedrop_init.py runs. The only times I've successfully set the .desktop file as trusted was with the amnesia user.

@kushaldas
Copy link
Contributor

kushaldas commented Nov 22, 2017

The commands I have mentioned above will work for any directory except ~/Desktop. Following is from a chat with the upstream developer of Nautilus.

<csoriano> I have the feeling I know what's going on... the desktop files you see in the ui desktop are not actually desktop files
<csoriano> it's a custom made weird nice thing we do because desktop is great :)
<csoriano> so maybe we are failing to sync the metadata for files in the ~/Desktop
... 
<csoriano> kushal: I guess there are two bugs, one that the desktop fails to sync because it's using the weird NautilusLink files (emulating actual files) and the other in regular folders in some cases it fails to sync the metadata.

I have filed the upstream bug here. This comment in the source explains why this is not a problem when we double click and mark as trusted. Sadly this can not be done by any command.

Possible solution

  • Do the steps before Nautilus comes up (may not be possible using the securedrop_init.py script).
  • Kill current nautilus-desktop process and then relaunch it.
  • Ask the journalists to press F5 to refresh the desktop before anything else.

I will try out the options now, and update this issue as I find out more details.

@emkll
Copy link
Contributor

emkll commented Nov 22, 2017

@kushaldas I got it to work by deleting and re-creating the symlink. If you run this as amnesia and not sudo:

subprocess.call(['rm', '/home/amnesia/Desktop/source.desktop'])
subprocess.call(['ln', '-s', '/lib/live/mount/persistence/TailsData_unlocked/dotfiles/Desktop/source.desktop', '/home/amnesia/Desktop/source.desktop'])
subprocess.call(['gio', 'set', '/home/amnesia/Desktop/source.desktop', 'metadata::trusted', 'yes'])

@kushaldas
Copy link
Contributor

Rebooting and following the steps mentioned in the above comment is not working for me. If you have marked the file trusted once, and then if you remove and follow the rest of the steps, then it will work. After reboot we are back to the same old untrusted desktop files.

@emkll
Copy link
Contributor

emkll commented Nov 22, 2017

@kushaldas I seem to have made both progress and regression (see https://github.com/freedomofpress/securedrop/tree/tails_3.3_desktop_icons), it seems like environment variables are required to set the metadata.

@conorsch
Copy link
Contributor

Adding screenshots here as documentation for the behavior—the fix has been merged so further QA will not sure these untrusted desktop icons any longer.

tails-desktop-icons-untrusted-1

tails-desktop-icons-untrusted-2

Feel free to take the above for use in release documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants