blakeross.com blakeross.com
September 1, 2005

ZDnet reports that the FBI is having trouble with Mork, the god-awful database we use to store history in Firefox 1.0:

“Firefox and Opera store information on typed URLs in a different file than IE does and the files are somewhat tough to decipher, Lewis said. He showed his students–mostly law enforcement agents and private investigators–how to do it.”

Hey, we’ve had to deal with it for years! Oh, and as Vlad says: “they’re going to be unhappy when we replace it with encrypted sqlite.”

When I tell people I lost my innocence at 14, they think I’m talking dirty. Really, I just lost it to Mork.

8 Responses to “SpreadMork”

  1. Doug Wright Says:

    heh

  2. mardoen Says:

    Wuaha — man I hope you’ll actually do that. (Couldn’t find out if the Vlad comment was banter or describes an actual plan.)

    Up until now it didn’t occur to me that Mork had this advantage over other formats. And although no agent of any country is interested in _my_ browser history, I love the thought of them opening files in their copy of X-Ways Forensics, only to be greeted with random garbage.

    Serves them right. Profile data is to be read by the user agent, not the user ;)

  3. Simplex Says:

    A history/explanation of Mork from former Netscape employee jwz:

    And Now, The Ugly Truth Laid Bare:

    In Netscape Navigator 1.0 through 4.0, the history.db file was just a Berkeley DBM file. You could trivially bind to it from Perl, and pull out the URLs and last-access time. In Mozilla, this has been replaced with a “Mork” database for which no tools exist.

    Let me make it clear that McCusker is a complete barking lunatic. This is just about the stupidest file format I’ve ever seen.

    http://www.mozilla.org/mailnews/arch/mork/primer.txt
    http://jwz.livejournal.com/312657.html
    http://www.jwz.org/doc/mailsum.html
    http://bugzilla.mozilla.org/show_bug.cgi?id=241438

    In brief, let’s count its sins:

    - Two different numerical namespaces that overlap.
    - It can’t decide what kind of character-quoting syntax to use: Backslash? Hex encoding with dollar-sign?
    - C++ line comments are allowed sometimes, but sometimes // is just a pair of characters in a URL.
    - It goes to all this serious compression effort (two different string-interning hash tables) and then writes out Unicode strings without using UTF-8: writes out the unpacked wchar_t characters!
    - Worse, it hex-encodes each wchar_t with a 3-byte encoding, meaning the file size will be 3x or 6x (depending on whether whchar_t is 2 bytes or 4 bytes.)

    - It masquerades as a “textual” file format when in fact it’s justanother binary-blob file, except that it represents all its magic numbers in ASCII. It’s not human-readable, it’s not hand-editable, so the only benefit there is to the fact that it uses short lines and doesn’t use binary characters is that it makes the file bigger. Oh wait, my mistake, that isn’t actually a benefit at all.

    Pure comedy.

  4. Ricco Says:

    I don’t get it… why adopt something so stupid instead of making your own brand spanking new file-format using for instance XML?

  5. mardoen Says:

    I believe I read a post in the Firefox forums a couple of years ago that said Mork’s main raison d’être was speed improvements over more traditional formats (esp. XML-based formats).

    Thank god we have SQLite now. (It’s amazing how quickly SQLite got embraced by a wide variety of software projects. Even by Apple!)

  6. Jackson Peebles Says:

    If this database is so awful, why don’t you keep the old database but switch all new users to a different one? That sounds like a good idea to me, Blake, but you are the genius! (By the way, I am doing a biography on you in computer class, could you give me some facts?)

  7. jeffdav Says:

    I think there is some unwritten rule of web browser design that the history store is always a poorly designed hack. I have never had any interaction with Mork; I had not heard of it before today. But I do maintain IE’s history code and all I can say is, brother, I feel your pain.

  8. Christopher S. Charabaruk Says:

    jeffdav: If that’s the rule, Safari is the exception. Simple, understandable XML for history.

Leave a Reply

-->