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

Disallow sources to access or delete their own submissions #13

Closed

Conversation

eaon
Copy link
Contributor

@eaon eaon commented Feb 24, 2023

Basic testing done, working as expected. Fixes #10.

It turns out the codebase already distinguished between file_id and file_name, both of which are randomly generated secrets.token_hex(32) values. This adapts the use of these variables, making file_id knowable by the source, and changes file_name to be used to access/delete a particular file.

Journalists create a signed map of file_id and file_name key/values, which they share. Any long-term journalist signature is verified by the server, adding the respective mappings as members to the file_token redis set. This then allows the server to tell sources what they're allowed to learn (file_id) when submitting anything, while journalists can infer what they need to learn (file_name) when they receive messages or want to reply to a source. In the case of the latter, sources have to be told what they needs to know (file_name) by journalists without supplying other details of the public/private file_id/file_name map.

Notes

  1. I don't know if there was a significant reason for distinguishing between file_name for file-system names and file_id for database/remote access names, but as far as I can tell there is no need to hide on-disk file names from recipients. Happy to adapt if this is still something we want to continue to do.
  2. The base branch for this PR is messages-as-attachments (i.e. Treat messages and metadata as attachments #8), as protocol symmetry is a key point of this change (even though it could be adapted to just not send replies as file uploads, i.e. the source would not need to learn file_name)

@eaon eaon force-pushed the disallow-source-file-access-and-deletion branch from 9a5c054 to 11b455a Compare February 24, 2023 20:33
@eaon eaon force-pushed the disallow-source-file-access-and-deletion branch from 11b455a to 3da93d4 Compare February 24, 2023 20:59
@eaon
Copy link
Contributor Author

eaon commented Jan 25, 2024

Closing this as it's overall more impractical than a public-key cryptography based approach (touched on in #10 (comment) although that exact line of thinking is also outdated) to solve this issue.

@eaon eaon closed this Jan 25, 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

Successfully merging this pull request may close these issues.

1 participant