4 ms·
Now that we have an OCaml SSL implementation, has anyone put together a roadmap for building up to a complete browser in OCaml? It would be the work of a decad
by lmm 12y ago
Now that we have an OCaml SSL implementation, has anyone put together a roadmap for building up to a complete browser in OCaml?
It would be the work of a decade or more to rewrite image parsing, HTML rendering and all the rest of it, but I honestly think it's the only way we're ever going to get decent security.
- robin_reala 12y agoThe other way is Rust :) https://github.com/servo/servo https://github.com/servo/servo Interestingly Mozilla are looking at parts of Gecko that could be rewritten in Rust as an early win (instead of rewriting the entire thing) and image decoding comes up pretty often as a candidate.
- thegeomaster 12y agoI'm wondering about Mozilla's plans with Servo. Granted, it's a layout engine and the majority of these bugs creep up in low-level data processing (such as in this example) but it's a necessary step towards writing a browser using "safe" technology. Now we only depend on the security of compilers and VMs for these languages :)
- sp332 12y agoServo is an experimental platform and is not intended for production. Hopefully people will learn from it when making future projects though.
- gsnedders 12y agoLast I knew they didn't have much in the way of defence against timing side-channels, which pretty much rules it out for any real deployment.
- lmm 12y agoDon't they? I'd think someone would crack the bitcoin piñata if so.
- sp332 12y agoBitcoin piñata http://ownme.ipredator.se/ http://ownme.ipredator.se/ https://news.ycombinator.com/item?id=9027743 https://news.ycombinator.com/item?id=9027743
- dezgeg 12y agoNot everything in a SSL implementation needs constant-time operations. For example, something like ASN.1 parsing (which is a huge PITA do in C and has led to vulnerabilities in the past) could very well be done in OCaml.
- rikkus 12y agoIt's true that some languages, by their very nature, make exploits like buffer overflows impossible, but if a browser was to be built with entirely new code for this reason, I'd be much happier to see it built on a VM such as a JVM or a CLR, so more widely-known language[s] could be used for development.
- lmm 12y agoBoth the JVM and CLR have heap compaction pauses that make them unsuitable for even soft realtime (e.g. video streaming), which is something we want browsers to be capable of. You need either pauseless mutable heap compaction (something only Azul's super-expensive JVM does AIUI, and it requires a modified kernel to do it), a mostly-immutable language (OCaml, Haskell etc.), or explicit but safe memory management (pretty much a new thing in Rust).
- edwintorok 12y agoThe Java plugin used to have a lot of security advisories (well maybe not as many as browsers, but still) and Mozilla had to blacklist certain versions: https://addons.mozilla.org/en-US/firefox/blocked/ https://addons.mozilla.org/en-US/firefox/blocked/ If the Java plugin itself has security vulnerabilities how can we expect a full browser written in Java to have none?
- lmm 12y agoThe Java plugin was trying to do the approximately impossible: run untrusted code that had direct access to all the primitives of a full, first-class programming language. Flaws in the VM security would not compromise the security of a browser written in Java (they might make it hard to e.g. implement a secure plugin system for your browser - but Mozilla doesn't even try to not trust extensions, they rely on signing and allow a signed extension to do anything)
- Lawtonfogle 12y agoThe Java plugin was trying to give the ability to use Java, which could control all aspects of your machine, without them being able to control all those aspects of your machine. I can't create a javascript that installs a C&C silently in the background, but Java by default would allow all sorts of issues as it isn't sandboxed. The Java plugin was the attempt to build a sandbox. The problems occurred because it is vastly easier to build a sandboxed language from the ground up than to sandbox a language with full access.
- edwintorok 12y agoThere was an experiment using Webkit: http://caravel.forge.ocamlcore.org/ http://caravel.forge.ocamlcore.org/ I don't know if its possible to gradually replace Webkit's components with OCaml...