Detect invalid HTTP storage server responses early, close request #3908

Open
opened 2022-07-15 14:04:55 +00:00 by itamarst · 0 comments

When downloading shares, if the Content-Length/Content-Range of a response doesn't match requested body length (too short means we were wrong about what server has in terms of length, or server bug, too long means server bug), we should probably just give up early.

This depends on #3907; currently we knowingly send non-matching lengths, so that needs to be fixed first.

It also depends on https://github.com/twisted/treq/issues/347 to make this possible at all. This has been fixed, but requires a 2023 release of Treq.

Implementation: when deliverBody() happens the passed-in protocol gets access to the transport, allowing us to close the connection.

When downloading shares, if the Content-Length/Content-Range of a response doesn't match requested body length (too short means we were wrong about what server has in terms of length, or server bug, too long means server bug), we should probably just give up early. This depends on #3907; currently we knowingly send non-matching lengths, so that needs to be fixed first. It also depends on <https://github.com/twisted/treq/issues/347> to make this possible at all. This has been fixed, but requires a 2023 release of Treq. Implementation: when deliverBody() happens the passed-in protocol gets access to the transport, allowing us to close the connection.
itamarst added the
unknown
normal
enhancement
n/a
labels 2022-07-15 14:04:55 +00:00
itamarst added this to the HTTP Storage Protocol milestone 2022-07-15 14:04:55 +00:00
itamarst modified the milestone from HTTP Storage Protocol to HTTP Storage Protocol v2 2023-01-23 14:16:10 +00:00
Sign in to join this conversation.
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: tahoe-lafs/trac-2024-07-25#3908
No description provided.