Optimistic data socks handshake variant violates RFC we could to ignore except total code logic brokenness.
For something like https transport code functionality depends timing of socks proxy. If socks-proxy answer before TLS handshake can to start then browser process socks handshake as server hello therefore violates TLS session.
You can't to use code fully based on race condition. You can't to fix code so it never process any input data as soon as you start TLS handshake. Only solution to rip out that code entirely.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
arlolra: Did you see any crashes with that patch or how did it break STARTTLS? I actually wonder whether the patch is the culprit for crashes like #22330 (moved) and #22977 (moved)...
16:22:33.163 An error occurred during a connection to duckduckgo.com:443.The client has encountered bad data from the server.Error code: <a id="errorCode" title="SSL_ERROR_BAD_SERVER">SSL_ERROR_BAD_SERVER</a> 1 (unknown)
We should consider the security implications of this in 0.3.3.
Did you mean to file a new ticket for the tor part (the patch in question is a Tor Browser patch, see #3875 (moved))? Or did you mean the Tor Browser team should fix that on the tor side as well? (Right now the ticket is still assigned to tbb-team)
Oops, sorry, I thought this was an issue with Tor's optimistic data feature.
Is there anything that Tor can do tohelp here, or is it an issue with how the application uses the
SOCKSPort?
Trac: Milestone: Tor: 0.3.3.x-final toN/A Component: Core Tor/Tor to Applications/Tor Browser Points: 1 toN/A Keywords: tor-tls, security-low-maybe, regression deleted, N/Aadded Status: needs_information to new
See #24432 (moved) for an example of a situation where this optimistic data socks handshake patch surprisingly broke stuff.
It's starting to look more like we're going to rip it out.
I think it would be worth exploring whether we can do the same behavior in a smarter way from the browser though -- the feature essentially removes a round-trip across the Tor network from page loads.
I think it would be worth exploring whether we can do the same behavior in a smarter way from the browser though -- the feature essentially removes a round-trip across the Tor network from page loads.
Instead of implementing a patch in the browser, I wonder if we could patch the tor proxy instead with roughly the same speedup.
The SOCKS client opens a TCP connection to the tor proxy
The SOCKS client sends a SOCKS CONNECT command
The proxy immediately returns a spoofed SOCKS CONNECTED notification to the SOCKS client, and the proxy also sends a BEGIN cell to the Exit.
The SOCKS client sends some data to the proxy (the GET request, for example).
The proxy sends a DATA cell to the Exit
This arrangement doesn't require any modification to the browser's SOCKS implementation, but it means we don't wait for the Exit to respond with CONNECTED before asking the SOCKS client to send its first data. Basically we put the "optimism" in the proxy instead of the browser. That's nice because then (1) we will get a speedup to all ordinary SOCKS clients and (2) we're patching code controlled by Tor Project.
Provided the round trip time between the SOCKS client and proxy is very small compared to the round-trip time through the Tor network, the performance should presumably be about the same as the existing patch in Tor Browser.
I think it would be worth exploring whether we can do the same behavior in a smarter way from the browser though -- the feature essentially removes a round-trip across the Tor network from page loads.
Instead of implementing a patch in the browser, I wonder if we could patch the tor proxy instead with roughly the same speedup.
Ok, I agree that #5915 (moved) is a promising direction to explore.
Maybe this is also a ticket where we should involve our shiny new UX group? It would be smart to look at what sorts of error messages you get right now out of Tor Browser when Tor fails to establish a connection to the desired destination, and compare those to what we could get if we trick Tor Browser into thinking that the connection worked, and then if it turns out to fail, have Tor essentially mitm the connection and pretend to be the browser giving you an error. In particular, what are the situations where this idea would break down (SSL? html5? images and videos? more?), and what should we do then?
FWIW: My plan is to rip the patch out as soon as we want to deploy moat (which should be soon). Then moat will be quite a while on the alpha channel I suspect. Meanwhile work on 0.3.4 should be under way which means #5915 (moved) could be fixed before moat hits the stable channel (and stable release get affected by the backout).
This is basically reverting 6d594cc227f153364b91e8310d59a07d7d6ce5f6, right? If so, just doing a git revert 6d594cc227f153364b91e8310d59a07d7d6ce5f6 is slightly better as the next rebase would then automatically remove the optimistic SOCKS handshake code. I try to remember doing that manually. :)
Applied to tor-browser-52.6.0esr-8.0-2 (commit 67fa1e520d8cfc420f5bdee4b53b8310df18a977).
Trac: Resolution: N/Ato fixed Status: needs_review to closed
This is basically reverting 6d594cc227f153364b91e8310d59a07d7d6ce5f6, right? If so, just doing a git revert 6d594cc227f153364b91e8310d59a07d7d6ce5f6 is slightly better as the next rebase would then automatically remove the optimistic SOCKS handshake code. I try to remember doing that manually. :)
You are correct of course. I will try to remember to use git revert next time!
please don't remove this feature. it's important roundtrip saver for interactively clients. if you don't want it, just switch:
OptimisticData 0
The implementation was not really compatible with Mozilla's network stack, hence the crashes linked to in this bug. We need a new implementation to fix that, not disabling optimistic data in a config file.