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-export] Change umask on export device files to permit access from other computers with other uids #1726

Closed
airblag opened this issue Sep 29, 2022 · 2 comments · Fixed by #1872
Assignees

Comments

@airblag
Copy link

airblag commented Sep 29, 2022

This issue should replace this one opened in the wrong repository : freedomofpress/securedrop-workstation#822

The files exported on the usb drive are owned by uid 1000. The umask is set to 077 which makes the file readable only by uid 1000 on the system it is going to.

https://github.com/freedomofpress/securedrop-export/blob/1d50f383f90510fb2f545659f39f2d03085b805f/securedrop_export/export.py#L79

In our case, we have Journalists working on Debian workstations, with some central LDAP authentication. A journalist trying to read the export files from securedrop on his daily workstation cannot get access to the files.

I do not see a lot of scenarios where the file permissions on the export stick improves security in any way.
The usb drive is encrypted, so the user first needs to unlock it.
The daily computer should not be trusted. uid 0 would be able to read the files once they are mounted on the daily computer and don't care about the file system permission.

The only situations where the file permissions could increase security would be accessing the file from some unprivileged user on the system, but the exported files are already meant to become public, so I would evaluate the risk as acceptable in my situation.

On top of that, the USB drive is mounted by the system under /media/$USERNAME/ with no permissions for group or others (tested on debian bullseye but I hope it's standart). So the permissions on the filesystem on top of it don't really matter for this attack vector. An unprivileged user would not be able to read the file, if another uid mounted the usb disk.

So I would propose to change the os.umask(0o077) into os.umask(0o022) to give permissions to others to read the files, so the journalists can at least copy files to their working environment independently from their uid, when the device got mounted by themselves.

@rocodes rocodes self-assigned this Jan 13, 2023
@zenmonkeykstop zenmonkeykstop changed the title Change umask on export device files to permit access from other computers with other uids [securedrop-export] Change umask on export device files to permit access from other computers with other uids Dec 13, 2023
@zenmonkeykstop zenmonkeykstop transferred this issue from freedomofpress/securedrop-export Dec 13, 2023
@lsd-cat
Copy link
Member

lsd-cat commented Feb 7, 2024

Agreed that the permissions are not a security boundary and we should aim for proper workflow compatibility.

@rocodes
Copy link
Contributor

rocodes commented Feb 8, 2024

Thanks @lsd-cat, will aim to include in #1777

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

Successfully merging a pull request may close this issue.

3 participants