-
Notifications
You must be signed in to change notification settings - Fork 1
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
Sources are able to access and delete attachments/uploads because they know the file_id
#10
Comments
file_id
file_id
Nice catch! https://github.com/lsd-cat/securedrop-poc/blob/main/server.py#L84-L99 |
file_id
file_id
OK this expanded a bit since I posted the issue originally. I tried to make this as accessible as I could for everyone to follow along: PresentMy understanding of the present flow of attachment uploads is as such:
If this is correct, I believe that 2b and 2c are situations we'd prefer to avoid, as we'd essentially create an anonymous command and control server that does not interfere with the functionality of the rest of the server at all, or would allow malicious actors to deteriorate the system as fast as rate-limiting (of a non-proof-of-concept implementation) allows. Desired functionalityIn the short-hand I've used above: we want
Potential solution (outdated)Edit: this has been superseded by this comment I spent some time to think through this and the only workable version I could come up with is described below. There may be better ways of arriving at the desired functionality, this is a first stab at it. Prerequisites
FlowBelow I'm describing 1-3. (4 is just speculation and would have to include a stage where the public key is also shared with the source and would replace the symmetric encryption.)
AddendumThis bums me out a bit as it is quite a bit of overhead, but I believe it's manageable as the rest of the scheme so far is also quite minimal. Incidentally, this would also address #4 because the However: If we don't deem point 4 and 5 of Desired functionality important enough, the easiest "fix" would be a shared secret between server and journalists. This would imply that that a server would be able to distinguish between journalists and sources at every upload check, as uploads for sources and journalists would have to be treated differently. Happy to discuss sync or async in this ticket. |
I read that carefully and I like your proposal when countering the "spam" and large/multiple uploads, but I think that even in this way a source could always submit multiple files (send multiple submission) even if we establish a Journalist-Server secure channel and we encrypt About deletion, IMHO we are pursuing the "wrong" goal. Even before the PoC I was not really into exposing the file download and file deletion APIs. The actual PoC implements those feature server-side but by definition we cannot trust the server into serving the right file or actually deleting the file (for a bug or if LE has control of the server). So the solution is implement the function in the only parties we trust:
|
Interesting points!
On the journalism side I can see how this would work, on the source side I'm having a harder time imagining it playing nice with plausible deniability and the related UX implications. To elaborate, since the source will not have local state and will always depend on what the server provides it with (other than its key derived from the passphrase, that is), not having a deletion API exposed would also mean that one of the advantages of the current design is slightly weakened: generally, when there's no reply on the server, there's no way to prove that this "account" (key) has ever been seen by the server, but, if there is a reply that cannot be deleted by the source, the existence of the source is provable for the window in which the server is keeping replies for it available, instead of allowing it to be decided by the source. For further context, in the current SD design, sources are already encouraged to delete replies from journalists as soon as they read them, but we also don't have reliable data on whether this actually happens. Source accounts however, can only be deleted by journalists. But speaking of not having data, we also don't know how long we'd need to keep replies around in the first place, whether sources return regularly, sporadically or at all, and with the PoC basically making journalist and source interaction with the server the same, I'm worried that we'd then have to default to a very long retention period, effectively replicating the same issue with accounts being provable (as is the case with SD right now) despite there not being "real" accounts in the PoC. As far as metadata leakage goes, I also wonder about this and would like more analysis of this point, but currently I'm sceptical that deletion is in any way worse than access in the first place. Other than that, I am no lawyer but at the point where they can prove you are a whistleblower, "tampering with evidence" may be the least of your problems. |
Trying to find a way to avoid #10 (comment)'s extra key-pool; please poke holes liberally:
Leakage: If the requestor knows about |
Similar approach I've considered but discarded due to concerns re symmetry/potentially easier traffic analysis:
Giulio also pointed out that another ephemeral pool or using ephemeral keys for this may not be necessary, as the long-term keys could be used for that too. The major downside of such a solution is the round-trips this would make necessary, or more explicitly: journalists would need to sync messages to send a message … Edit: come to think of it, we could just have a journalist-only endpoint that shares secrets and only responds to signed requests. Even easier |
Going through the shared secret bit again, I realised that I've only considered that the secret is coming from the server or is "static" and shared by server and journalists. Neither of these approaches work with the symmetry constraint I've tried to keep in mind. But if it is provided by journalists and used by servers like the public-key based scheme above, I think we'd still be good. My instinct was to use public keys so as to not trust the server that much but we already have to trust it to at least serve the right files, from which follows that using cryptography here rather than "plain text" secrets is overkill. So here's the revised scheme:
Downside is that this does also require a pool of |
Given the recent changes with regards to the protocol as well the changes to the codebase, I've been revisiting this because I've never really loved the token pair solution. Maintaining a list of token pairs is rather unnecessary, it's overall more straightforward if journalists had access to a private key that the server generates and distributes every time a new journalist is being onboarded/offboarded. For every attachment, the server would generate an ephemeral secret, the public key would be sent back as a response to a successful upload. The attachment's address would then be the shared secret between the (server distributed) journalist's key, and the ephemeral upload key. Bonus: when a party gets offboarded, all attachment addresses can be recalculated at once, barring an offboarded party from accessing attachments, as opposed to the token pair version in which (if they weren't replaced) an offboarded party could theoretically keep the private list and try to download attachments without being found out. |
Devil is in the details: Existing messages can't just be recalculated, because shared secrets (ie. attachment addresses) would be embedded in messages to sources. So old "addresses" / shared secrets would have to be retained until the last message of the set that's saved at the time (of private key rotation) has been deleted. Some metadata to help identify which private key is to be used for a particular message would probably make this a lot easier to handle in practice. Also: the server should probably not be the one to generate the private key and then send it out, that would make identity correlation way too easy. So probably a newsroom responsibility? |
If I understand everything correctly, then the knowledge of a
file_id
allows anyone to delete the file on the server.file_id
is also sent by sources to journalists - right after uploading an attachment (or even when messaging in the case of #8) malicious sources could immediately delete the file after.If this is the case and if we want to mitigate that (attack scenarios I can imagine are repeated large uploads with subsequent deletes that would wear down the SSDs of the server eventually resulting in an eventual hardware failure based DoS), the easiest solution would be to introduce a shared secret between journalists and servers. That would make journalist traffic identifiable though which isn't desirable.
I believe I have an idea of what a solution could look like that avoids distinguishing between sources and journalists, but want to check with y'all before I invest time in thinking through that scheme.
The text was updated successfully, but these errors were encountered: