Web API should use a more reliable, out-of-band means of reporting errors (such as a server connection being lost) during a download #822
Labels
No Label
0.2.0
0.3.0
0.4.0
0.5.0
0.5.1
0.6.0
0.6.1
0.7.0
0.8.0
0.9.0
1.0.0
1.1.0
1.10.0
1.10.1
1.10.2
1.10a2
1.11.0
1.12.0
1.12.1
1.13.0
1.14.0
1.15.0
1.15.1
1.2.0
1.3.0
1.4.1
1.5.0
1.6.0
1.6.1
1.7.0
1.7.1
1.7β
1.8.0
1.8.1
1.8.2
1.8.3
1.8β
1.9.0
1.9.0-s3branch
1.9.0a1
1.9.0a2
1.9.0b1
1.9.1
1.9.2
1.9.2a1
LeastAuthority.com automation
blocker
cannot reproduce
cloud-branch
code
code-dirnodes
code-encoding
code-frontend
code-frontend-cli
code-frontend-ftp-sftp
code-frontend-magic-folder
code-frontend-web
code-mutable
code-network
code-nodeadmin
code-peerselection
code-storage
contrib
critical
defect
dev-infrastructure
documentation
duplicate
enhancement
fixed
invalid
major
minor
n/a
normal
operational
packaging
somebody else's problem
supercritical
task
trivial
unknown
was already fixed
website
wontfix
worksforme
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Reference: tahoe-lafs/trac-2024-07-25#822
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The discussion of bug #698 (which turned out to be a Firefox bug) turned up a potential integrity problem that can occur if a server connection is lost in the middle of a download via the WUI:
(@@http://allmydata.org/trac/tahoe/ticket/698#comment:73322@@)
As pointed out in http://allmydata.org/pipermail/tahoe-dev/2009-May/001724.html , it is possible that the length so far plus the length of the error message, coincidentally equals the expected file length. So even for a web client that diligently checks the Content-Length, there might not be enough information to detect an error. An attacker might try to force this situation (I don't know what their chance of success would be, but probably much higher than trying to attack the crypto).
In any case, the WUI is currently using in-band error reporting, which is problematic because the error message will be treated as data of whatever format the client thinks the content has. This is an integrity issue because the download from the gateway to the client has no cryptographic integrity checking.
To close this bug, find and implement some way to make typical web clients reliably report an error when a download fails part-way through. Alternatively, prove that it isn't possible, and document this as an inherent limitation of the WUI.
An alternative to Chunked Encoding that is worth considering is to use HTTP-over-TLS for the WUI (since TLS does have the ability to report errors out-of-band that clients "MUST" pay attention to, although I don't know how these are displayed to the user).
Note that the TLS handshake would only occur once per client of a given gateway, so the main performance impact would only be the session encryption/MAC. OTOH, we'd probably have to use self-signed certificates, which throw up very ugly warnings in recent browsers.
Using SSL/TLS might in principle also have helped with #127 (cap leakage via Referer headers), but see http://allmydata.org/trac/tahoe/ticket/127#comment:13
Yeah, I think chunked encoding is the way to go.
WUI should use a more reliable, out-of-band means of reporting errors when a server connection is lost during a downloadto Web API should use a more reliable, out-of-band means of reporting errors when a server connection is lost during a downloadBumping to critical -- I hadn't realized when I reported this ticket that it applies to
all front-endsthe CLI as well (since it depends on the webapi), not just the WUI.We should probably do the TLS alert thing anyway when the webapi is running over TLS. Does twisted's TLS API make that reasonably easy?
I've got no idea.. most of the TLS glue code in python is synchronous, so Twisted has to do some weird acrobatics to present it in a more async form to the higher layers. So there might be places where, e.g., a TLS alert might not get reported until some other (normal) piece of data came through behind it. I also haven't ever seen an interface for triggering or reading a TLS alert.
I don't actually know what the TLS alerts are meant for, or what sorts of information they could convey. In this case, we've committed to a successful response with a certain length, and after the fact, we discover that we can't provide data beyond a certain point. What sort of TLS alert would be appropriate in this case? How would a typical client (i.e. web browser) react to this? And how easy is it for say libopenssl- or gnutls- using code to see these alerts? The latter question translates into "how many TLS-speaking applications are likely to react correctly?". Ideally something like 'wget' or the tahoe cli tools should should get an error indication and e.g. delete their temporary output file instead of closing it normally.
I don't know that using SSL on a localhost connection is likely to work very well in practice. Self-signed certificates are a mess, and there's no CA that will sign for "localhost", and you really want to be running the tahoe client node locally. I still think that 127.0.0.1 is the right place for the webapi, in which case there's no point in encryption (anyone who can read packets off the loopback interface can also read your memory), and without a CA-signed certificate we can't get authentication out of a typical web browser. So, I don't see how we could really use it.
Servers being lost aren't the only reason why a download may fail.
Web API should use a more reliable, out-of-band means of reporting errors when a server connection is lost during a downloadto Web API should use a more reliable, out-of-band means of reporting errors (such as a server connection being lost) during a download(http://bugs.python.org/issue6312) is a bug in
httplib
(fixed in Python 2.7) that occurs when a HEAD response uses chunked encoding. Therefore we should only serve chunked encoding for GET requests.