MITM Boxes Reduce Network Security Even More Than They Are Designed To

It was recently discovered by the Tor project that a manufacturer of Man-In-The-Middle boxes with SSL interception capability, called Cyberoam, have been embedding the same root certificate in all of their boxes.

Background: SSL is not supposed to be interceptable. The only way to do it is for the intercepting box to be the endpoint of the SSL session and then, after inspecting the traffic, send the information over a different SSL session to the client. Now that we have explicitly banned trusted CAs from facilitating this after the Trustwave incident, the box should not be able to generate its own trusted-by-default certificate for the target site. Instead, it generates a cert which chains up to the box’s own embedded root. Therefore, any user of a network whose owners wish to use a such a box to inspect SSL traffic will have been asked to import whichever root certificate the box uses into their trusted root store, in order to avoid getting security warnings – the very warnings which would otherwise correctly tell you that your communications are being intercepted.

If each box uses a different root certificate, this is not a big problem. (Well, apart from the general issue of having to permit your employer or school to intercept your secure communications.) However, as noted above, Cyberoam uses the same root for all the boxes they manufacture. This root reuse means that sites who have tried to use Cyberoam boxes to punch a small hole in their security for ostensibly reasonable purposes have actually punched a rather larger one.

If you have trusted this root, your communications could potentially be silently intercepted by anyone who owned a Cyberoam box, not just the legitimate owners of the network you were using. This would be true whether you were on that network, or elsewhere (e.g. if you went to another location with your phone or laptop). Furthermore, anyone who purchases a Cyberoam box can try and extract the root (they may have physical security in place, but that’s just a speedbump) and then they don’t even need a Cyberoam box to MITM you.

From reading their online docs, this problem seems to also occur with similar devices from Sonicwall (PDF; page 2) and Fortigate. (Thanks to a commenter on the Tor blog for noticing this.) I suspect that many vendors use this insecure configuration by default.

The Cyberoam default root certificate is not trusted by the Mozilla root store – Cyberoam is not a CA – and we do not plan to take action at this time. However, this is another important lesson in the unintended consequences of intentionally breaking the Internet’s security model. Messing with the Internet security infrastructure breaks things, in unexpected and risky ways. Don’t do it.

Suspect Syndication

Sometimes you discover the weirdest things about the Internet via unsuspected routes.

My post about Facebook and email addresses got a lot of pingbacks from around the world. Often, they were syndications, perhaps of dubious legality, of earlier articles. In several cases, the legality was clearly dubious, because the syndicator had gone to some effort to disguise the text. There were four like this one, where, fascinatingly, the text appears to have been run through a system which uses synonyms and other changes to make it not recognisable from a simple web search. Compare the original, from CNN Money (and also my blog, which they are quoting):

Blogger Gervase Markham, one of the first to draw attention to the change, was scathing in his comments on it.

“Facebook silently inserted themselves into the path of formerly-direct unencrypted communications from people who want to email me. In other contexts, this is known as a Man In The Middle (MITM) attack,” he wrote, referring to a tactic hackers use to intercept electronic messages. “What on earth do they think they are playing at?”

with this barely-understandable version:

Blogger Gervase Markham, one of a initial to pull courtesy to a change, was sardonic in his comments upon it.

“Facebook silently extrinsic themselves in to a trail of formerly-direct unencrypted communications from people who wish to email me. In alternative contexts, this is well known as a Man In The Middle (MITM) attack,” he wrote, referring to a tactic hackers make make make make make use of of of of of to prevent electronic messages. “What upon earth do they consider they have been personification at?”

Some of the changes don’t even seem like synonyms – “attention” -> “courtesy”? Note also the words repeated 5 times – looks like they replace “use” with “make use of”, but have run the algorithm over the text more than once!

Here’s another one, which makes heavy use of entities, replacing letters with lookalikes from Cyrillic or simply HTML entities:

Th&#1077 exchange, first uncovered b&#1091 hacker Gervase Markham, means th&#1072t &#1072n&#1091 email post you received through Facebook since Friday h&#1072&#957&#1077 been routed back into the Facebook Post inbox, rather th&#1072n into your email inbox. Annoying? I don’t know. something to &#609&#1077t really angry about? I don’t know — maybe you w&#1077r&#1077 expecting &#1109&#959m&#1077 vastly time sensitive email to come through Facebook. but f&#959r the m&#959&#1109t &#1088&#1072rt, w&#1077’d estimate th&#1072t public are more shocked th&#1072t th&#1077&#1091 h&#1072&#957&#1077 &#1072n @facebook email take up th&#1072n the fact th&#1072t Facebook pulled a switcharoo.

Does that look normal? Here’s the source:

Th&#1077 exchange, first uncovered b&#1091 hacker Gervase Markham, means th&#1072t &#1072n&#1091 email post you received through Facebook since Friday h&#1072&#957&#1077 been routed back into the Facebook Post inbox, rather th&#1072n into your email inbox. Annoying? I don’t know. something to &#609&#1077t really angry about? I don’t know — maybe you w&#1077r&#1077 expecting &#1109&#959m&#1077 vastly time sensitive email to come through Facebook. but f&#959r the m&#959&#1109t &#1088&#1072rt, w&#1077’d estimate th&#1072t public are more shocked th&#1072t th&#1077&#1091 h&#1072&#957&#1077 &#1072n @facebook email take up th&#1072n the fact th&#1072t Facebook pulled a switcharoo.

Can I Get A Witness?

The developer who started the Witness web app has had to bow out of the project. Are there any other Djangonauts/Pythonistas out there who would like to finish the building of something relatively small, self-contained and useful to Mozilla? Here’s a description of the project:

“Witness” will be a web app which provides proof that person A has agreed to legal document X.

There are loads of applications for this:

  • Proof that a Mozilla contributor has agreed to our Committer’s Agreement
  • Proof that someone has agreed to the IPR policy necessary for contributing to a standards body mailing list
  • Proof that someone has agreed to a trademark licence

These things can be done without an app, but it’s dull and tedious for the person doing the paperwork. Much better to get a computer to do it.

It would involve, among other things, playing with Persona/BrowserID. If you are interested, drop me a line and I’ll point you at the code.

How To Make A Decent Password Strength Meter?

This discussion came up in mozilla.dev.identity – how do you make a decent password strength meter? Now it could be that someone’s already done this (links?), but I’ve never been embarrassed about reinventing the wheel, so here are my thoughts.

IMO, most password strength indicators suck. They give a fixed bonus for adding punctuation or numbers or upper-case letters, and you can’t have a strong password until you have several of those categories. Therefore, to take random examples, a lot of them think “correct horse battery staple” is a worse password than “Tr0ub4dor&3”.

Inspired by xkcd, here’s a straw-man proposal for a Unicode password strength meter which avoids some of the obvious flaws, while still not being overly-complex to implement. Note that this is about strength (resistance to brute force attacks), not about memorability or anything else.

  1. Classify every code point by its Unicode script. (The data needed for this is not large, as most scripts are in contiguous ranges.)
  2. For each script used, take the number of commonly-used characters (this would be a predefined lookup table), and add the values together to make an “entropy” value, which is a rough proxy for the size of the character space from which the password’s characters were taken. So e.g. an Arabic numeral is 10, an unaccented Latin letter is 26, an uppercase Latin letter is 26, a Chinese character would be about 20,000.
  3. Multiply the entropy by the password length in characters.
  4. Make sure it’s over a certain threshold, which can vary depending on the application. You might use 300 for web forum membership login, and 1000 for a bank. One could develop recommendations.

e.g.

“Tr0ub4dor&3”:

  26 (lower-case Latin letter)
+ 26 (upper-case Latin letter)
+ 10 (Arabic numeral)
+ 15 (simple punctuation)
= 77

77 * 11 = 847

“correct horse battery staple”:

  26 (lower-case Latin letter)
+ 15 (simple punctuation)
= 41

41 * 28 = 1148

Now, the flaw of this proposal is that the measure assumes all the password characters are independently chosen. Perhaps the way to solve that is to add or multiply a bonus for “script transitions” – letters to punctuation, one alphabet to another alphabet, etc. Because words, the most common case where successive characters are not independent of each other, are most often all one script.

“Tr0ub4dor&3” has 7 such transitions, “correct horse battery staple” has 6. But “intelligentsia”, while being long, has none.

Thoughts?

Facebook Email Follow-up

My post about how Facebook altered my displayed email address to one routed to their servers has garnered a certain amount of attention. I just did an interview with NPR for “All Things Considered”, which I think will be broadcast today.

In the interview, I said that one question this raises is “who controls my online presentation of myself – me or Facebook?”

I was led down this line of thinking because I’d recently read an article by one of the pastors of my church, Tim Chester. He has been blogging about Facebook and about the relationship between our online presentations of ourselves and our true identity. Article 2 in the series is particularly relevant:

Celebrity culture pores over the minutiae of the lives of the rich and famous. Facebook, blogs and Twitter allow us all to be celebrities with our lives on show. It blurs the public and the private. The world becomes my audience. On Facebook you do not have a conversation, you have an audience. Your life takes place on a stage and you are your own playwright, creating or recreating yourself through your words.

If this piques your interest, here are links to the entire series, titled “Will You Be My Facebook Friend?”:

Some of the points Tim makes are other reasons (than privacy) that I am not a heavy user of social media.

Facebook MITMed My Email

I prefer email to social media. I do have a Facebook page, but I don’t post anything there, and I made sure that my primary personal email address, gerv[at]gerv.net, was displayed in the profile so that people could contact me directly.

Today, I happened to visit my Facebook profile, and noticed that they had changed the displayed email address to gerv.markham[at]facebook.com! The old one was still in the database, but it had been hidden. Email to the Facebook address is forwarded by Facebook to the other one, so it ends up in the same place. [Update: I now think this is not correct. The email instead goes to my Facebook inbox, and I don’t get a notification email to say it’s there. Which is, IMO, even worse – they don’t just pass it through their servers on the way to where it would have gone, they keep it, and fail to send me a copy!]

In other words, Facebook silently inserted themselves into the path of formerly-direct unencrypted communications from people who want to email me. In other contexts, this is known as a Man In The Middle (MITM) attack. What on earth do they think they are playing at?

MediaWiki “Help”

MediaWiki’s Help page, at least on the Mozilla Wiki, is far too complex. One of the first topics it covers is the occasional need to do a dummy edit to refresh the internal database caches. I suggest this is unlikely to be uppermost in the mind of most people visiting that page. How to do a link is on the 5th page down on my large monitor, and how to emphasize text is on the 8th page.

Here’s Help:Me, a much simpler page which attempts to show the most important things by example. Do let me know what you think.

Browser Buster II – Add-on Version

Browser Buster, the stress-testing page for Firefox Mobile I mentioned a week or two ago is now an add-on.

You can stress-test Firefox Mobile by visiting http://bit.ly/LH7Kmc , installing the add-on, opening 3 tabs on any web page and then leaving your phone running. Make sure you are on WiFi, and plugged in to power.

Geeky Details

Unfortunately, the Jetpack API for Firefox Mobile is not all there yet, and so I’ve had to implement it in a rather unusual way, using PageMod rather than the Tabs API. The add-on inserts a bit of JS into every page loaded telling it to redirect to a new random URL after 7 seconds.

So this version is not vulnerable to frame-busting scripts, but it is vulnerable to onload modal popups (“Hey! We have an Android app!”) and to pages failing to load entirely. Still, it seems to have better uptime than the iframe-based version. Once the Tabs API is implemented for Jetpack on Firefox Mobile, I can revise it again to be even more robust. It could also now be changed to interact with the page more – clicking links, changing the DOM etc. A good project for someone who sees potential here and wants to take this further.

Top tip: have it running in 3 tabs at once, and keep the tab dropdown open. The thumbnails don’t update (Boo!) but the page titles do, so you can see if it’s got stuck on a page, e.g. “Problem loading page”.

You can enable and disable it via about:addons. Note that because of the way I’ve had to implement it, it makes normal browsing pretty much unusable (“stop redirecting me to random pages!”), so you’ll want to disable it when not testing.

Firefox Mobile’s stability seems to have improved recently; I’ve not seen any crashes with Nightly all morning.

“Witness” Web App: Hackers Wanted

We need a “witness” web app which provides proof that person A has agreed to legal document X.

There are loads of applications for this:

  • Proof that a Mozilla contributor has agreed to our Committer’s Agreement
  • Proof that someone has agreed to the IPR policy necessary for contributing to a standards body mailing list
  • Proof that someone has agreed to a trademark licence

These things can be done without an app, but it’s dull and tedious for the person doing the paperwork. Much better to get a computer to do it.

In its simplest form, the app would just require a Persona login, show you the document, have you click “I Agree” and then store that information, with metadata such as time, IP address, document hash etc., perhaps sending a data bundle off to a timestamping service to prove it couldn’t be falsified later. There would also be a confirmation email sent out to the email account which would allow people to repudiate the agreement within a certain length of time. in case something had gone wrong.

There are loads of potential additional features – extra logging, a mechanism to email everyone to come back if the document is updated, notification of the document uploader when someone signs it, etc. But the basic idea is very simple, and could be really useful.

I asked for help on this at the start of last year, and got one response, but then the person turned out not to have time. Are there any web app hackers out there who would like to build a generally-useful piece of open source software?

Moar Crashes Please

I’ve heard it would be helpful to the Fennec Native team if they had more crash data. So I’ve written the world’s simplest random website loader. Load it up on your phone or tablet and just let it go. It loads a new random page every 10 seconds. Glance at it every 10 minutes and submit any crashes that appear, or hit “Back” if a frame-busting script broke it. You can test Fennec while doing something else! :-)

I’ve been running it on my phone and tablet for an hour and a half, and submitted 2 tablet crashes (one Flash, one in libdvm).

Of course, it may not produce a high crash volume because it doesn’t interact with the page. Ideally, it would be an add-on, so frame-busting wouldn’t affect it, it could dismiss pop-ups, follow links, crash reports would have the correct URL, and perhaps it could even auto-submit crash reports and restart itself. Suggestions for better tools to use would be most welcome.

bugzilla.mozilla.org Now Supports BrowserID

You can now log in to bugzilla.mozilla.org using BrowserID, courtesy of a Bugzilla extension I wrote. Log out and then click the “Login” link in the header and then the orange “Sign in” button to try it.

You can do this – unless, that is, you are a member of certain particularly sensitive groups. While Mozilla has great confidence in the BrowserID technology, it does not have perfect confidence in my coding ;-) Therefore, we are restricting who can log in until we get a little more experience with my extension. Eventually, it’s possible that we might go the other way and require BrowserID for certain sensitive groups, once BrowserID primaries appear with 2-factor authentication. But that’s a little way off yet.

If you visit your permissions page, you can see if you should be able to log in using BrowserID. If you are listed as a member of the “no-browser-id” group, you shouldn’t. Otherwise, you should. The no-browser-id group is currently made up of members of the following groups: admin, bz_sudoers, autoland, generic-assignees, hr, infrasec, legal, and anything with “security” in its name.

Maintaining Multiple Versions of Documentation in a Wiki

Dear Lazyweb,

I know of some software, and it has documentation. I want to be able to maintain this documentation, for the general good of its userbase. At the moment, its documentation is XML files in a VCS, with their own special build procedure with prerequisites. That makes them hard to modify, and as a consequence they are often out of date and certainly not as good as they could be.

Requirement A): I’d like the documentation to be web-editable, because that makes it really easy for anyone to edit quickly, which makes it much more likely the documentation will actually be up-to-date. I want the URL for the “latest version” to always be the same URL.

Requirement B): My software has multiple versions. Once I release a version, I’d like to keep a copy of the documentation in the state that it applies to that version. It may not change much again, but needs to be able to accept bug fixes. However, trunk documentation development must continue. In other words, I need to be able to branch the documentation, check in independently to each branch, and give people URLs to either a branch or the trunk. Each version should have a URL containing the software version number.

Is there any software out there, ideally already in use by the Mozilla project, which can meet both A) and B)? A) is met by all wiki software. B) is met by all version control software. But I haven’t found wiki software with the concept of branches, and I haven’t found a VCS which can display documents prettily and has a web-based interface for editing.

These requirements don’t seem uncommon. Proprietary software solves them. Is there anything open source?

Ladder of Abstraction

This interactive essay teaches about system design using a “ladder of abstraction” paradigm. Two things about it are notable.

The first is the fact that his interactive teaching simulations are built using the web platform, and that’s awesome.

The second is the point he makes in the first appendix:

If a language requires a “compile” or “refresh” to show the results of a change, it even denies us interactive control. Some languages are marketed as “sketchbooks”, but a real sketching environment would, at the very least, offer basic interactive adjustment … .

Perhaps someday this will change. Perhaps IDE makers will focus on dynamic exploration instead of static analysis, rich visualization instead of line debugging. Perhaps language theorists will stop messing around with arrows and dependent types, and start inventing languages suitable for interactive development and discovery.

Until that glorious day, it is our sad but unavoidable responsibility as system designers to build our own tools.

When creating, real-time feedback is key. The interpreted nature of JavaScript, HTML and CSS means we are in a great place to build creative systems which work like this for the web platform. Some of our developer tools already built into Firefox, and things like Hackasaurus, are there or moving this way.