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

Proposal: Store downloaded files in a custom file format #1139

Open
legoktm opened this issue Jul 10, 2024 · 0 comments
Open

Proposal: Store downloaded files in a custom file format #1139

legoktm opened this issue Jul 10, 2024 · 0 comments

Comments

@legoktm
Copy link
Member

legoktm commented Jul 10, 2024

Proposal:

Affected components

  • SecureDrop Workstation
  • SecureDrop Client

People and roles

Problem Statement

We have a few different problems that have been addressed in different ways, this is a proposal to address them in a single, more robust manner:

Solution impact

  • We feel more confident about files being opened in the correct VM
  • We simplify the maintenance of the various MIME file lists

Requirements and constraints

TK

Exploration

  • previous do-not-open-here implementation, need to research more why it was abandoned

Initial proposal

We store files in a custom format, for example, b"SECUREDROP-UNSAFE" + base64(file.as_bytes()). This prevents any other processes from trying to mime sniff the file because it is base64-encoded, and if something tries to forcibly open it, it's just plain text.

We only need to teach mime/mailcap/XDG about our new file type (e.g. application/securedrop-unsafe) instead of overriding every single file type.

A companion wrapper program, securedrop-open, checks what VM it is being executed in, and if it's the wrong one, refuses to open (displaying an error, logging somewhere, etc.). If it's the correct VM, it "extracts" the underlying file and forwards it to xdg-open or whatever program we choose. It can also handle the case where no appropriate program is available.

To some extent, this is the new type pattern applied to a file.

Selected proposal

@legoktm legoktm changed the title Store downloaded files in a custom file format Proposal: Store downloaded files in a custom file format Aug 8, 2024
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

No branches or pull requests

1 participant