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

Potential DOS via huge tails file PUT ? #32

Open
jcourt562 opened this issue May 27, 2022 · 2 comments
Open

Potential DOS via huge tails file PUT ? #32

jcourt562 opened this issue May 27, 2022 · 2 comments

Comments

@jcourt562
Copy link

I am logging this for someone to double check. I don't see any limit on the writing of the temporary tails file PRIOR to checking the hash on the ledger. My expectation is that it could be possible to send a continuous stream that would eventually exceed all storage available and cause service failure. The code I am concerned about is in tails_server/web.py :

while True:
                chunk = await field.read_chunk(CHUNK_SIZE)
                if not chunk:
                    break
                sha256.update(chunk)
                tmp_file.write(chunk)

A revocation registry is created with a number of entries specified so is there any possibility that the ledger can be used to pre-calculate a max/expect length from information retrieved when the tails_hash is ?

Happy to be wrong on this but thought I should pose the question from code review.

@swcurran
Copy link
Contributor

Sorry for the delay in responding. Agree this is a problem and as mentioned #33 this is because this repository requires some improvements to make it production ready. This would definitely fit into that category.

@jcourt562
Copy link
Author

I am adding some team stories locally to see if we can spend some time on these in Q3.

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

2 participants