-
Notifications
You must be signed in to change notification settings - Fork 72
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
Raw Sockets API #431
Comments
Proposed Response: Harmful This proposal enables direct TCP and UDP access to services. This creates a way to circumvent protections, in particular the same-origin policy, that have been developed to protect these services. End-Run Around ProtectionsThe unique ability of a browser to run untrusted code from arbitrary sources is tolerated only because browsers are careful to avoid being used as a platform to attack others. Providing a web site with access to TCP or UDP creates the opportunity to do just that. In this case, the same-origin policy and the mechanisms like preflight checks in CORS are designed to limit request forgery attacks that a web site might attempt that exploit the privileged location of the browser in the network. Those protections are not perfect, but as they are well established and understood we believe that further responsibility for protecting vulnerable resources over and above that falls on the operator of those services. This proposal circumvents all existing protections. As a new API, the onus for protecting those potentially affected by the change falls on the proponents of the API. Note that the same-origin policy is the current formalization of an old contract that dates back to early work on cross-site request forgery. This was reaffirmed in the design of WebSockets after research into attacks on middleboxes. This API would trivially enable the attacks cited in these papers. Mozilla does not believe that any of the proposed protections are adequate. Many of the supplemental protections are either unworkable or inadequate, for reasons explained below. The proposed protections reduce to the one basic protection: user choice. We don’t believe that this is adequate given the level of exposure possible. The proposal attempts to use the “chooser” model rather than the “permissions” model for consent. That is, the goal is to have the user specify a destination, rather than have the user grant the capability for sites to choose destinations. The chooser model is generally regarded as a far stronger indication of intent, so it is worth considering here. However, there are a few shortcomings that we have identified.
That is, we believe that attempts to rely on the chooser model effectively reduce to asking for permission in this case. Narrower ApplicabilityAfter discussing this at some length, we understand more of the motivation for the proposal. In particular, it was suggested that narrowing applicability might allow us to find some conditions where use of the API is acceptable. For the purposes of this, let’s stipulate that this applies only to services that cannot be updated at all. Services that can be updated can be given the ability to speak web protocols (like HTTP) or provide signals that indicate a willingness to interact with web sites using TCP or UDP. Enterprise Managed BrowsersA common case for requiring TCP or UDP access is for access to legacy services in enterprise settings. In that environment, if we assume that the browser is managed by the enterprise, it seems reasonable to provide a way for the enterprise to list services that can be contacted using TCP or UDP directly and the sites that are permitted to do so. That provides one path to enabling this sort of capability. There’s an assumption here that is worth pointing out. Enterprise management is often singular, but the identities involved are not. This sort of configuration likely changes its meaning depending on where the browser is in the network. Put differently, IP addresses used are not guaranteed to be unique, especially “non-public” ones. Therefore, this assumes that the browser will not be placed into a different network where the same configuration might take on a different, undesirable meaning. For example, an enterprise might allow some sites access to an internal service identified by an IP address, such as a 10.0.0.0/8 or 192.168.0.0/16 address. If the browser could be moved to another network, such as an employee’s home, then the sites that were granted access can now attack a host with the same IP address. There might be some ways to bind configuration in some way to network identity, but that depends on new network configuration mechanisms that might not be acceptable to people who wish to use TCP or UDP in this way. This sort of issue is why we think it is important to continue to have these discussions captured in specifications, rather than insist on authorization models being kept proprietary. BYOThe challenge is when a device lacks an equivalent source of this sort of authorization. For an enterprise example again, this might be a case of a device that is brought in by a visitor or employee that can’t rely on receiving authorization via enterprise management. That is, an unmanaged BYOD scenario. Similarly, this could be for IoT devices in a person’s home. Absent the service providing signals and some entity that can provide authorization, our only source of authorization information is users. As previously mentioned, we don’t believe that asking for permission is adequate here and we look forward to the development of the new UX paradigms that this will require in order to offer user control. Limitations of AnalysisThe explainer assumes that use of a “non-public” address is a good indicator of a resource needing protection. That is, firewalls only safeguard RFC1918 addresses. This is a failing in CORS-1918 that is acceptable in that context as CORS-1918 only aims to expand protections; that it fails to extend that protection to services on non-public addresses is merely an unfortunate shortcoming. As this proposal is expanding capabilities, this is not sufficient. It is also worth noting that many of the services that this API targets will operate in private address space. And, with the move to cloud services, it is entirely possible that services hosted in the cloud will need to connect to these services. The prohibition on loopback and link-local addresses is likely the only constraint that can reasonably be applied. Blocking specific ports, like blocking non-public addresses, is only a partial defense. Many vulnerable services operate on ports other than the default. Separately, it’s not clear what “the destination host supports CORS” means in the context of this.
The point here isn’t to suggest that this is bad and that these other ports should be blocked as well, but to point out that a more thorough analysis seems likely to reveal many such problems. This indicates that the analysis performed by the proponents is likely inadequate in identifying potential vulnerabilities. This is likely a case where an explainer is not a good format for making a proposal. Specifics matter, so the level of hand-waving inherent to an explainer isn't helpful. Yes, that is requesting that proponents do more work, but that seems appropriate for something like this. Other IssuesOthers have already commented on the potential for this name to be confused with existing uses of the term “raw sockets”. Although the process of setting up a socket is unique to this API, the interactions with an established socket follow the same pattern as other APIs. The API should be unified with other, concurrent work in similar APIs. Updates to the WebSocket API (in the WHATWG) and WebTransport (in the W3C) in particular. It appears as though that is happening with WHATWG streams apparently being the basis of the proposal, but we believe this to be worth noting specially. We will also note that the lack of cryptographic protection - or a framework that might enable the same - for the content of communications is problematic. This is mentioned in passing, but is non-trivial to add. The proposed unsafe-eval constraint is interesting, but it is an orthogonal consideration. Part of trusting a site with this capability has to include trusting them to protect themselves from unauthenticated inputs. If we believe that users are competent to make this decision to grant the general capability (something I personally do not), then I think that we could very reasonably assume that such a site is capable of also protecting itself adequately. |
I've referred to this as "low-level" sockets, but I'm happy to entertain alternative names. Closes mozilla#431.
This analysis more or less matches my interpretation. I would add several more points:
I would also second Martin's point about an explainer being a bad format for this. What was already known prior to this proposal was: (1) this would be a useful capability to have That's why there has been so much prior work and also why nothing has been standardized here in the past. Thus, the predicate question to whether or not one ought to attempt to develop a specification here is whether we have a new angle on the security question that would lead us to believe that the known problems are soluble. But assessing that would require far more than a sketchy list of problems and potential mitigations. A complete analysis that demonstrates that things have in fact changed should be the focus of any further work here. |
I've referred to this as "low-level" sockets, but I'm happy to entertain alternative names. Closes #431.
too bad, this is one of the last items preventing the browser to become a true application plattform |
@ceisserer I'd even dare to say that this is the last item preventing the browser to become a true application platform.. |
this got superseeded by the web-modules standard which does not need your consensus as conses is reached on the ESHost level have a nice day cheers. |
@jaruba your wrong it is now a app platform agreement of mozilla not needed. |
Request for Mozilla Position on an Emerging Web Specification
The text was updated successfully, but these errors were encountered: