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.

Opening the Mobile Web

Jean-Yves Perrier has published the plan for prising open the mobile web – evangelism of individual sites and frameworks is a big component, along with spec work and technical changes to Firefox Mobile.

I don’t think I exaggerate when I say that the tasks on that page are some of the highest priority non-coding tasks we have at Mozilla. A WebKit-only web is not much better in the long run than an IE-only web. If you have time to help, please pitch in. Contact Jean-Yves if you aren’t sure where to start.

Particularly if you are someone who doesn’t want Firefox to implement webkit-prefixed properties: working on these tasks is how you can avoid us having to do it, or reduce the amount of it we have to do.

Disabling Private Browsing Mode in Firefox

This subject has been discussed before on this blog. I support the right of parents to review what their children have been looking at, both morally in terms of my understanding of the way God has given parents authority over their children, and for the pragmatic reason that it’s likely that, with such an ability, they will give their children greater access to the web than they would otherwise have. So I think it should be possible to disable PBM. However, I’m not really interested in having that discussion again – this post is about the best way to do it, not whether it’s a good idea.

William Wood has written a program, “Incognito Gone”, which turns off private browsing or the equivalent in Chrome, IE and Firefox. However, his page says:

Note: While Incognito Gone completely removes the private browsing function from Google Chrome and Internet Explorer, in Mozilla Firefox only the option for private browsing is removed. In other words, if you know the keyboard shortcut for private browsing in Firefox, it is still available.

Technically, Chrome and IE support this disabling using a registry option and, if your Windows computer is set up correctly with user accounts for each person, then this is an effective method, and it’s what William’s program uses. For Firefox, he just drops in a userChrome.css to hide the menu item, which is clearly suboptimal.

Is it possible to have an “uninstallable extension”, under the same conditions (user account separation) as IE and Chrome have “unchangeable registry entries”? If so, that seems like it would provide parity with Chrome and IE.

If we added a private browsing pref, does “pref locking” still work, and could that be used? There are docs about it on the web, but no clear info as to whether it currently works and can be done in a non-defeatable manner. Are any EWG participants using it?