Slashdot Mirror


How a Google Headhunter's E-Mail Revealed Massive Misuse of DKIM

concealment writes with a tale of how an email sent to a mathematician led to him discovering that dozens of high profile companies were using easily crackable keys to authenticate mail sent from their domains. From the article: "The problem lay with the DKIM key (DomainKeys Identified Mail) Google used for its google.com e-mails. DKIM involves a cryptographic key that domains use to sign e-mail originating from them – or passing through them – to validate to a recipient that the header information on an e-mail is correct and that the correspondence indeed came from the stated domain. When e-mail arrives at its destination, the receiving server can look up the public key through the sender's DNS records and verify the validity of the signature. Harris wasn't interested in the job at Google, but he decided to crack the key and send an e-mail to Google founders Brin and Page, as each other, just to show them that he was onto their game."

32 of 115 comments (clear)

  1. Vote for me by Anonymous Coward · · Score: 4, Funny

    This is Obama, please vote for me. This email is from me, you can verify it using DKIM public keys.

    Regards
    Romney

    1. Re:Vote for me by Anne+Thwacks · · Score: 2

      I think that would be a porcine doll.

      --
      Sent from my ASR33 using ASCII
  2. Re:C'mon.. by chill · · Score: 5, Funny

    He is clearly lying or been living too much outside real world..

    He's a professional mathematician. That's a given.

    --
    Learning HOW to think is more important than learning WHAT to think.
  3. Re:This just in... by 1s44c · · Score: 2

    Email wasn't broken. DKIM was. Or rather DKIM wasn't really broken, just being misused by Google.

  4. There was no misuse by hawguy · · Score: 4, Insightful

    This was not a misuse of DKIM, or perhaps it was his own misuse in that he thinks DKIM validates the sender of an email. All it does is validate that the email originated from Google's mail servers, but it doesn't neccessarily mean that the address in the From: header wasn't spoofed before it was signed.

    In any case, he found that Google (and others) are using an easily cracked 512 bit key, which they silently fixed with a 1024 bit key after he reported it to them by spoofing an email to appear as though it originated at Google.

    There was no misuse, 512 bit keys are allowable under the DKIM spec, though they aren't recommended for long-lived keys.

    1. Re:There was no misuse by SSpade · · Score: 2

      It's more than "aren't recommended".

      RFC6376: "Signers MUST use RSA keys of at least 1024 bits for long-lived keys."

      Given Google were using a long-lived key, they were violating a MUST provision in the DKIM spec. (Pedantically, that means they weren't sending DKIM compliant mail at all).

  5. The Reality by MightyMartian · · Score: 4, Insightful

    So the reality is that, on top of being useless as an anti-spam mechanism, it now turns out to be even worse, and in fact vulnerable to malicious attacks. In other words, it's useless and uselesser.

    I was heavily involved in a lot of the discussions surrounding SPF, DKIM and related "solutions" back in the early 2000s, and about the most that we could say about these "solutions" was that you could add a positive number to the score of an email in a weighting system if things checked out, but other than that, there was little to recommend them.

    --
    The world's burning. Moped Jesus spotted on I50. Details at 11.
    1. Re:The Reality by Sentrion · · Score: 2

      I wonder how many convictions and court judgments relied solely on DKIM evidence that an email came from a defendant, all other evidence being circumstantial. I wonder what potential exist for such decisions to be overturned.

    2. Re:The Reality by Medievalist · · Score: 3, Insightful

      Serious question - What does DKIM do that SPF doesn't?

      DKIM is intended to allow mail sent through any server to be shown to be originally from a specific domain, thus preventing spoofing which is the basis of most spamming. SPF just allows server(s) to be identified as valid mailers for a domain, it doesn't work if you forward mail through other undesignated systems (which is still pretty significant, and covers most legitimate use cases).

      If you're not checking SPFv1 on incoming mail, you're not a competent email admin. If you're not publishing SPFv1 for your domain you're not a competent DNS admin. This is just basic stuff nowadays; claiming otherwise is like claiming surgeons don't need to know about anatomy.

      DKIM requires significant effort by comparison to SPF, and you can still be forgiven (for a little while) for not checking it or generating it.

    3. Re:The Reality by XanC · · Score: 2

      Except SPF is broken by design and shouldn't be used nor its use encouraged, ever.

    4. Re:The Reality by timothyf · · Score: 2

      In a nutshell:
      In DKIM
      -Email provider sets up DNS records with a public DKIM key.
      -Email provider's MTA signs valid outgoing email with the private key.
      -Recipient MTAs can verify the signature of incoming mail from the email provider with the public key and use this when classifying the message.
      -The MTA has to receive the message contents to verify the signature.

      In SPF
      -Email provider sets up DNS TXT records that specify which hosts are allowed to send mail for a domain.
      -Email recipient verifies that the mail is received from one of those hosts and the pass/fail decision is used when classifying the message.
      -The MTA can reject the message if the check fails during the SMTP HELO phase without receiving the entire message, if desired.

      https://en.wikipedia.org/wiki/DKIM
      https://en.wikipedia.org/wiki/Sender_Policy_Framework

    5. Re:The Reality by Medievalist · · Score: 2

      If you are doing mail forwarding or certain kinds of mailing list paradigms, you can have difficulties with SPF - you'll have to go straight to DKIM or change the way you use mail.

      However, the absolute statement the prior poster made is the cry of a butthurt spammer - SPF keeps him from spoofing your address, so it's hurting his v14gr/-\ sales. Spammers hate SPF more than taxes... it's so trivially easy to implement that it's a real threat to their business model. DKIM's even worse for them, but it's also harder to do. You can set up SPF in 15 minutes if you've done it before.

    6. Re:The Reality by MillerHighLife21 · · Score: 2

      And that's why they created DMARC. DMARC allows you to specify exactly how mail servers should treat your SPF and DKIM policies. Additionally, you'll get reports from the providers processing it what the origin IPs claiming to deliver email from you are and whether or not they were allowed.

      There's also one little note that the entire linked "why not spf" article is based on too...the DMARC reports also include whether or not the mail was forwarded so that mail servers know how to handle it.

      The three techniques combined have been extremely effective in phishing spoofing against our domain, which was very heavy until we implemented all three. We've also been tracking deliverability with no issues.

      http://www.dmarc.org/

      --
      "Don't teach a man to fish, feed yourself. He's a grown man. Fishing's not that hard." - Ron Swanson
  6. Re:This just in... by NatasRevol · · Score: 3, Insightful

    If it's easy to misuse, doesn't that make it broken?

    --
    There are two types of people in the world: Those who crave closure
  7. Sigh by EdwinFreed · · Score: 5, Insightful

    Shame on Google for using a weak key, but also shame on this article for being more than a little hyperbolic.

    If you, you know, actually read the standard, or even the Wikipedia page, you'll see that DKIM is not intended to be used as a signature mechanism in the same way as S/MIME or PGP. Rather, it's a means to assert responsibility for sending the message, it's done at the domain rather than user level, and verification results are intended to be used for message filtering, not for asserting that so-and-so actually signed the message.

    Sure, the underlying technology is based on hashes, signatures, signature verification, and so on but that's because there's no other way to do it. The fact that DKIM allows for the application of relaxed interpretation of both message header and body data kinda tells you it's not intended to be used to provide an absolute assurance that what you got is authentic in every way.

    DKIM is also not intended to be the ultimate source of information for filtering. Rather, DKIM results are supposed to be combined with other metrics to form an overall assessment of message validity. And that's a very good thing, since I get all sorts of spammy stuff that makes it through Google, including getting a legitimate DKIN signature attached. Other filtering mechanisms are needed to block such crap.

    All that said, it's very disappointing to see yet another case where Google has seen fit to play fast and loose with standards. This is happening much too often.

  8. Re:This just in... by clarkn0va · · Score: 2

    If I fly an airplane into a building, does that mean the airplane's design is broken?

    --
    I am literally 3000 tokens away from the chaotic crossbow --Stephen
  9. Re:This just in... by mlts · · Score: 2

    The core E-mail protocol itself is supposed to be a brain-dead simple protocol that almost any machine can understand, thus the "S" in SMTP.

    It is the additions which are used by the MTAs to allow who can and cannot connect and relay, as well as MUAs to figure out what to do with incoming messages.

    Realistically, the ideal for verifying authentication would be an OpenPGP plugin and a far-reaching WoT that each user maintains. However, because certs and having domains sign outgoing mail is "good enough", that has become the standard these days.

  10. Re:This just in... by Obfuscant · · Score: 4, Informative

    If it's easy to misuse, doesn't that make it broken?

    No.

    If I convince ignorant people that PGP signatures prove that they've actually won $47,325,443 in the Nigerian lottery, and all they need to do is send their account details so I can deposit their winnings, is PGP broken?

    This wasn't even a true misuse of DKIM. It was use of a 512 bit key.

    Something that many people seem to forget is that the strength of the security should be matched against the risk and costs of being broken. If I'm sending you a message that says "meet me at the corner of 5th and Smith St in five minutes", and it takes someone who intercepts the message an hour to break it, then the encryption has done its job just fine. By the time they break it, we will no longer be at 5h and Smith St, and they will have had no time to set up surveillance.

    Given the intended use of DKIM, 512 bits is plenty.

  11. Re:This just in... by CaptainJeff · · Score: 5, Insightful

    If the airplane's design allows you AS A REGULAR PASSENGER to do so, then yes.

  12. Re:"onto their game"? by malakai · · Score: 2

    It's a horrible article. It's really trying to make out like it was some cloak and dagger, crypto-cracking fu used by this 'mathmatician' against the founders of Google. He mentions ( many times, like The Lady Doth Protest Too Much, methinks... ) that he thought it was an elaborate test. I read his take on this to be a defensive argument, in case they choose to go after him for spoofing e-mails. Which is what he did.

  13. Vulnerability Note VU#268267 by DERoss · · Score: 4, Informative

    This problem has been reported by the US-CERT (part of the US Department of Homeland Security [Insecurity?]) at http://www.kb.cert.org/vuls/id/268267. See that link for an authoritative report on the meaning of this problem and how to avoid it.

  14. Re:"onto their game"? by squiggleslash · · Score: 2

    From the article, yes, it appears the mathematician thought, strangely, that he was being sent some kind of test, by Google, because the original recruitment email to him didn't appear to be particularly relevent to his skillset.

    Yeah, exactly. Like a lot of very (genuinely) smart people, not very smart!

    --
    You are not alone. This is not normal. None of this is normal.
  15. That's what I would think as well! by SoTerrified · · Score: 2

    From the article, the line:
    Harris thought there was no way Google would be so careless, so he concluded it must be a sly recruiting test to see if job applicants would spot the vulnerability.

    That's exactly how I would think.

  16. Re:This just in... by Maximum+Prophet · · Score: 2

    And how does an airplane distinguish between pilots and "regular passengers" so that only the former can fly them?

    The pilots are up front, and the regular passengers sit behind. There's a wall between the two sets of people.

    --
    All ideas^H^H^H^H^Hprocesses in this post are Patent Pending. (as well as the process of patenting all postings)
  17. Re:This just in... by Anonymous Coward · · Score: 2, Interesting

    AES is synchrounous, same (secret) key used for encrypting and decrypting. Those are generally much harder to break than public key cryptos (with the same key-size), but also not usable for the same things.

  18. Re:This just in... by ngc3242 · · Score: 4, Informative

    To add more detail to the AC's response.

    AES is based on a subsitution-permutation network.
    DKIM is based on the RSA signature algorithm which relies on the difficulty of factoring large integers.
    Elliptic curve public key cryptography is based on the difficulty of solving a discrete logarithm problem.

    The difference in the size of keys between one type of algorithm or another is an expression of the difficulty in solving the underlying problem. Factoring a large integer of X bits (RSA) is relatively easy compared to working through the substitutions and permuations of X bits of AES.

    The link below provides a guideline for comparing the key sizes of AES, EC, RSA/DH.
    http://www.nsa.gov/business/programs/elliptic_curve.shtml

  19. Re:This just in... by SSpade · · Score: 4, Informative

    The DKIM spec itself (RFC6376) says: "Signers MUST use RSA keys of at least 1024 bits for long-lived keys."

    It's pretty unequivocal. Google just misconfigured their mailserver.

  20. Re:This just in... by psmears · · Score: 2

    AES is synchrounous

    I think you meant "symmetric" :-)

  21. Re:This just in... by VortexCortex · · Score: 2

    And how does an airplane distinguish between pilots and "regular passengers" so that only the former can fly them?

    The pilots are up front, and the regular passengers sit behind. There's a wall between the two sets of people.

    OMFG!!!1! HUNDREDS of Pilots!? Only TWO passengers?! What the --Oh, never mind, "behind" is that way... For a second there I had an signed integer overflow in the velocity vector and thought we were just flying backwards, which means that behind and forwa-- Oh, never mind. Sorry about that, I'll try to be a good auto-pilot from here on out.

    Boy, the sky sure is blue today... And shiny. I think I can see my reflectioOOOOOOO!!!!!

  22. Re:This just in... by Rich0 · · Score: 2

    Others gave good answers, but I'd just take it a step further - you can't really directly compare key lengths for different algorithms.

    How long does it take you to solve 100 math problems by hand? Well, when I was in elementary school I was expected to do it in 5 minutes, but those were single-digit add/subtract/multiple/divide problems.

    If I asked you to calculate the log of 10 10-digit numbers by hand it would take you a LOT longer than 5 minutes, though a computer could do this quickly.

    If I asked you to factor a single number 100 digits long it would take an awfully long time even for a computer, though it would be in the realm of possibility.

    Different algorithms use different math, so keys need to be different lengths to be secure. These algorithms are chosen for many reasons, and a shorter key length is only one of them. In many applications it might make more sense to just make all the keys 10x longer if it means that you can do the math on a cheaper and lower power chip. In this particular case, having to use a really long key is worth it because the design of this particular type of crypto system allows n people to communicate with each other with a total of only 2n keys, and not 2^n.

  23. Re:This just in... by swillden · · Score: 5, Insightful

    The DKIM spec itself (RFC6376) says: "Signers MUST use RSA keys of at least 1024 bits for long-lived keys."

    Keep in mind that RFC 6376 was issued in September of 2011. Prior versions did allow 512-bit keys, though they cautioned against them.

    It's pretty unequivocal. Google just misconfigured their mailserver.

    More likely, I think, is that Google failed to reconfigure their server. When Google started using DKIM, cracking 512-bit keys was significantly harder than it is now. The change is less due to increases in computing power (though that has helped) than it is to the availability of cloud-based compute clusters. Granted that it was always a little risky to use such small keys, it was much more reasonable than it is today.

    So my guess is that it went down like this: A few years ago when Google implemented DKIM someone looked at RFC 4871's discussion of key sizes, which says:

    o Larger keys impose higher CPU costs to verify and sign email

    o Keys can be replaced on a regular basis, thus their lifetime can be relatively short

    o The security goals of this specification are modest compared to typical goals of other systems that employ digital signatures

    ... and thought "yeah, we can use 512-bit keys and change them occasionally, that will provide higher performance for less CPU load, and as the RFC says the security goals here really aren't that high". I imagine that the decision to implement DKIM at all may have been a tad controversial given the additional load it was going to place on the servers, so that 512-bit key usage may even have been an important design point. Then the "change them occasionally" bit got dropped on the floor.

    Fast-forward a few years, the problem is discovered and fixed -- but this time the engineers decided to make sure it doesn't happen again and jumped to 2048-bit keys even if it required provisioning more capacity.

    (Disclaimer: I work for Google, and do cryptographic security stuff for Google, but I don't have any more information than the rest of you about how all of this happened. The above is pure speculation based on my 15 years as a security consultant before joining Google. I saw lots of stuff just like it from the few companies I worked with who were actually quite good about security. And even more insanely stupid stuff from all the rest.)

    --
    Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
  24. Re:This just in... by SSpade · · Score: 3, Insightful

    Yup, all of that is likely what happened.

    A critical part of DKIM is selector-based key rotation (as even the 2048 bit key won't help you at all when an ex-employee or a contractor walks off with the private key, while key rotation will reduce the window of exposure from that sort of event). Google aren't the only ones to have missed that.

    (Many of the original - and current - examples of how to set up DKIM suggest using a date as part of the selector, so as to make it clear that the key was supposed to be fairly transient. That leads to the lovely situation that you can look at a lot of peoples DKIM setups and see that they created their key pair once, several years ago, using the current date and haven't changed it since - their failure to rotate keys is self-documenting.)

    There are many reasons why DKIM doesn't need to be "really strong crypto" - it's intended just for someone to assert that they're responsible for an email message, that they're prepared to accept complaints about the mail they send, and that you should pay attention to their previous behaviour when deciding whether or not to deliver a message. Stealing someones DKIM private key lets you piggy back on their good reputation to get spam or phishing emails into an inbox rather than a spam folder for a short time period, and that's about it. It's nowhere near as high value a target as anything like TLS certificates.

    Googles reputation is certainly worth more than the estimated $75 it would cost to crack their short key, so it's good they've fixed that. And even though much of the media coverage of this has been tech-tabloid drivel it's a good thing if it gets other companies to look at key length and rotation frequency.

    (Disclaimer: I've been working with the DKIM spec since the early days of DomainKeys. http://dkimcore.org/ is me.)