3 ms·
I'm glad you asked! This is a good time for me to bring up something I wrote two years ago: http://news.ycombinator.com/item?id=2024164 http://news.ycombinator
by EGreg 14y ago
I'm glad you asked! This is a good time for me to bring up something I wrote two years ago:
http://news.ycombinator.com/item?id=2024164 http://news.ycombinator.com/item?id=2024164
I really wish browser makers would do this! Mozilla can lead the way.
I am going to post it here for ease of reference:
1) I propose a simple mechanism to guarantee that a resource located at a certain URL is always the same. Similar to how we have https:// https:// blabla, and the user agent warns us if the server's certificate is not trusted, we should have httpc:// blabla to indicate constant resources. Sites all over the world can download resources from httpc:// urls and store hashes to them in various formats, and your user agent can trust one or more of these authorities. When downloading, it would compare the hashes against the ones downloaded from these authorities, and if there is even a small deviation, it would give you a warning just like https:// https://
This must be done by the user agent. Right now we do have "cache control" headers, but I am talking about the server making a promise to the world that a page is really truly static, and user agents having the ability to verify that. This is different from server-controlled caching.
I can see this being used in app stores for the web (curating apps and various versions of apps, like Apple does) and also for secure logins. I would like someone to make guarantees that my password is not being sent in the clear to the server that I am connected to. Right now, the web forces us to trust a remote server completely, when interacting with a website. For example, when I enter a password, I have no assurance that the server won't misuse it. (See http://xkcd.com/792/ http://xkcd.com/792/)
This simple change would make possible a variety of applications that we haven't even thought of, besides these two.
2) The second proposal is to have iframes that are on top of everything else in the containing window, no matter what. That would enable 3rd party logins (such as OAuth) do be done in the iframe, without worrying about clickjacking. The javascript inside the iframe should have a way of checking whether the iframe is of this type. At most one such iframe can be shown in any given window.
This would lead to much more pleasant interfaces, and once again, the user would receive the extra protection. Of course, this means that Flash and other plugins would have to play nice with this. We could implement this rather easily with a browser extension that causes a borderless window to appear (like Flash does) above the actual browser window.
Thoughts?
- hcarvalhoalves 14y ago> 1) I propose a simple mechanism to guarantee that a resource located at a certain URL is always the same (...) You are reinventing ETags.
- EGreg 14y agoETags do not have a built-in system to verify arbitrary hashes of the content from different authorities. Actually both https and httpc rely on authorities and trust. It's an interesting proposal!
- pfraze 14y agoI really like your first proposal. The second one is good too, but less pressing to me than the first. The software I'm working on uses static JS with a high security requirement, and is meant to be deployed on any host. Integrity guarantees would be valuable for that.
- EGreg 14y agoI really hope Mozilla does it!
- csense 14y agoWhy not just sign the file with GPG or openssl or something? If you need to deal with clients that aren't aware of the mechanism, you could just put the GPG signature in a custom HTTP header. If you need to use cloud hosting or the like, and you can't return custom headers, just put the signature in a file with the same name with .sig attached. In fact, I just downloaded a kernel tarball the other day, and kernel.org does exactly this [1]. I also found a few related articles and RFC's [2] [3] [4]. [1] https://www.kernel.org/pub/linux/kernel/v3.x/ https://www.kernel.org/pub/linux/kernel/v3.x/ [2] http://en.wikipedia.org/wiki/Magnet_link http://en.wikipedia.org/wiki/Magnet_link [3] http://www.ietf.org/rfc/rfc3230.txt http://www.ietf.org/rfc/rfc3230.txt [4] http://www.ietf.org/rfc/rfc6249.txt http://www.ietf.org/rfc/rfc6249.txt
- EGreg 14y ago