Slashdot Mirror


Null Character Hack Allows SSL Spoofing

eldavojohn writes "Two researchers, Dan Kaminsky and Moxie Marlinspike, came up with exact same way to fake being a popular website with authentication from a certificate authority. Wired has the details: 'When an attacker who owns his own domain — badguy.com — requests a certificate from the CA, the CA, using contact information from Whois records, sends him an email asking to confirm his ownership of the site. But an attacker can also request a certificate for a subdomain of his site, such as Paypal.com\0.badguy.com, using the null character \0 in the URL. The CA will issue the certificate for a domain like PayPal.com\0.badguy.com because the hacker legitimately owns the root domain badguy.com. Then, due to a flaw found in the way SSL is implemented in many browsers, Firefox and others theoretically can be fooled into reading his certificate as if it were one that came from the authentic PayPal site. Basically when these vulnerable browsers check the domain name contained in the attacker's certificate, they stop reading any characters that follow the "\0 in the name.'"

280 comments

  1. \0wned by Hatta · · Score: 4, Funny

    \0\0ps.

    --
    Give me Classic Slashdot or give me death!
    1. Re:\0wned by Lord+Fury · · Score: 5, Funny

      I don't get it, you didn't post anything.

    2. Re:\0wned by LucidBeast · · Score: 5, Funny

      I just came to say Moxie Marlinspike is just about the coolest name I've ever seen...

    3. Re:\0wned by Captain+Splendid · · Score: 1

      No kidding, Charles Dickens is kicking himself for missing that one.

      --
      Linux, you magnificent bastard, I read the fucking manual!
    4. Re:\0wned by Important+Remark · · Score: 0, Redundant

      The most important thing to know is: when you put \0

    5. Re:\0wned by gEvil+(beta) · · Score: 0, Redundant

      Yeah, I like that name. It's got zazz.

      --
      This guy's the limit!
    6. Re:\0wned by Anonymous Coward · · Score: 1, Funny

      Better than Moxie CrimeFighter (daughter of Penn Jillette)?

      Or, given the subject, Robert'); DROP TABLE Students; -- (aka Little Bobby Tables)...

    7. Re:\0wned by Anonymous Coward · · Score: 0

      nice

    8. Re:\0wned by Anonymous Coward · · Score: 1, Informative

      Of course, you know that Moxie is a guy....

    9. Re:\0wned by Anonymous Coward · · Score: 0

      Yeah. And?

    10. Re:\0wned by bytesex · · Score: 1

      No, you should have said: The most import thing to know is\0

      That's even better than NO CARR\0

      I'll stop now.

      --
      Religion is what happens when nature strikes and groupthink goes wrong.
    11. Re:\0wned by red_dragon · · Score: 1

      I read that as \0/ops and imagined hundreds of little stick men throwing their hands in the air. Maybe I should stop reading XKCD for a while.

      --
      In Soviet Russia, Jesus asks: "What Would You Do?"
    12. Re:\0wned by sconeu · · Score: 1

      Don't you mean it's got Moxie?

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    13. Re:\0wned by Anonymous Coward · · Score: 0

      I just came to say Moxie Marlinspike is just about the coolest name I've ever seen...

      That's a good one, but here's my favorite:

      http://en.wikipedia.org/wiki/Thurl_Ravenscroft

    14. Re:\0wned by Anonymous Coward · · Score: 0

      Why Jethro, that's slash naught, slash naught pp
      Thanks Uncle Jed.

    15. Re:\0wned by Hurricane78 · · Score: 1

      You mean as cool as "Oberst Sturmhart Eisenkeil"? (Colonel Stormhard Ironwedge.)
      That's a real name of a real guy here in Germany. He actually works with a guy, whose last same is "Killermann".

      Too bad he's no evil overlord though. :/

      --
      Any sufficiently advanced intelligence is indistinguishable from stupidity.
    16. Re:\0wned by bar-agent · · Score: 1

      Hey, nobody's perfect.

      --
      i'd hit it so hard, if you pulled me out you'd be the king of britain [bash.org]
    17. Re:\0wned by Anonymous Coward · · Score: 0

      Stewie: Brian, please say over when you've finished talking. Over.
      Brian: What? Over.
      Stewie: Do you see the wire yet? Over.
      Brian: No.
      Stewie: No... what? Over.
      Brian: No. Over.
      Stewie: Okay, I'm going to start feeding it through. Over.
      Brian: Wait, if you haven't started feeding it, why'd you ask me if I could see it?
      Stewie: Didn't copy that. Over.
      Brian: I said why'd you ask me if I could see it, if you haven't started feeding it? Over.
      Stewie: Oh, that's better. I can hear you now. Over. Do you see it yet? Over.
      Brian: You know,you're a jackass. For the record, I don't want to hang out with you anymore when this is over.
      Stewie: When this is what, Brian? Over.
      Brian: I said I don't want to hang out with you anymore - when this is over.
      Stewie: When this is what? You've got to finish your sentence. Over.
      Brian: That's it. My sentence is over.
      Stewie: Your sentence is what, Brian? Over.
      Brian: My sentence is... Wait a minute. I have to say "over" even if the sentence ends with the word "over"?
      Stewie: Ends with the word what, Brian? Over.

    18. Re:\0wned by TheCabal · · Score: 1

      I saw his presentation at Black Hat. He was easily one of the better speakers there.

    19. Re:\0wned by Anonymous Coward · · Score: 0

      I know the guy, he lives up to the name...

    20. Re:\0wned by treeves · · Score: 1

      Ironwedge?
      Evil dictator or golf club?

      --
      ...the future crusty old bastards are already drinking the Kool-Aid.
  2. Are CA's that stupid? by Anonymous Coward · · Score: 1, Interesting

    Would a CA really grant a certificate for paypal\0.badguy.com ?

    1. Re:Are CA's that stupid? by graphicartist82 · · Score: 4, Insightful

      The lower-cost automated ones don't care. It's all handled by software; at no point in the process (on the CA side) is a human involved. And I'm betting that if the browsers aren't catching it, neither are the CAs.

    2. Re:Are CA's that stupid? by OrangeTide · · Score: 5, Insightful

      CAs should be fixed to not allow garbage in the domain. \0 isn't a legal character in DNS protocol, so why should anyone be allowed to register a domain certificate with something that is not allowed.

      I miss pascal strings, where the first byte was the length of the string. It had lots of cool advantages in situations like this over C's null terminated strings.

      --
      “Common sense is not so common.” — Voltaire
    3. Re:Are CA's that stupid? by Spad · · Score: 4, Insightful

      Most CAs will grant you a certificate for anything if you pay them the going rate.

    4. Re:Are CA's that stupid? by Joce640k · · Score: 2, Insightful

      Come over to C++ - we have it all!

      --
      No sig today...
    5. Re:Are CA's that stupid? by Anonymous Coward · · Score: 0

      By which you mean limiting all strings to 256 characters? Or needing a dedicated string API to keep the length synchronized with the actual string?

    6. Re:Are CA's that stupid? by Anonymous Coward · · Score: 0

      Which translates to: we shouldn't trust CAs anymore.

    7. Re:Are CA's that stupid? by Korin43 · · Score: 1

      One byte? "256 characters is all anyone will ever need!"

    8. Re:Are CA's that stupid? by Onymous+Coward · · Score: 3, Informative

      \0 isn't a legal character in DNS protocol

      Say, that's a pretty good idea. Start by limiting the input to DNS-valid characters.

      Geez.

      For anyone who thinks "Well, I guess there might be some bad CAs out there," please keep in mind that it only requires one of the CAs (or their delegates) that your browser recognizes to make a mistake and you're hosed. Now go look at how many CAs are listed in your browser.

      Damnit, it's time to flog this again:

      Every time this topic comes around I feel like I should share this thing I've run across:
        Perspectives.

      Basically, "network notaries". Decentralization of (a kind of) authentication.

      This is one thing that makes self-signed certs viable for a popular audience.

    9. Re:Are CA's that stupid? by EkriirkE · · Score: 1

      Wait, you trusted them in the first place?

      --
      from 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
      to 45 2F 6E 40 3C DF 10 71 4E 41 DF AA 25 7D 31 3F
    10. Re:Are CA's that stupid? by bluefoxlucid · · Score: 1

      I miss pascal strings, where the first byte was the length of the string. It had lots of cool advantages in situations like this over C's null terminated strings.

      It's called an asciiz string and the CPU has instructions to handle them specifically in many cases. It's a very primitive data structure.

    11. Re:Are CA's that stupid? by CarpetShark · · Score: 1, Insightful

      Would a CA really grant a certificate for paypal\0.badguy.com?

      Cheap certificate services are automated, so yes.

      The question is... why in hell is firefox treating strings from the net as if they're already escaped?

    12. Re:Are CA's that stupid? by Anonymous Coward · · Score: 0

      You really don't get it do you. Reread TFS.

    13. Re:Are CA's that stupid? by Brian+Gordon · · Score: 1

      Maybe it's mod 256

    14. Re:Are CA's that stupid? by CarpetShark · · Score: 1

      CAs should be fixed to not allow garbage in the domain. \0 isn't a legal character in DNS protocol

      If it's not allowed in DNS protocol (which wouldn't surprise me, unless punicode-escaped), then primarily, it is the client's job to defend against it. Even if all legitimate DNS information sources are checked, the client shouldn't assume that the next DNS request will go to or be replied to from a real server.

    15. Re:Are CA's that stupid? by Brian+Gordon · · Score: 1

      I think it's the actual null character, not the string backslash-zero

    16. Re:Are CA's that stupid? by CarpetShark · · Score: 1

      Ah, yeah, I guess you're right. Misleading article :/

    17. Re:Are CA's that stupid? by cnettel · · Score: 1

      But this \0-terminated string is never sent to DNS. It's rather that, at some point, the actual domain of the certificate is retrieved. That is compared against the domain you think you are visiting. And behold, you can spoof any domain. However, for this to be succesful, you should poison the DNS in some way, as well.

    18. Re:Are CA's that stupid? by clone53421 · · Score: 2, Insightful

      Well, it did say "the null character \0". That seems pretty obvious. It's the null character, and we're calling it \0 because it's unprintable.

      --
      Alexander Peter Kristopeit bought his basement from his mommy for one dollar.
    19. Re:Are CA's that stupid? by Vectronic · · Score: 1

      Whoa buddy, keep your supersized text on the DL man...

      Psst, Editors... someone should fix that code/ability before we have huge

      Goatse

    20. Re:Are CA's that stupid? by Anonymous Coward · · Score: 0

      This is Slashdot - we don't read TFS any more often than we read TFA.

    21. Re:Are CA's that stupid? by TemporalBeing · · Score: 1

      CAs should be fixed to not allow garbage in the domain. \0 isn't a legal character in DNS protocol

      If it's not allowed in DNS protocol (which wouldn't surprise me, unless punicode-escaped), then primarily, it is the client's job to defend against it. Even if all legitimate DNS information sources are checked, the client shouldn't assume that the next DNS request will go to or be replied to from a real server.

      The problem is - how would Firefox or someone other client-side check that the cert is invalid in that sense since you check then length and will get the length reported based on the null terminator. Now if the cert had something in it to tell you, then that could provide a method of checking, but I doubt it has something of that nature in there; and this would not be a simple thing to do on the client side (e.g. Firefox, IE, Opera, etc.)

      Honest, this goes to show the CA's software is broken - it should catch this by trying to issue the domain against what the client software would try to verify - e.g. paypal.com\0.badguy.com -> paypal.com - which of course would immediately defeat the whole attack.

      --
      Truth is like the sun. You can shut it out for a time, but it ain't goin' away. - Elvis Presley (source: imdb.com)
    22. Re:Are CA's that stupid? by krkhan · · Score: 1

      The lower-cost automated ones don't care. It's all handled by software; at no point in the process (on the CA side) is a human involved. And I'm betting that if the browsers aren't catching it, neither are the CAs.

      Somehow all the CA softwares are reading beyond the null whereas most of the browsers stop doing so?

    23. Re:Are CA's that stupid? by Anonymous Coward · · Score: 0

      I read TFS long before I posted.

      1. FTFA: "Each showed how an attacker can legitimately obtain a certificate with a special character in the domain name that would fool nearly all popular browsers into believing an attacker is whichever site he wants to be."

      2. CAs have long been known to let people register and sign any bogus names. And generally only track down the bullshit after they get some complaints.

    24. Re:Are CA's that stupid? by khellendros1984 · · Score: 1

      No, I don't think Pascal had any string termination; just the length of the string as the first byte. If it was mod 256, how would you know how far to go?

      --
      It is pitch black. You are likely to be eaten by a grue.
    25. Re:Are CA's that stupid? by FreezerJam · · Score: 1

      No, they're not that stupid.

      But the standards around this aren't exactly models of clarity.

      In general, *hostnames* must be characters. And DNS entries that point to websites should also conform to hostnames. But DNS strings can be *anything*. Yes, they can be arbitrary strings of bytes, as long as the top-level domain is valid. The null is legal. Keep in mind that the CA is signing a DNS entry, which may be used for something different than web security.

      The problem, as actually stated in the summary, is in the clients. They think they have a character string - they don't. They have a byte buffer of a certain length, and the clients should not be using null-termination based software to process the buffer.

    26. Re:Are CA's that stupid? by dkf · · Score: 1

      One byte? "256 characters is all anyone will ever need!"

      Original Pascal strings were indeed lame that way, but don't diss the idea of counted strings; they're actually faster (more efficient copies) and safer (easier buffer management). You do need to use a size_t for the length though.

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    27. Re:Are CA's that stupid? by sootman · · Score: 2, Insightful

      CAs should be fixed to not allow garbage in the domain. \0 isn't a legal character in DNS protocol, so why should anyone be allowed to register a domain certificate with something that is not allowed.

      Exactly. My mind is totally blown by this. They're issuing SECURITY certificates and they don't VALIDATE USER INPUT?!?!? Isn't that the very first thing they cover when talking about how to design apps securely? This is would take, what, a one-line regular expression to catch? God help them if Bobby Tables wants a cert.

      --
      Dear Slashdot: next time you want to mess with the site, add a rich-text editor for comments.
    28. Re:Are CA's that stupid? by infolation · · Score: 3, Informative

      Mr Marlinspike gives a more comprehensible breakdown of why this works in an interview he gave with Jeff Moss at Blackhat 09 that looks at SSL vulnerabilities in a broader light.

    29. Re:Are CA's that stupid? by CarpetShark · · Score: 1

      Yeah, but who wants to read actual text when you can scan for tokens? ;)

    30. Re:Are CA's that stupid? by Anonymous Coward · · Score: 0

      It doesn't seem unreasonable for a CA to have some basic security for them to be listed. Right now any jackass can file as a corporation and get added as a CA. I should just start a CA company myself that has blatant SQL injection flaws on my website and see how long I'm allowed to continue to be on the lists.

    31. Re:Are CA's that stupid? by Mad+Merlin · · Score: 1

      Somehow all the CA softwares are reading beyond the null whereas most of the browsers stop doing so?

      You only need one CA to read past the null.

    32. Re:Are CA's that stupid? by Anonymous Coward · · Score: 0

      Sorry to any higher beings who see past this petty response, but this seems like the only sensible comment so far.

      This is not a browser issue. This is not a programming language issue.

      It is a human issue: Not humans reviewing the certs (it's automated these days), but the human who programmed the interface to allow non-DNS-valid characters into a domain name!!!

    33. Re:Are CA's that stupid? by julesh · · Score: 1

      CAs should be fixed to not allow garbage in the domain. \0 isn't a legal character in DNS protocol [...]

      Yes, it is. See my previous comment on this topic.

    34. Re:Are CA's that stupid? by amorsen · · Score: 1

      They're issuing SECURITY certificates and they don't VALIDATE USER INPUT?!?!?

      Congratulations, you have discovered that the certificate industry is a scam.

      --
      Finally! A year of moderation! Ready for 2019?
    35. Re:Are CA's that stupid? by SirJorgelOfBorgel · · Score: 1

      Actually modern (Object) Pascal compilers generally use a PtrUInt for it - an unsigned integer with the same width as a pointer - so a string can be 4GB long on 32-bit systems, and a lot longer on 64-bit systems.

      It's a really handy construct though, and IMHO works a lot easier than null-terminated strings. For one thing, you can put any data you want in a string, which prevents a lot of silly stuff like this and can also be really handy depending on what you are doing. (It's ridiculous how often you hear about similar issues to this one with null-terminated strings). Aside from that, it is also more efficient speed-wise to do operations - for example determining string length is much quicker, which you need for many operations.

      Note that modern (Object) Pascal compilers also sneakily keep \0 character(s) behind the string data itself (but this is hidden from you) so you can pass a pointer to the first character of the string directly to null-terminated string functions and it'll Just Work(tm). Obviously those functions will bork on \0 character(s) mid-string again, though.

      I honestly don't know who came up with the null-terminated string idea or why, but from any way I look at it (aside from performance/efficiency reasons in some - but certainly not all - cases) it seems like a terrible idea. Of course, IMHO.

  3. Is the null character valid in a domain name? by characterZer0 · · Score: 4, Interesting

    If not, the CA should not have issued the cert in the first place. Which CA was it?

    --
    Go green: turn off your refrigerator.
    1. Re:Is the null character valid in a domain name? by Statecraftsman · · Score: 2, Funny

      badguy.com of course! (goes to check his list of root CAs)

    2. Re:Is the null character valid in a domain name? by Anonymous Coward · · Score: 1, Informative

      The CA issued a malformed Cert. The browser (firefox) did not catch the malformation. Who is to blame? Both I would think.

    3. Re:Is the null character valid in a domain name? by Anonymous Coward · · Score: 0

      Yes, the DNS protocol is 8-bit safe for domain names. All modern DNS server software is able to handle arbitrary byte sequences in labels.

      DNS client software is, unfortunately, generally not as robust... hence the abomination that is punycode.

    4. Re:Is the null character valid in a domain name? by julesh · · Score: 1

      The CA issued a malformed Cert. The browser (firefox) did not catch the malformation. Who is to blame? Both I would think.

      Which the article is quite clear about. It's also clear that although both are to blame, only the browser can fix this for any certs that may already be in the wild...

    5. Re:Is the null character valid in a domain name? by Marillion · · Score: 1

      It would not be unreasonable that a CA issued a wildcard certificate. That said, I hope all the major CA's would add anyone caught abusing their wildcard certs to their CRL.

      --
      This is a boring sig
  4. When C Strings Attack! by Tyler+Eaves · · Score: 3, Insightful

    *sigh* Why is anyone still using null-terminated strings? It's almost a shame that Pascal didn't become dominant...many of these bugs would simply not occur.

    --
    TODO: Something witty here...
    1. Re:When C Strings Attack! by tylersoze · · Score: 1

      Yeah and you'd have the Twitter-like limitation of all strings being no more 255 characters long. :) Of course, I'm sure they would've eventually implemented a UTF-8 style thing where you'd examine the initial bits to determine the byte size of the initial string length indicator.

    2. Re:When C Strings Attack! by QuoteMstr · · Score: 1

      If Pascal strings had become standard, we'd be dealing with 256-bytes length limits all over the place as Pascal only use eight bits to store the string length. I imagine there'd be attacks that involved making the length counter overflow. We'd still have bugs, but different bugs.

    3. Re:When C Strings Attack! by Desler · · Score: 3, Funny

      I agree. 255 characters ought to be enough for anyone!

    4. Re:When C Strings Attack! by Anonymous+Cowar · · Score: 4, Funny

      Two strings walk into a bar.

      The first string says to the bartender, "Give me a beer." The bartender turns to the second string and says, "and what about for you?" To which the second string replies, "I would also like a beer#@a9101gb230b81;kajf3#$B89*#()*13!$%#@$"" and goes on and on spewing gibberish.

      The bartender, shocked, asks the first string, "What is your buddy's problem?"

      The first string answers, "Oh, you'll have to excuse him, he isn't null terminated."

    5. Re:When C Strings Attack! by Anonymous Coward · · Score: 0

      then we'd have the bug that you could buy a certificate for paypal\0.com.
      i'm getting tired of mindless criticism of c bugs.

    6. Re:When C Strings Attack! by Gramie2 · · Score: 1

      Or they would have done what Delphi (Pascal-based) did, in fact, do: strings are reference-counted and copy-on-write and can contain any characters. They can also be treated as c-type strings when necessary (called a PChar, meaning a Pointer to an array of char), because assigning to a string automatically adds in a null byte at the end. But you can still get around the string handling and screw things up if you try hard enough.

    7. Re:When C Strings Attack! by CarpetShark · · Score: 1

      Never mind, the write-up mislead me a bit.

    8. Re:When C Strings Attack! by clone53421 · · Score: 2

      Um, that's the actual null character, not the backslash character followed by the numeral zero. Your brain was supposed to unescape it. The string contains the actual null character; it was simply escaped for display purposes.

      --
      Alexander Peter Kristopeit bought his basement from his mommy for one dollar.
    9. Re:When C Strings Attack! by Tolkien · · Score: 1

      Wouldn't work, the domain doesn't end in .com.

    10. Re:When C Strings Attack! by commodore64_love · · Score: 3, Interesting

      >>>"I would also like a beer#@a9101gb230b81;kajf3#$B89*#()*13!$%#@$""

      When I first read this I thought something was wrong with my modem. This is how online surfing used to appear prior to the advent of error-correction. Random noise could suddenly appear in the middle of your test. ..... Well I think I'm done for the day. Goodbye all!

      +++

      ATH

      bio#OP*qe! B89*#()*13!B89*#()*13!B89*#()*13! (click)

      CARRIER LOST

      --
      "I disapprove of what you say, but I will defend to the death your right to say it." - historian Evelyn Beatrice Hall
    11. Re:When C Strings Attack! by wfstanle · · Score: 1

      Actually, the limit for standard pascal strings is 255 characters. Byte 0 of the string is the length of the string and 1 to ??? is the actual string. The limit could be overcome by storing the length separately from the data. However, pascal style strings are not inherently more secure than C style strings. You could invent a hack that plays around with length bit ( or field ).

    12. Re:When C Strings Attack! by Anonymous Coward · · Score: 0

      Oh come on... ancient Pascal used a single byte for the string length, but long ago the major Pascal descendents (Delphi for instance) made use of 32-bit length counters by default. 4GB strings should be enough for almost any normal use (define a new class if you need more).

      Most object formats and linkers used to limit external symbols to 8 characters, but that got better too..

    13. Re:When C Strings Attack! by Anonymous Coward · · Score: 0

      It would also not be a problem if BASIC had become dominant!

    14. Re:When C Strings Attack! by Anonymous Coward · · Score: 0

      Hmm, the problem is exactly caused by the problems when C and Pascal like strings are mixed...

    15. Re:When C Strings Attack! by BikeHelmet · · Score: 4, Interesting

      Java strings!

      32bit signed int, max length 2GB.

      That ought to be enough for anybody. ;) If you need longer, there's special buffer classes that can go longer.

      The string also chooses between ASCII and Unicode when initialized, (you can manually set char encoding, as well) so properly cleaned/trimmed ASCII strings don't waste any memory. (Except for the 3 bytes extra that go into a length int, instead of a null char - but those 3 bytes also give you an amazing speedup when you need to know the length of the string.)

      I believe C# implements Strings in a similar way.

    16. Re:When C Strings Attack! by Anonymous Coward · · Score: 0

      The problem isn't that the browsers use null terminated strings, the problem is that the CA doesn't. If they both did the same damn thing then there wouldn't be a problem.

    17. Re:When C Strings Attack! by Kjella · · Score: 1

      Using the UTF-8 style as length encoding would be nice. If you'd use all 8 bits for up to 8 byte length encoding you should be able to do 7*6=42 bits = 4TB while still being very efficient for short strings (< 128 = 1 byte).

      --
      Live today, because you never know what tomorrow brings
    18. Re:When C Strings Attack! by Anonymous Coward · · Score: 0

      if Pascal were dominant your posts would be limited by 255 characters at most.

    19. Re:When C Strings Attack! by DarkOx · · Score: 1

      Which makes sense on a desktop pc or even a server where you can have gobs of ram. There are lots places where it still makes little sense to use three bytes that way; places where you might need / want to implement DNS. I would hate to throw three bytes per string away on an carrier class router or switch for instance.

      --
      Repeal the 17th Amendment TODAY! Also Please Read http://www.gnu.org/philosophy/right-to-read.html
    20. Re:When C Strings Attack! by BikeHelmet · · Score: 1

      Which makes sense on a desktop pc or even a server where you can have gobs of ram. There are lots places where it still makes little sense to use three bytes that way; places where you might need / want to implement DNS. I would hate to throw three bytes per string away on an carrier class router or switch for instance.

      Valid point, but most C programs these days don't even bother to optimize down from int to short int or byte.

      Int to byte is 3 bytes, right there. :P

      And honestly, better algorithms have a bigger impact than 3 bytes spent on the length of a string.

    21. Re:When C Strings Attack! by Anonymous Coward · · Score: 0

      So, certificate data.. specifically the relative distinguished name values that would be a place to hide the null character in a common name field, actually gets interpreted as an ASN.1 data. Not strings, and not with a signed int limiter.

    22. Re:When C Strings Attack! by g0at · · Score: 1

      The problem here is precisely BECAUSE the certificate is not using a null-terminated string; it is the Pascal-style behaviour which has facilitated the problem.

      I think you're confused.

    23. Re:When C Strings Attack! by dkf · · Score: 1

      I would hate to throw three bytes per string away on an carrier class router or switch for instance.

      Routers often run (specially cut down) Unix. OK, with some fairly fancy hardware but also plenty of memory to hold routing tables (especially on the backbone routers).

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    24. Re:When C Strings Attack! by Anonymous Coward · · Score: 0

      UTF-8 doesn't have a string length indicator.

    25. Re:When C Strings Attack! by hesaigo999ca · · Score: 1

      I sooo wish I had some points to mod you funny right now!

    26. Re:When C Strings Attack! by Anonymous Coward · · Score: 0

      2 GB? You could embed an entire malicious operating system in one of those suckers!

    27. Re:When C Strings Attack! by jesset77 · · Score: 1

      He is only invoking UTF-8's ability to use the head end bits of a byte to signify place value, and then importing that idea into reporting string length.

      Personally however, I would prefer something like a base-254 encoded integer of arbitrary length with a terminator character to solve this small, naive problem. For instance a preamble of, 0x02 0x9E 0xFF would indicate the upcoming string will be 666 bytes long, including preamble. This would handle unlimited size.

      Nonetheless the bigger problem is that malformed data in null-terminated encoding schemes leads to hassles no more nor less than malformed data in preamble schemes do. So long as everyone follows the same convention and introduces no corrupt data, regardless of the scheme, you are fine. corrupt data or incompatible practices break any scheme. When that happens to a pascal string or similar (bit gets flipped in your preamble, turning a 20 byte string into a 3 terrabyte string, or else someone assumes a slightly different preamble convention) you end up with just as many buffer overruns et al as ever.

      --
      People willing to trade their freedom of expression for temporary entertainment deserve neither and will lose both.
  5. Dan Kaminski, would you STOP ALREADY !! by Anonymous Coward · · Score: 5, Funny

    Go do something else for a while. If it were not for you we all would be safer !!

    1. Re:Dan Kaminski, would you STOP ALREADY !! by sys.stdout.write · · Score: 1

      His computer just got hacked too.

      You can read the hacklog here along with the one for Kevin Mitnick's hack.

    2. Re:Dan Kaminski, would you STOP ALREADY !! by w0mprat · · Score: 1

      His computer just got hacked too.

      It was their websites that got hacked (first). Not suprising using an external blog/site hosting provider.

      --
      After logging in slashdot still does not take you back to the page you were on. It's been that way for 20 years.
    3. Re:Dan Kaminski, would you STOP ALREADY !! by gstrickler · · Score: 1

      Are you actually suggesting we're more secure if white-hats aren't constantly checking for vulnerabilities? Security by obscurity is not secure.

      --
      make imaginary.friends COUNT=100 VISIBLE=false
  6. So now... by mhkohne · · Score: 5, Funny

    All we have to do is get the CAs to pay attention to the certs they issue, correct?

    Uh-oh. We're screwed.

    --
    A thousand pounds of wood moving at 300 feet per minute. Don't get in the way.
    1. Re:So now... by Anonymous Coward · · Score: 5, Insightful

      No, all we have to do is make CA's liable for the certs the issue.

    2. Re:So now... by Imagix · · Score: 1

      Isn't that why they charge huge amounts for the certs?

    3. Re:So now... by Anonymous Coward · · Score: 1

      No, they charge huge amounts of money for certs for the same reason geeks run Linux on their toasters... because they can.

    4. Re:So now... by dkf · · Score: 1

      Isn't that why they charge huge amounts for the certs?

      When was getting a signature from a crappy CA expensive? Is $30/yr for a basic server certificate terribly expensive all of a sudden (and I bet you can go cheaper than that if you hunt around) or are you deliberately going to a CA that is both bad and costly too? That'd be a new level of dumb...

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    5. Re:So now... by HeronBlademaster · · Score: 1

      No, they just feel like it. Most of them don't even bother to do any more verification than "make sure you can receive e-mails at ssladmin@domainyouwantacertfor.com".... and that's automated.

      In other words, SSL certs are infinite in supply and virtually zero-cost to create, so they're milking them for all they're (apparently) worth.

    6. Re:So now... by julesh · · Score: 2, Interesting

      Isn't that why they charge huge amounts for the certs?

      No, I think that's called rampant profiteering. And because competition has driven the price down too low for them (oh no, they can only get away with charging ~50 euros for an automatically-generated chunk of data) they've introduced extended validation certs, where they actually do what they were supposed to be doing in the first place and charge yet more money for it...

    7. Re:So now... by julesh · · Score: 1

      No, all we have to do is make CA's liable for the certs the issue

      Technically, these certs are correct. The domain name in them is for a server held by the applicant. The browser is misinterpreting that domain name. I fail to see how the CA could be held liable, even if there were any basis to do so under any circumstance.

    8. Re:So now... by hesaigo999ca · · Score: 1

      Agreed, yet so little accountability is given to those with the power divert accountability!

  7. MS BSTR and null terminated strings by Anonymous Coward · · Score: 1, Funny

    It's a shame that the Microsoft BSTR didn't become the dominant form of string, then these problems wouldn't be occurring.

    1. Re:MS BSTR and null terminated strings by 93+Escort+Wagon · · Score: 1

      It's a shame that the Microsoft BSTR didn't become the dominant form of string, then these problems wouldn't be occurring.

      Is the Microsoft BSTR anything like the Microsoft BSOD?

      --
      #DeleteChrome
    2. Re:MS BSTR and null terminated strings by CarpetShark · · Score: 1

      It's a shame that the Microsoft BSTR didn't become the dominant form of string, then these problems wouldn't be occurring.

      It's a shame that pearl necklaces didn't become the dominant form of string... oh, never mind.

    3. Re:MS BSTR and null terminated strings by commodore64_love · · Score: 1

      I thought BSTR was short for "bastard"

      --
      "I disapprove of what you say, but I will defend to the death your right to say it." - historian Evelyn Beatrice Hall
    4. Re:MS BSTR and null terminated strings by Thuktun · · Score: 2, Informative

      It's a shame that the Microsoft BSTR didn't become the dominant form of string, then these problems wouldn't be occurring.

      A Microsoft BSTR is simply a length-prefixed string, which are themselves older than Microsoft.

  8. Makes me wonder by JamesP · · Score: 0, Troll

    Who's the fscking idiot who thought having \0 indicate end-of-string was a good idea??!!?

    I cannot remember something that gave more _grief_ and _problems_ than that.

    --
    how long until /. fixes commenting on Chrome?
    1. Re:Makes me wonder by Anonymous Coward · · Score: 0

      In DOS it was $, we could go back to that if you prefer?

    2. Re:Makes me wonder by Anonymous Coward · · Score: 0

      I cannot remember something that gave more _grief_ and _problems_ than that.

      Maybe you should get out more.

    3. Re:Makes me wonder by spydabyte · · Score: 1

      And a better idea is.... \1? It's called a standard. What about any optimized language, are huge overheads really better? Or am I missing something?

    4. Re:Makes me wonder by The+Moof · · Score: 1

      Well, if the CA software respected the null as the end of the string, they wouldn't have issues the certificate to badguy.com. They would've just seen badguy.com attempting to get a certificate for PayPal.com.

    5. Re:Makes me wonder by moon3 · · Score: 1

      Who's the fscking idiot who thought having \0 indicate end-of-string..

      His name should not be that fscking hard to find, if you care about that, the SSL related code is open source.

    6. Re:Makes me wonder by Anonymous Coward · · Score: 0

      how the fsck else do you propose to do it? well, i guess you could prepend the string with its length... but that's messy too, since the length of the length wouldn't be constant. crap.

    7. Re:Makes me wonder by Anonymous Coward · · Score: 0

      Go back to eating paste!

    8. Re:Makes me wonder by smellsofbikes · · Score: 1

      Who's the fscking idiot who thought having \0 indicate end-of-string was a good idea??!!?

      I'm honestly curious, since I don't know enough about the problem to do more than ask questions: don't you need an end-of-string indicator of some type? Wouldn't any other end-of-string indicator do exactly the same thing? In other words, isn't this about the (bad) assumptions being made by the browser's URL parser, rather than about the inherent evil of a specific end-of-string delimiter?

      --
      Nostalgia's not what it used to be.
    9. Re:Makes me wonder by QuoteMstr · · Score: 4, Insightful

      Idiots? I think not. Put yourself in the shoes of programmers in the 70s. Could you have come up with a better idea that did all these?

      • didn't use more than one byte of extra memory
      • worked for both static and dynamically-allocated strings
      • did the right thing when embedded in structures initialized to zero
      • allowed for easy, efficient string concatenation

      Sure, today, C strings might seem like a poor decision today, in this age of virtual memory, C++ classes, and sophisticated optimizing compilers. But at the time, C strings were the least bad of the available alternatives.

    10. Re:Makes me wonder by Abcd1234 · · Score: 1

      don't you need an end-of-string indicator of some type?

      Nope. The alternative would be to carry around the length at the start of the string. This would be known as a Pascal-style string (in contrast to what we're discussing here, which is a C-style string).

    11. Re:Makes me wonder by pushing-robot · · Score: 1

      Somebody, a long time ago, (in a galaxy very, very close) realized that (a) you could have longer strings with less overhead and (b) sometimes you're reading streaming input and don't know ahead of time where the data will end. Having null-terminated strings was very useful when CPU cycles were expensive, registers were expensive, and buffered data was expensive.

      The better question is "Who's the fscking idiot who would use a null-terminator, (on a short string, no less,) in a situation where security is paramount, and not even bother to check for poisoned nulls??!!?"

      --
      How can I believe you when you tell me what I don't want to hear?
    12. Re:Makes me wonder by larry+bagina · · Score: 1

      the alternative is to store (and maintain) the length of the string.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    13. Re:Makes me wonder by owlstead · · Score: 1

      Meh, with the number of bytes we have lying around on the computer: just make it 64 bits. If anybody ever creates a string of 18446744073709551616 characters or higher, we'll give him a cookie. You could also use variable length encoding such as DER. In that case you can go up to a number that is much higher than 2^128 you run out of particles in the universe pretty quickly. DER uses one byte encoding up to 7Fh. After that you get 8180h, up to 81FFh, then you get 820100h up to 82FFFF up to FExx where xx is repeated 7Fh times.

      Note that this is a C/C++ construct that has been - uh - deprecated by languages like pascal ages ago. Nobody says that a 00h character has to end a string, and you can do much better than that. Truly, I've seen many issues with 0 terminated strings in the last 8 years - many of them in important libraries. 0 terminated strings suck. Control characters without any textual meaning suck. Get rid of them.

    14. Re:Makes me wonder by owlstead · · Score: 1

      That won't be someone in the SSL related code I guess. It's more like a language/library problem.

    15. Re:Makes me wonder by owlstead · · Score: 1

      Absolutely true. However, it does make a statement about the validness for using such a language today, especially for security related applications. How long should we keep such languages and libraries around?

    16. Re:Makes me wonder by betterunixthanunix · · Score: 1

      Yes; the PASCAL style, which have the added benefit of very efficient length checking. The only downside is that strings longer than 256 chars would have to use more than one byte for storing length; all of the other advantages are maintained.

      More likely, it was chosen because of the storage saving, and because there was not a risk of hackers trying to cause strings to misbehave by passing null characters in the wrong places. C and Unix were originally used in environments where people were not trying to attack each other, and security systems were in place just to prevent common user errors from destroying others' work. The real "idiot" move was taking the same hunks of code from the age where everyone could trust each other, and trying to use it in an age where some people cannot be trusted.

      --
      Palm trees and 8
    17. Re:Makes me wonder by QuoteMstr · · Score: 1

      Also, with C strings, you don't need to worry about counter overflows, and you can safely operate on a string when you don't have its beginning. (Consider strtokThe real "idiot" move was taking the same hunks of code from the age where everyone could trust each other, and trying to use it in an age where some people cannot be trusted.

      Rewriting everything from scratch didn't seem to work too well for MULTICS people, the Hurd people, the Plan 9 people, and so on.

    18. Re:Makes me wonder by Stile+65 · · Score: 1

      And that's a holdover from CP/M days.

      --
      I claim first use of "Error No. 0B" - or "No. 0B error." It'll be the new ID 10T!
    19. Re:Makes me wonder by w0mprat · · Score: 1

      Where is the line or two of code that would check the entire URL for validity, ie no bullsh\1t characters and proper structure? This to me is a nobrainer.

      Are programmers today, the ones we trust with our global information infrastructure, this really lazy/stupid/careless?

      --
      After logging in slashdot still does not take you back to the page you were on. It's been that way for 20 years.
    20. Re:Makes me wonder by amplt1337 · · Score: 1

      Who's the fscking idiot who thought having \0 indicate end-of-string was a good idea?

      Dennis Ritchie, actually. Have you won a Turing award lately?

      Anyway, as to the substance, you'd prefer maybe we keep the length of a string in a byte character unsigned integer... (wait, is that big enough?) instead, then update it every time we change the length of the string at all? There's trade-offs for every design decision. This wasn't a stellar one, and brilliant people make mistakes, and fail to accurately predict the future. But really, I am highly skeptical that you have the standing to go throwing "fscking idiot" around at the way that things are implemented in what's essentially the closest thing a to a lingua franca in programming.

      --
      Freedom isn't free; its price is the well-being of others.
    21. Re:Makes me wonder by QuoteMstr · · Score: 1

      #include <stdbool.h>
      bool evil_string_p(const char* s, size_t n) { return memchr(s, 0, n); }

    22. Re:Makes me wonder by moon3 · · Score: 1

      This is not language related problem. Having a C string doesn't stop you to proper check it or handle it safely.

    23. Re:Makes me wonder by fucket · · Score: 1

      It doesn't really matter, they'd probably still issue it.

    24. Re:Makes me wonder by Anonymous Coward · · Score: 0

      so what's your brilliant solution for transmitting a string?

    25. Re:Makes me wonder by commodore64_love · · Score: 1

      >>>Who's the fscking idiot who thought having \0 indicate end-of-string was a good idea??!!?

      That was an excellent way to save space in an era when computers only had ~0.004 megabytes of RAM, and ~0.07 megabytes of disk storage. Sure today we can afford to waste space on exotic byte-counting routines, but back then such luxuries were not possible. The NULL method to end a string was nice & compact.

      --
      "I disapprove of what you say, but I will defend to the death your right to say it." - historian Evelyn Beatrice Hall
    26. Re:Makes me wonder by betterunixthanunix · · Score: 1

      Actually, Unix was a rewrite from scratch (of Multics but simpler), as was C (of B but more expressive), and Multics did see some use once it was completed, mostly in mainframes and systems that required a high degree of reliability. Hurd did not fail so horribly because it was a rewrite, it failed because something else came along sooner (Linux), which itself had been written from scratch. Plan 9 was intended to be a research system for exploring new concepts.

      The point still remains: it was a poorly planned move to take code that was designed for environments where everyone could be trusted, and use it in an environment where that was not the case. Worse still was using a system based on combining various other systems, each of which had different security goals, for things like banking and other security-sensitive applications -- e.g. what we did with the Internet. The move to e-commerce over the Web happened too quickly and with too little planning, and was built on marketing hype from software companies and consultants.

      --
      Palm trees and 8
    27. Re:Makes me wonder by TheRaven64 · · Score: 1

      Do you have a citation for that? As I recall, C copied its string handling (or, rather, lack of string handling) directly from BCPL. Arguments to authority are bad enough, but they're even worse when the authority in question isn't even relevant.

      --
      I am TheRaven on Soylent News
    28. Re:Makes me wonder by hairyfeet · · Score: 1

      Which brings up a question I've been wondering about for awhile: How much really old crap from the 70s and 80s is till "brewing in the bowels" of modern OSes? I'm mean it wasn't but a few years ago that MSFT was hit with the "wmf flaw" which was going back to Win3.xx, and I'm sure that Linux probably has some seriously old code lying around in there somewhere since it is over a decade and a half old, and shares much in common with ancient Unix.

      So how much really old code is brewing in our modern OSes? I remember looking at the Win2K source and being amazed at how they had code with comments like "HACK- not really sure what this does, but when removed causes data corruption in every version of Office from V6 on up. Do NOT touch!" and while I haven't torn into the source code for Linux, it wouldn't surprise me if some of the older libraries had something similar. So how much from our "dinosaur days" of early computing is still floating around the guts of the major three OSes (Linux, OSX, Windows) anyway?

      --
      ACs don't waste your time replying, your posts are never seen by me.
    29. Re:Makes me wonder by amplt1337 · · Score: 1

      Do you have a citation for that? As I recall, C copied its string handling (or, rather, lack of string handling) directly from BCPL.

      OP wondered "who thought having \0 indicate end-of-string was a good idea" -- not who did it first. I don't know that Ritchie invented it, but he certainly thought it a good enough idea to use it in the new language he was developing.

      Arguments to authority are bad enough...

      Okay then, how about "there must be some reason that programmers have kept using it for 40+ years?" Ah, appeal to history, can't have that either... Look, I'm not arguing that null-terminated strings are a brilliant idea that should be preserved in gold as though handed down by the gods themselves. Just that it's entirely possible that there's some reason that the idea wasn't immediately cast on a scrap-heap, and that the OP should consider that prospect before claiming that the very many programmers who have used and endorsed it were a lot of gibbering clowns.

      Argument to authority or history don't prove merit, but they are strongly suggestive of the possibility of merit--that the idea deserves well-thought-out criticism rather than outright dismissal.

      --
      Freedom isn't free; its price is the well-being of others.
    30. Re:Makes me wonder by dr2chase · · Score: 1

      BCPL used counted strings. That's what my memory says, and I can check The Book in a flash.
      (flash)
      "By convention, byte 0 contains the numbers of characters in the string, which are stored consecutively from byte 1." (p. 50, BCPL - tlaic)

      You know, Java has counted strings, and they use 32 whole bits for the length. Not fully general, but large enough for most domain names. In Java proper (not its native libraries, sigh), there's also no issues with buffer overrun.

    31. Re:Makes me wonder by HeronBlademaster · · Score: 1

      you can safely operate on a string when you don't have its beginning.

      This is a serious benefit for certain applications - a Pascal-style string would require you to copy substrings in order to use them (so it could maintain the length), whereas a C-style string lets you use an arbitrary pointer.

      A C program that processes text files (e.g. logfiles) into some other format (e.g. csv files) would probably run much faster in C than in Pascal, if the C program is allowed to take advantage of the aforementioned benefit.

    32. Re:Makes me wonder by nedlohs · · Score: 1

      How does nul terminated strings help in case b? You have to allocate memory in both cases anyway and keeping track of a pointer to the length store isn't hard.

      nul terminated strings are simple and efficient. They also require more effort on the part of the client code. Which is the C way.

    33. Re:Makes me wonder by Anonymous Coward · · Score: 0

      don't you need an end-of-string indicator of some type?

      Nope. The alternative would be to carry around the length at the start of the string. This would be known as a Pascal-style string (in contrast to what we're discussing here, which is a C-style string).

      The problem with that is that you're now limiting the maximum length of your string to whatever the witdth of the number at the beginning is. If it's a byte, then your string can be no longer than 256 characters. Obviously a 32 or 64-bit integer would allow for some pretty massive strings, but why limit yourself at all? Why not just say 'keep reading this string until I tell you to stop' ?.

      The solution here isn't to switch all certificate reading code over to Pascal-style strings, it's to fix the certificate generation code which allows you to put a NULL character (an otherwise meaningless character) into the middle of a string which shouldn't, for any reason, contain a NULL character (or a BELL, or any invisible character).

    34. Re:Makes me wonder by Anonymous Coward · · Score: 0

      Well, you could prepend strings with the length as FF-terminated BCD. That would fix it.

    35. Re:Makes me wonder by Anonymous Coward · · Score: 1, Interesting

      Unfortunately, C strings do not support easy, efficient string concatenation.

      First of all, if I want to put string Y at the end of string X, I need to figure out where string X ends. Since I don't know the length of X, I have to inspect every single byte of it (possibly waiting for it to be paged in from disk) until I find the end. Of course there's no guarantee that there is a null character within the region allocated for X, so I have to accept the possibility that the pointer will wrap around past the end of my address space or hit an unallocated part of virtual memory (throwing an exception/signal). In fact, a naive strlen implementation could be an infinite loop!

      Then I have to make sure that the string Y doesn't overlap X. This means that a naive strcat implementation could also be an infinite loop! After that, I have to copy each byte of Y individually to the end of X. I can't ever operate on more than one byte at a time because I can't expect to read past the first null byte I see (that could cause a page fault).

      Another option is to find the length of Y in order to know how many bytes to copy before the null char is wiped out, which means inspecting every byte to find the null.

      Once I have the length of X and Y I can perform an easy, efficient memory copy, which presumably copies whole words (4 or 8 bytes) at a time rather than individual bytes. If the lengths were stored with the strings, the memory copy could be done immediately and then the only additional work would be to add the length of Y to the length of X.

    36. Re:Makes me wonder by Abcd1234 · · Score: 1

      The problem with that is that you're now limiting the maximum length of your string to whatever the witdth of the number at the beginning is.

      Don't be ridiculous. It's trivial to implement Pascal strings that have all but arbitrary length. Just start the string with a length-of-length indicator, followed by a series of bytes which indicate the length in some encoding, followed by the string data itself. Or is 2048 bits of length not enough for you? :)

      Of course, there's overhead, and it's complicated. I'm not saying it's a good idea. I'm just saying that an end-of-string marker is *not* required to implement strings.

      The solution here isn't to switch all certificate reading code over to Pascal-style strings

      But this I violently disagree with. While I don't advocate Pascal-style strings in general, no encoded data structure should use C-style strings. They should either use length indicators (2 or 4 bytes would be more than enough in this case), or fixed width fields. But C-style strings is a stupid *stupid* idea.

      That said, I have no idea if that's what the spec *actually* requires. The spec may very well define strings as I've described above, but the implementations are simply b0rked.

    37. Re:Makes me wonder by JamesP · · Score: 1

      Just think about it, knowing the size beforehand is a _huge_ advantage.

      Remember people that put strlen() inside a 'for'? Stupid in C, in Pascal it's constant time (and very fast)

      --
      how long until /. fixes commenting on Chrome?
    38. Re:Makes me wonder by HeronBlademaster · · Score: 1

      If you're passing substrings around, you most likely know the size anyway, and if you're doing read-only stuff you don't want the overhead of a string copy.

    39. Re:Makes me wonder by JesseMcDonald · · Score: 2, Insightful

      The problem is that the certificate, being written in ASN.1 format, does use a Pascal-style length-delimited string, whereas the browser is using C-style strings. When the ASN.1 string is converted into a C-style string the early NUL terminator is preserved, truncating the domain, and this truncated domain is then used to verify that the certificate matches the URL. This wouldn't be an issue if the same string format was used in both places, whether Pascal-style or C-style.

      There are multiple aspects to this vulnerability. No certificate should have been issued for an invalid domain name (NUL characters are not permitted in DNS identifiers). Given the sensitivity of the field, the domain name should not have been converted from ASN.1 format to a C-style string without some runtime verification that the resulting string is equivalent to the original, including the length. Finally, it would have made more sense to store and compare the domain name starting from the TLD; that way, if the name somehow did get truncated, the part which was verified would be the most important part and not some arbitrary subdomain.

      --
      "The state is that great fiction by which everyone tries to live at the expense of everyone else." - Bastiat
    40. Re:Makes me wonder by myowntrueself · · Score: 1

      Who's the fscking idiot who thought having \0 indicate end-of-string was a good idea??!!?

      My guess would be either Brian Kernighan or Dennis Ritchie.

      Neither of which I'd characterise as 'an idiot' though they probably thought of the C programming language as a gigantic practical joke at the time...

      http://www.elsop.com/wrc/humor/unixhoax.htm

      --
      In the free world the media isn't government run; the government is media run.
    41. Re:Makes me wonder by Anonymous Coward · · Score: 0

      But this I violently disagree with. While I don't advocate Pascal-style strings in general, no encoded data structure should use C-style strings. They should either use length indicators (2 or 4 bytes would be more than enough in this case), or fixed width fields. But C-style strings is a stupid *stupid* idea.

      That said, I have no idea if that's what the spec *actually* requires. The spec may very well define strings as I've described above, but the implementations are simply b0rked.

      You're dead right. I completely agree (I am parent poster to prev post). You can't push the limitations of one language into your encoded data formats.

      The issue here, as I see it, is that the code which has to read this certificate data (i.e. web browser code, Firefox, etc) is generally written in C, which does use NULL-terminated strings. The code which writes the certificates obviously isn't encumbered by this limitation (i.e. it can handle NULL characters in a string). When the certificate is parsed into memory by the browser (into what ever data structure the browser code uses), any attempts to read past the NULL character fails, because of a fundamental rule in C programs: NULL means end-of-string.

      I imagine that the data which is actually transmitted probably IS encoded with some form of 'length of string' encoding. Or it's XML, or whatever. That's not relevant. Whats relevant is that the C code at the browser end can't handle a NULL character in a string, and this should be taken into account when creating the certificates. Only valid characters should be allowed. I would hope that this would exclude any invisible characters such as the BELL (as I mentioned earlier), and other control characters, which could cause problems for whatever language is being used to parse the data at the other end.

    42. Re:Makes me wonder by Joe+Mucchiello · · Score: 1

      * allowed for easy, efficient string concatenation

      Well, 3 out of 4 ain't bad, right? Null-terminated strings are absolutely the worst for string concatenation. To concat a bunch of strings C-style requires that you get the total length of the strings. strlen is O(n) where n is the length of the string. Next you have to copy the text. strcpy is O(n) of course but strcat is O(n+m) where n is the string being copied and m is the string appended to. The first thing strcat has to do is walk to the end of the first string to find the end. But we've walked that string how many times before? Totally inefficient using the standard library. If strcat and strcpy had been specified to return the end of the string being written to it wouldn't be so bad. But they weren't.

    43. Re:Makes me wonder by owlstead · · Score: 1

      Yeah, in the same kind of reasoning no cars should ever crash since you should drive safely.

    44. Re:Makes me wonder by Anonymous Coward · · Score: 0

      Woosh.
      Hand over that geek card.

    45. Re:Makes me wonder by Homburg · · Score: 1

      The problem with that is that you're now limiting the maximum length of your string to whatever the witdth of the number at the beginning is.

      But the length of strings is limited anyway by the hardware; there's always going to be a maximum size to any addressable array. If the width of the number is of type size_t, that is, large enough to store the size of any possible array on the hardware in question, storing the length of a string with the string doesn't introduce any limit on the string's length.

    46. Re:Makes me wonder by Homburg · · Score: 1

      It does make a statement about the validness for using such a language today

      The odd thing is that Firefox is written in C++, and C++ strings aren't NULL terminated, they store the string length alongside the string. I wonder why Firefox is using C strings when it doesn't need to.

    47. Re:Makes me wonder by julesh · · Score: 1

      No certificate should have been issued for an invalid domain name (NUL characters are not permitted in DNS identifiers).

      Yes they are. Please see my previous comment on this subject.

    48. Re:Makes me wonder by owlstead · · Score: 1

      I'll have to look into the code for that, but having done a bit of C++ work myself, libraries are the main reason why you do this. Current applications are starting to be very large collections of libraries plus some control logic and possibly a GUI. This means that your libraries need to be secure as well and that the interface to those libraries should be consistent. Generally, you can't say that for C++ applications since they tend to use C-libraries. It's very nice to have boost and other "standardized" C++ libraries, but their usefulness is limited by having to use C, MFC libraries and the Windows API. I've had to juggle between char*, wchar*, basic_string templates and - eh - CString (I'm trying to forget) quite often.

      Because the base types used in Java are pretty well defined, and since Java byte-code cannot modify things that should not be modified, Java is suffering less from this problem. Then again, Java programmers seem to be less aware of using e.g. byte[] access and the vulnerabilities of the JVM may be hard to deal with. Java also lacks some const constructs - Java 7 might alleviate that a bit. But I still think the situation for managed languages with well defined API's is much better in this respect.

      And I presume that there is quite a bit of legacy code in Firefox as well, which may make all the difference.

      PS please replace Java by Python or C# at your leisure, I'm drawing from experience here.

    49. Re:Makes me wonder by Anonymous Coward · · Score: 0

      One would think that a simple check of `assert sizeof(string)==strlen(string)` should be good enough.

    50. Re:Makes me wonder by JesseMcDonald · · Score: 1

      I think we have a terminology issue here. NUL characters are indeed permitted in DNS "labels", one element of a DNS identifier, but the CA is issuing certificates for not just DNS labels but actual Internet (ARPANET) hostnames. As described in RFC 1035, Internet hostnames are further constrained to "start with a letter, end with a letter or digit, and have as interior characters only letters, digits, and hyphen." No NUL characters are permitted.

      I would also like to note that, as the hostname listed in the certificate is invalid, the CA cannot have properly verified, even minimally, that the recipient actually owned the hostname in question.

      --
      "The state is that great fiction by which everyone tries to live at the expense of everyone else." - Bastiat
    51. Re:Makes me wonder by JesseMcDonald · · Score: 1

      The expression "sizeof(string)" will give you either the size of the pointer type on your platform (if string is a char*) or the size of the array allocated to hold the string, regardless of the amount of space actually used. Neither would be very helpful. Also, assert() statements are no-ops outside of development builds and thus not suitable for this sort of runtime test.

      --
      "The state is that great fiction by which everyone tries to live at the expense of everyone else." - Bastiat
    52. Re:Makes me wonder by Anonymous Coward · · Score: 0

      But then we have the same problem as now but applied to the length instead! What we need is to prepend the length's length to it.

  9. And we trust CAs *why* again? by girlintraining · · Score: 4, Insightful

    If you ask me, networks of trust such as PGP are far more difficult to compromise than a central authority. Anything centralized is going to have only a handful of people, who are easy to find, and being private citizens, easily compromised. On the other hand, an integrated cryptographic interface where anyone can vouch for the authenticity of a site, ie; a reputation-based evaluation schema, would be (relatively speaking) more secure.

    I have a reputation amongst my friends and family of being "tech savvy". They trust my advice on technology. If that advice could be included in a database an integrated directly into the browser, then others they know that are also "tech savvy" (and trust) could inform their browsing actions much more than a single profit-orientated organization. I could, for example, add "l0pht industries" to my list of trustees, or "Bruce Schneider"... Or even "Rob Malda", and those people would become part of the trust network that my friends would then rely on. This is where the technology should go -- but because it conflicts with monied interests and in a capitalist society it is only the dollar value of a thing that makes our institutions protect it, it probably never will.

    Trust is really the central issue, not cryptography. Cryptography enables us to extend our trust relationships into the digital world.

    --
    #fuckbeta #iamslashdot #dicemustdie
    1. Re:And we trust CAs *why* again? by Hatta · · Score: 2, Informative

      If you ask me, networks of trust such as PGP are far more difficult to compromise than a central authority. Anything centralized is going to have only a handful of people, who are easy to find, and being private citizens, easily compromised. On the other hand, an integrated cryptographic interface where anyone can vouch for the authenticity of a site, ie; a reputation-based evaluation schema, would be (relatively speaking) more secure.

      Really? It seems to me that with a centralized system, you have one entity controlling trust. If you want to subvert that, you have to convince that entity that you are trust worthy. If you have a decentralized system, you could have 1000 entities controlling trust. That's 9999 more chances you have to trick someone.

      Decentralized systems are at first glance more appealing, but I don't think they are safer in this case. The problem in this case is that the CAs aren't incentivized to ensure trust. They make money based on the number of certificates they sell, not the trustworthiness of those certificates. CAs should be non-profit, or at least heavily penalized for issuing false certificates, if this is going to work.

      --
      Give me Classic Slashdot or give me death!
    2. Re:And we trust CAs *why* again? by Anonymous Coward · · Score: 1, Interesting

      If the two major CAs were VISA and Mastercard I would be a lot happier.

      They would at least have a vested interest in not putting out duff certs because they would end up paying for any money you lose to the perps.

    3. Re:And we trust CAs *why* again? by Anonymous Coward · · Score: 0

      Ever received "bad information" from a trusted friend? Or "bad information" from a friend of a trusted friend?

      'Nuph said.

    4. Re:And we trust CAs *why* again? by QuoteMstr · · Score: 2, Informative

      CAs should be non-profit, or at least heavily penalized for issuing false certificates, if this is going to work.

      The problem is the same with Moody's, actually: the central issue is that the people doing the auditing are being paid by the people they're auditing. Simply having browser users pay CAs (or investors pay rating agencies) would put the economic incentives in the right place, but that idea doesn't sit well with a lot of people.

      So instead, we're left with imperfect and leaky regulation. CAs really should be subject to more regular audits, and their trust bits should be removed by browser vendors when they are abused.

      By the way: I remove Comodo root certificates from any browser I use. Comodo allows its affiliates to issue certificates to anyone without verification, and therefore I do not trust Comodo.

    5. Re:And we trust CAs *why* again? by girlintraining · · Score: 1

      If you want to subvert that, you have to convince that entity that you are trust worthy. If you have a decentralized system, you could have 1000 entities controlling trust. That's 9999 more chances you have to trick someone.

      Yes, and compromising any one entity results in a 1/m damage, where m is the member count. The benefit here is that the number of compromises a person can make in a trust network before discovery (the risk) is exponential, not linear -- that is to say, two people are more than twice as likely to discover the subversion from a single source.

      --
      #fuckbeta #iamslashdot #dicemustdie
    6. Re:And we trust CAs *why* again? by Gramie2 · · Score: 3, Informative

      I'd rather add "Bruce Schneier" to my list of trustees, but your friend "Bruce Schneider" may be okay too.

      I'm really not trying to be a smartass. I just want people to get his name right; he deserves it.

    7. Re:And we trust CAs *why* again? by ratnerstar · · Score: 1

      I could, for example, add "l0pht industries" to my list of trustees, or "Bruce Schneider"... Or even "Rob Malda", and those people would become part of the trust network that my friends would then rely on.

      Bruce Schneider, Chiropractor and Cranio-Sacral therapist? He does seem pretty trustworthy, I guess.

      --
      Just because you sold your soul to the devil that needn't make you a teetotaler. --The Devil and Daniel Webster
    8. Re:And we trust CAs *why* again? by Anonymous Coward · · Score: 0

      I don't know.. I've heard bad things about that Bruce Schneider guy. Now, Bruce Schneier on the other hand!

    9. Re:And we trust CAs *why* again? by Anonymous Coward · · Score: 0

      The other problem with a trusted computing network where 'the masses' determine whose trustworthy is, simply, the number of messages being passed back and forth every time someone deems one website trustworthy. It's akin to a room of ping pong balls sitting on mouse-traps ready to fire when the first ball is dropped. Pure chaos.

      Besides, who ever said the masses know what they're doing? Next well see "Website is A++++++++++++ trustworthy" ala Ebay rating systems. (That's an exaggeration, I know, but I think I've made my point.)

    10. Re:And we trust CAs *why* again? by Lord+Ender · · Score: 2, Insightful

      The modern CA hierarchy IS a web of trust. You have the control over which CAs and even which individual certificates you trust. If you go with the default trust relationships provided by your browser or OS vendor, and you aren't satisfied, you have no one to blame but yourself.

      --
      A slashdotter who didn't build his own computer is like a Jedi who didn't build his own lightsaber.
    11. Re:And we trust CAs *why* again? by Anonymous Coward · · Score: 0

      This kind of trust can get polluted as well, as fake people vouch for fake people (like ad websites with forums full of glowing comments), so you can only trust who your friends trust. But we all have those friends who trust everybody, so we are back in the same boat.

    12. Re:And we trust CAs *why* again? by omuls+are+tasty · · Score: 1

      You don't need add Bruce Schneier to a trustee list. The Universe hardcodes him inside it, at a (cryptography secure) pseudo-random location.

    13. Re:And we trust CAs *why* again? by dkf · · Score: 1

      The problem is the same with Moody's, actually: the central issue is that the people doing the auditing are being paid by the people they're auditing. Simply having browser users pay CAs (or investors pay rating agencies) would put the economic incentives in the right place, but that idea doesn't sit well with a lot of people.

      So instead, we're left with imperfect and leaky regulation. CAs really should be subject to more regular audits, and their trust bits should be removed by browser vendors when they are abused.

      Your analysis looks spot on to me, and the key issue is that browser "vendors" aren't being strict enough on enforcement. They're ideally placed to do so as gatekeepers for normal users, and they're also strongly incentivized to act as such. But if nobody enforces the rules then a system that depends on enforcement is just not going to work. After all, the only rule that really needs enforcing is this: verify that the certificate is issued to someone who has a right to it. (There's another critical rule for subsidiary CAs: you must enforce the first rule.) Everything else can be handled through normal contracts and making sure that people check certificate validity correctly, which is a software thing that we (the technologists) ought to be able to get right.

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    14. Re:And we trust CAs *why* again? by dkf · · Score: 1

      Ever received "bad information" from a trusted friend? Or "bad information" from a friend of a trusted friend?

      Do you remember the worms that used to propagate by emailing themselves out to everyone in the victim's Outlook address book? They'd spread like wildfire because everyone would trust who the message was coming from. More innocent times I know, but I'm damn sure it could happen again; people aren't any smarter than before. But my real point is that webs of trust really do get penetrated, and the result is usually disastrous because hardly anyone in the real world is security-conscious. At least with the CA/PKI model, the real security knowledge is only needed by a small group of people who damn well should know that they need to know what's going on.

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    15. Re:And we trust CAs *why* again? by dkf · · Score: 2, Insightful

      The modern CA hierarchy IS a web of trust.

      No, it's properly a forest (i.e., multi-rooted tree). All the trust flows one way, from the CA roots. That works better because smaller numbers of people need to know what they're doing. Normal people, even normal website admins, don't need to know the details. By contrast, a web of trust will only work between people who understand the security implications of getting it wrong and who are therefore appropriately cautious. So small groups of techies are ideal, the general public... less so.

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    16. Re:And we trust CAs *why* again? by StillNeedMoreCoffee · · Score: 1

      One of the arguments for being able to trust Open Source software is that it is essentially in one place with everyone looking at it and keeping it honest. That is somewhat the case with a few central authorities. If there is a problem then it will get noticed and corrected sooner than later.

      A good example of the system you propose is Bernie Madoff. I circle of people thought he was trusted. That opionion of trust from people who should have known, propogated to more and more people funneling funds into his pocket. In your scheme there is the same depth of informal checking and oversight as in the Madoff situation. A small circle of people and word of mouth. With a CA there are millions of people using and testing. And here is an example of a problem found with will be a problem solved.

    17. Re:And we trust CAs *why* again? by dkf · · Score: 1

      If you ask me, networks of trust such as PGP are far more difficult to compromise than a central authority.

      In practice yes, but only because they're only used by the security conscious. But they're a group who will get almost any even marginally practical solution working anyway. Now, tell me how you plan to scale out a web of trust to millions of website admins without someone blundering (or being bribed) and introducing bad trust in the system...

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    18. Re:And we trust CAs *why* again? by RealGrouchy · · Score: 1

      So... you're proposing replacing CAs with Digg?

      - RG>

      --
      Hey pal, this isn't a pleasantforest, so don't waste my time with pleasantries!
    19. Re:And we trust CAs *why* again? by Lord+Ender · · Score: 1

      It's not a web in the strictest sense, but the property in question--the ability to decide who you trust to identify other trustworthy entities--is available in both models.

      --
      A slashdotter who didn't build his own computer is like a Jedi who didn't build his own lightsaber.
    20. Re:And we trust CAs *why* again? by Simetrical · · Score: 2, Funny

      Really? It seems to me that with a centralized system, you have one entity controlling trust. If you want to subvert that, you have to convince that entity that you are trust worthy. If you have a decentralized system, you could have 1000 entities controlling trust. That's 9999 more chances you have to trick someone.

      Well, one thing I certainly can't trust is Slashdot users' ability to do arithmetic.

      --
      MediaWiki developer, Total War Center sysadmin
    21. Re:And we trust CAs *why* again? by iYk6 · · Score: 1

      It actually illustrates the point of the summary perfectly. If you are going to trust somebody, you need to get their name right. Otherwise you could end up trusting somebody whose name is similar, but who is not trustworthy at all. Bruce Schneider might be a dick.

    22. Re:And we trust CAs *why* again? by Anonymous Coward · · Score: 0

      ... but your friend "Bruce Schneider" may be okay too.

      Didn't he play the captain of that submarine on tv?

    23. Re:And we trust CAs *why* again? by Schraegstrichpunkt · · Score: 1

      CA's shouldn't be non-profit, they should not exist at all. The whole browser trust model is a hack to work around the fact that the DNS provided no authentication mechanism.

    24. Re:And we trust CAs *why* again? by Anonymous Coward · · Score: 0

      That's exactly where I was going with my comment. Your comment was worded much better, though. :)

  10. Re:Pascal C: vindicated by cpu_fusion · · Score: 0

    That was "Pascal greater than C" using the greater than sign, but apparently slashdot can't escape that properly....

  11. it's not all bad by gEvil+(beta) · · Score: 1

    More significantly, an attacker can also register a wildcard domain, such as *\0.badguy.com, which would then give him a certificate that would allow him to masquerade as any site on the internet and intercept communication.

    That doesn't sound that bad, does it?

    --
    This guy's the limit!
    1. Re:it's not all bad by Anonymous Coward · · Score: 0

      Actually, that wouldn't work. Browsers would never match * to www.paypal.com for example, as they use the dots to break it into groups. For example:

      * would be valid for "com" or "net" but not for "paypal.com" or "citi.com"
      *.com would be valid for "paypal.com" or "citi.com" but not for "www.paypal.com" or "www.citi.com"

      and so on...

      So yeah, TFA has no idea what it's going on about.

    2. Re:it's not all bad by jesser · · Score: 1

      Versions of Firefox before 3.5 ignored the spec on this point, and allowed *.mozilla.org to match foo.bar.mozilla.org. See https://bugzilla.mozilla.org/show_bug.cgi?id=159483

      I wonder if it's possible to get certs like *.*.mozilla.org.

      --
      The shareholder is always right.
  12. Only as secure as the gate-keeper. by MaerD · · Score: 2, Interesting

    This isn't really a browser issue.

    The browser is going "Show me that this cert is valid for paypal.com" and the CA is going "Here it is, for paypay.com" , at least as far as the browser is concerned.
    This is no more a flaw then if the CA just started letting anyone buy certs for paypal.com.

    Having multiple CAs (and cheap CAs) is a good thing, but we're only ever secure with ssl as the least secure CA.

    --
    I put on my robe and wizard hat..
    1. Re:Only as secure as the gate-keeper. by zaajats · · Score: 1

      This isn't really a browser issue.

      The browser is going "Show me that this cert is valid for paypal.com" and the CA is going "Here it is, for paypay.com" , at least as far as the browser is concerned.
        This is no more a flaw then if the CA just started letting anyone buy certs for paypal.com.

      Having multiple CAs (and cheap CAs) is a good thing, but we're only ever secure with ssl as the least secure CA.

      As far as I understand, it's more like:

      * Browser gets cert for Paypal.com\0.badguy.com from the server

      * Browser reads domain from cert, but does so invalidly, and only gets Paypal.com

      * etc

    2. Re:Only as secure as the gate-keeper. by michaelhood · · Score: 1

      Having multiple CAs (and cheap CAs) is a good thing, but we're only ever secure with ssl as the least secure CA.

      Sort of, but with regards to your personal security it's really just as secure as the least secure CA that is in the trusted list of the browser of your choice. Not that it makes this any better.

      I think browsers should start removing CAs who aren't doing human verification..

    3. Re:Only as secure as the gate-keeper. by gstrickler · · Score: 1

      This isn't really a browser issue.

      Wrong, the browser is submitting a request for a cert for xxxx\0yyyy but only verifying the cert it received is valid for xxxx. The CA should never have issued the cert, but the browser is failing to fully validate and sanitize data received from other sources.

      --
      make imaginary.friends COUNT=100 VISIBLE=false
    4. Re:Only as secure as the gate-keeper. by jpmorgan · · Score: 0

      Wrong, this is absolutely a browser issue. Suppose someone hijacks DNS and redirects paypal.com to their own server, which is capturing accounts and passwords and you try to go to paypal.com, and get redirected to the evil site. What is supposed to happen is, your browser requests a certificate from the site, check that the certificate matches paypal.com and is signed by a valid CA. If Firefox was doing things correctly, it would immediately flag that the cert is for 'paypal.com\0.badsite.com' not 'paypal.com.' However, Firefox is being stupid and stopping the comparison at the null character, only reading the 'paypal.com' part of the bad SSL cert. So instead of flagging the certificate as bad, it says it's a valid certificate and now your paypal account has been hijacked.

    5. Re:Only as secure as the gate-keeper. by MaerD · · Score: 1

      If the browser stops reading at "paypal.com" and sends a request to the CA for the cert for "paypal.com" it's behaving correctly.

      If it isn't in one place, but is in the other, then yes, there is a browser issue.
      Either way, the CA is the weakest link here.

      --
      I put on my robe and wizard hat..
    6. Re:Only as secure as the gate-keeper. by jpmorgan · · Score: 2, Interesting
      The browser never sends a request to the CA. The browser has a copy of the CA's public key in a local store, so it can verify the cert itself. And the cert is perfectly valid... it's just for the wrong website! How SSL certs are supposed to work:
      1. The browser checks that the certificate has been signed by a trusted CA, by comparing it against its own local repository of CA public keys.
      2. The browser verifies that the certificate has not expired or been revoked.
      3. The browser verifies that the certificate matches the website it's trying to access.

      In this attack, the certificate is valid, and has not expired or been revoked, because the certificate was issued by a valid CA and is compliant with all the rules.So Firefox checks 1 and 2 they pass, as they should. But what's supposed to happen is firefox checks the 3rd part, and should detect the mismatch and generate an error. But firefox implements check #3 wrong, this is the problem. Firefox is improperly treating the domain name as null terminated, when the strings are supposed to be length delimited. This is a browser bug, plain and simple.

    7. Re:Only as secure as the gate-keeper. by Anonymous Coward · · Score: 0

      sends a request to the CA for the cert for "paypal.com"

      Sweetie, you don't have any idea how SSL and certificate verification works. Inform yourself, then comment.

    8. Re:Only as secure as the gate-keeper. by DarkOx · · Score: 2, Informative

      You could argue that but I might argue that NULL in not a valid character in an FQDN. It is by extension not a valid character in the CN attribute of a certificate issued for an FQDN. I have not looked at the code but the cert parser probably decrypts the certificate looks at the length of the string copies that many bytes into some other data structure null character inclusive, as well as everything beyond it just like it should.

      Then some other code looks at the data obtained from the SSL cert now stored in that internal struct which contains pointers to null terminated strings, a perfectly correct, perfectly common practice in C,C++ and loads of others. There is no checking of those strings for embedded NULLs because there should never be one, as stated above. I would say for a security function this classifies as a bug. They only reason I say that is in a security function one has to assume the input will in fact be malicious much of the time and violate all sorts of standards, rules, and conventions.

      So yes firefoxes SSL validation should be more rigorous in its input validation and toss out a cert as bad if it contains characters that would not be permissible in any given attribute.

      Really the problem lies though with the CA. They should also be doing that input checking, and not issuing certificates no permissible characters for any given attribute. A CA is after all supposed to be authenticating that this entity really is who they claim to be. If they claim to be something that can't exist, because it has an illegal name as in this case, then they must by definition be false and should have been rejected.

      It comes do to who was responsible for what. The browsers job is really only to verify that the certificate is valid. It was it has a valid signature from the CA. The CA job was to validate the information on the certificate before issuing it, they failed.

      --
      Repeal the 17th Amendment TODAY! Also Please Read http://www.gnu.org/philosophy/right-to-read.html
    9. Re:Only as secure as the gate-keeper. by Anonymous Coward · · Score: 0

      The browser never sends a request to the CA.

      It should, for the CA's certificate revocation list to see if the CA has revoked the certificate after it was issued.

      Ok, I'm being pedantic...

    10. Re:Only as secure as the gate-keeper. by julesh · · Score: 1

      You could argue that but I might argue that NULL in not a valid character in an FQDN. It is by extension not a valid character in the CN attribute of a certificate issued for an FQDN

      Isn't it? RFC1034 (STD13; Domain concepts and facilities) states:

      Each node has a label, which is zero to 63 octets in length. Brother
      nodes may not have the same label, although the same label can be used
      for nodes which are not brothers. One label is reserved, and that is
      the null (i.e., zero length) label used for the root.

      Internally, programs that manipulate domain names should represent them
      as sequences of labels, where each label is a length octet followed by
      an octet string.

      Note two things: first, no mention of any restrictions on valid characters are made here, secondly any program that fails to compare beyond a null character in a domain name is almost certainly neglecting this suggestion of the RFC. The RFC continues:

      As a matter of policy, the DNS technical specifications do not mandate a
      particular tree structure or rules for selecting labels; its goal is to
      be as general as possible, so that it can be used to build arbitrary
      applications.

      RFC1035 (aka STD13; Domain names, implementation and specification) states:

      Although labels can contain any 8 bit values in octets that make up a
      label, it is strongly recommended that labels follow the preferred
      syntax described elsewhere in this memo, which is compatible with
      existing host naming conventions. Name servers and resolvers must
      compare labels in a case-insensitive manner (i.e., A=a), assuming ASCII
      with zero parity. Non-alphabetic codes must match exactly.

      This seems to suggest a "label" (i.e. a component of a domain name) may contain _any_ 8 bit characters. It _recommends_ avoiding some unusual characters, but this is explicitly not a requirement. RFC 2185 updates RFC1035 and states:

      Those restrictions [related to length of labels]
            aside, any binary string whatever can be used as the label of any
            resource record. Similarly, any binary string can serve as the value
            of any record that includes a domain name as some or all of its value
            (SOA, NS, MX, PTR, CNAME, and any others that may be added).
            Implementations of the DNS protocols must not place any restrictions
            on the labels that can be used.

      So "any binary string whatever" is valid in a domain name, according to the RFCs. This would include one with an embedded null.

      So it doesn't seem to me that the CAs have actually done anything wrong here. NULL _is_ a valid character in a FQDN.

    11. Re:Only as secure as the gate-keeper. by entrigant · · Score: 1

      You really went to all of this trouble, spent time looking through rfcs, and even quoted sources which I must respect, but, respectfully, you are misunderstanding what you are reading.

      A "label" in the domain name system is simply a string. A completely generic entity with a maximum length of 63 bytes. It does indeed have no limits on what that string can contain.

      Further a domain name is represented as a sequence of labels. The root domain is represented as a null label, but a null label is a 0 length label. While that technically does equate to a label with a single 0 byte, semantically it is not the same thing as a null terminated empty string.

      As for the rules behind the legal characters in a host name I will follow your lead and quote RFC1035:

      > The labels must follow the rules for ARPANET host names. They must
      > start with a letter, end with a letter or digit, and have as interior
      > characters only letters, digits, and hyphen. There are also some
      > restrictions on the length. Labels must be 63 characters or less.

      If you want it spelled out even more clearly they provide this as well:


      > ::= | " "
      >
      > ::= | "."
      >
      > ::= [ [ ] ]
      >
      > ::= |
      >
      > ::= | "-"
      >
      > ::= |
      >
      > ::= any one of the 52 alphabetic characters A through Z in
      > upper case and a through z in lower case
      >
      > ::= any one of the ten digits 0 through 9

      Any domain name validator should be written using the logic provided by the RFC when dealing with labels that define a host name

      Now, labels are used for other things. For example, the email address in the SOA field or the string in a TXT field. The email address mailbox part has a much wider range of valid characters, and a TXT record is completely arbitrary. Labels are used for any string in a DNS packet.

    12. Re:Only as secure as the gate-keeper. by entrigant · · Score: 1

      Crap, slashdots junk filter wouldn't let me use massive amounts of > and <. To see what that was suppose to look like visit rfc1035 and visit section 2.3.1. It's on page 7.

      http://tools.ietf.org/html/rfc1035

    13. Re:Only as secure as the gate-keeper. by julesh · · Score: 1

      As for the rules behind the legal characters in a host name I will follow your lead and quote RFC1035:

      > The labels must follow the rules for ARPANET host names. They must
      > start with a letter, end with a letter or digit, and have as interior
      > characters only letters, digits, and hyphen. There are also some
      > restrictions on the length. Labels must be 63 characters or less.

      You're quoting that section out of context. Let me quote some earlier paragraphs:

      2.3.1. Preferred name syntax

      The DNS specifications attempt to be as general as possible in the rules
      for constructing domain names. The idea is that the name of any
      existing object can be expressed as a domain name with minimal changes.

      However, when assigning a domain name for an object, the prudent user
      will select a name which satisfies both the rules of the domain system
      and any existing rules for the object, whether these rules are published
      or implied by existing programs. ...

      The following syntax will result in fewer problems with many
      applications that use domain names (e.g., mail, TELNET).

      I.e., what you're quoting is a recommendation for what names people should assign to nodes in order to reduce interoperability problems, and not a strict requirement.

    14. Re:Only as secure as the gate-keeper. by entrigant · · Score: 1

      When the word "must" is used in a RFC it tends to have a very specific meaning. The DNS specification is very general because it was designed to be capable of being used for other things beyond resolving internet hostnames.

      If you are using DNS for what most of the world uses it for, internet hostnames, then to inter-operate, as the RFC says, "The labels must follow the rules for ARPANET host names."

      Perhaps part of the confusion is that the issue of what constitutes a valid FQDN is not a DNS specification issue. DNS is simply used to resolve the names, and it's very general in how it works. The rules predate the DNS protocol. For example on page 2 of RFC 608 is this description:


      in which will be the official Host Name, a
      string obtained through negotiation between the Host and the
      NIC, governed by these constraints:

      up to 48 characters drawn from the alphabet (A-Z),
      digits (0-9), and the minus sign (-) ... specifically,
      no blank or space characters allowed;

      no distinction between upper and lower case letters;

      the first character is a letter;

      the last character is NOT a minus sign;

      no other restrictions on content or syntax.

      Considering these SSL certificates are being validated against internet hostnames then I'd say it's perfectly reasonable to use the rules for such hostnames when performing validation. No \0's allowed.

    15. Re:Only as secure as the gate-keeper. by Anonymous Coward · · Score: 0

      I'm not going to reply to your entire message, just the last point.

      It comes do to who was responsible for what. The browsers job is really only to verify that the certificate is valid. It was it has a valid signature from the CA. The CA job was to validate the information on the certificate before issuing it, they failed.

      This is incorrect. The browser, as a FUNDAMENTAL REQUIRMENT FOR SECURITY, has to verify that the certificate provided ACTUALLY belongs to the website that provided it. Just because the certificate is valid doesn't mean anything by itself. I can make a website at www.example.com and provide a certificate for www.apple.com. So when you connect, if all you did was check that the cert was valid, then you would look at the certificate and say "Well, this website says it's apple.com and the certificate is valid", when obviously, it's not apple.

      Also, you actually can't argue that a null character is an invalid character because it's not. The best that you can do is argue that it SHOULD be a null character.

  13. Pascal vs. C: Round 2 by cpu_fusion · · Score: 1

    A debate older than time_t ?

  14. If we were using pascal strings... by argent · · Score: 3, Insightful

    Someone would just get a certificate that managed to put the ".badguy.com" part starting at byte 255 of some string.

    Null is not a legal character in a domain name, even if you're using UTF strings. It shouldn't be allowed in a certificate.

    1. Re:If we were using pascal strings... by QuoteMstr · · Score: 5, Informative

      It's actually rather amusing that people here proclaim Pascal-style strings as the solution to all our woes.

      It's because certificates use ASN.1, essentially a modern-day Pascal string, that these vulnerabilities are possible. If certificates instead were encoded using C-style strings, NULLs wouldn't be an issue.

    2. Re:If we were using pascal strings... by orkybash · · Score: 1

      Right - if the browsers used ANS.1 instead of looking for null, we wouldn't have this problem. If the certs used null instead of reading the string length, we wouldn't have this problem.

      The real problem is that, regardless of what's specified, someone is doing something different. This could happen just as easily if it were the other way around.

    3. Re:If we were using pascal strings... by Anonymous Coward · · Score: 0

      You can just as easily blame it on the c strings. The problem is the interaction, not either string format.

    4. Re:If we were using pascal strings... by Anonymous Coward · · Score: 0

      No, it's because there are multiple string representations. Length+value strings in the application and length+value strings in the interchange format would work. Null-terminated strings in the application and null-terminated strings in the interchange format would also work. Translating between the representations is marginally trickier and has a higher risk of introducing bugs, which may turn out to be security bugs.

  15. Browsers should be written in a modern language by gmurray · · Score: 0

    What modern language would have been open to this attack vector. Browsers are important. They should not be written in c/c++, whatever the performance gains. Lets just not do it anymore.

    1. Re:Browsers should be written in a modern language by QuoteMstr · · Score: 1

      Other languages have different vulnerabilities. There's no substitute for a brain behind the keyboard when writing software that's supposed to be secure.

      Besides, Mozilla-family browsers are mostly written in Javascript, whereas Webkit is a C++ package. Yet somehow kids here consider Webkit interesting and cool, and Mozilla obsolete garbage. I happen to disagree.

    2. Re:Browsers should be written in a modern language by gmurray · · Score: 0

      While Java/.NET and other modern languages are not without security flaws, I don't see how any of their past vulnerabilities can compare to using a language where every single string operation is a chance for a lack of diligence to open an attack vector. I'm not trying to start some kind of holy war here, but it just seems like most of the time we see one of these flaws it comes down to the language providing insecure ways of handling string operations. No doubt it has libraries that allow for safe manipulation, but it requires constant vigilance by the developers to prevent security holes. Developers should be concentrating on the more sophisticated attacks that are possible against these engines, not worrying about how safely they are handling their strings.

    3. Re:Browsers should be written in a modern language by Cap'n+Refsmmat · · Score: 1

      The rendering and networking side of Mozilla browsers are most definitely C++. The JavaScript bit is the user interface side.

    4. Re:Browsers should be written in a modern language by TheRaven64 · · Score: 1

      Besides, Mozilla-family browsers are mostly written in Javascript, whereas Webkit is a C++ package

      Apples to oranges. Compare Safari (mostly Objective-C) to a Mozilla-family browser, or compare WebKit (mostly C++) to Gecko (also mostly C++). There's nothing stopping you from writing a browser in JavaScript on top of WebKit, just as there is nothing stopping you from writing a Gecko browser in C (this has been done).

      Yet somehow kids here consider Webkit interesting and cool, and Mozilla obsolete garbage. I happen to disagree

      No, most people consider Gecko to be crufty, barely-maintainable, code and WebKit to be much cleaner. The fact that WebKit was created largely because Dave Hyatt, a Gecko developer, felt the same way when he was hired to write a new browser, lends some weight to this belief.

      --
      I am TheRaven on Soylent News
    5. Re:Browsers should be written in a modern language by gmurray · · Score: 0

      exactly, since the browser is used for so much of our sensitive network activity, I think we should be using the most secure technologies available to define its code that processes information from the network (pretty much everything). You are essentially running a program that is going to run arbitrary code in a sandbox on your machine. That sandbox MUST be airtight. In an evolving code base I don't think vigilance is enough to keep the sandbox well sealed. Too much is at stake to rely on dilligence. We need to be working at the correct level of abstraction to keep it secure. Its 2009, lets at least remove buffer overflow from the list of potential cracks in the sandbox.

    6. Re:Browsers should be written in a modern language by Homburg · · Score: 1

      I haven't gone and looked at the code, but a program like Firefox that's written in C++ shouldn't be vulnerable to this - C++ strings are not NULL terminated, so shouldn't be vulnerable to this exploit. Either the Firefox developers are using C strings, which they shouldn't do, or they're incorrectly constructing their C++ strings.

  16. Re:When C Strings Attack! Strange replies? by tuomoks · · Score: 1

    Agreed, it is a shame, the null terminated came in C very late in game when byte counting wasn't too expensive any more. I really don't get the replies of only 256 byte (octet?) max length? Pascal (PL/I, Algol, etc) strings can have up to unlimited length depending on language, computer, etc implementation. Any modern(?), intelligent language should be able to handle a continuous string of bytes (mostly octets but even NLS and other "strings") without any terminator or special API, it's so lame! And it is dangerous - my hair is gray fixing programs where the null was overwritten for some reason or where the scanning, input, whatever was depend on some such terminator instead of hardware termination based on length, signal, memory boundary, memory protection, etc.

    Back to the topic, CAs are in business for money, not to make things more secure or so. That's mostly the problem in computing today, you think that security certificates, PCI, even most of other regulations, etc are there to enhance security and I have a bridge to sell. They are there to make money, sell a product, shift the blame, whatever but definitely not for security which is much, much more than just some technology.

  17. Great summary by Bromskloss · · Score: 5, Insightful

    The summary really explained what it's all about, rather than sound like a newspaper who want's you to read more. This is great! Too few summaries are like this. Editors, you should make sure every story get such a good presentation on Slashdot.

    --
    Swedish plasma phys. PhD student; MSc EE; knows maths, programming, electronics; finance interest; seeks opportunities
    1. Re:Great summary by unts · · Score: 1

      Yeah, I didn't even have to RTFM!

    2. Re:Great summary by unts · · Score: 1

      And by that I meant RTFA. I can't even type a one-liner properly for f\0

    3. Re:Great summary by citizenr · · Score: 1

      Too bad thers no PoC or list of vulnerable browsers.

      --
      Who logs in to gdm? Not I, said the duck.
  18. Dan Kaminsky got \0wnd...... by kermitthefrog917 · · Score: 0, Offtopic

    http://r00tsecurity.org/files/zf05.txt search for Dan Kaminsky ......

    --
    I may be wrong but you're downright ugly!
  19. What's the alternative? by mangu · · Score: 1

    Perhaps one should use a ';' to end strings instead.

    Seriously, I would say the problem is not C strings, but the CA *not* using C strings instead. If they properly recognized the null character as a string terminator, they wouldn't issue a certificate for paypal.com to badguy.com.

  20. Paypal.com versus Badguy.com by commodore64_love · · Score: 4, Funny

    I don't get it.

    Isn't this just the same company?

    --
    "I disapprove of what you say, but I will defend to the death your right to say it." - historian Evelyn Beatrice Hall
    1. Re:Paypal.com versus Badguy.com by commodore64_love · · Score: 4, Informative

      P.S.

      Obligatory explanation: In the early 2000s, paypal.com was arbitrarily closing customers' account and keeping the money for themselves. (You can read more detail at paypalsucks.com) After a couple of years of this, the Bush adminstration's FTC investigated, found paypal guilty, and required paypal.com to refund all the money they had taken. Some people received full refunds while others received flat payouts. I was one of those who received a $50 check.

      So long story short - Paypal.com and Badguy.com are synonymous for many people.

      Another action Bush's FTC took was against record companies. They found the companies had created an illegal cartel to pricefix retail sales of CDs (gee what a surprise), and the companies agreed to settle the case by issuing refunds. I received an $18 check, ditto my brother, ditto my mom, and ditto my two nieces. It might take-awhile but eventually the law catches-up to illegal corporate activities.

      --
      "I disapprove of what you say, but I will defend to the death your right to say it." - historian Evelyn Beatrice Hall
    2. Re:Paypal.com versus Badguy.com by QuoteMstr · · Score: 1

      Obligatory explanation: In the early 2000s, paypal.com was arbitrarily closing customers' account and keeping the money for themselves.

      In the early 2000s!? This happened to our organization last week! If you can, avoid Paypal like the plague.

    3. Re:Paypal.com versus Badguy.com by EkriirkE · · Score: 1

      Never link to a bank (check) account, use a CC where you have some power to withhold transactions

      --
      from 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
      to 45 2F 6E 40 3C DF 10 71 4E 41 DF AA 25 7D 31 3F
    4. Re:Paypal.com versus Badguy.com by sortius_nod · · Score: 1

      pretty much what I've done. Deleted my bank account and only use credit/debit cards on it.

      I can't say I've ever had a problem with PP, but that's not to say I won't.

  21. Hardly by Archangel+Michael · · Score: 1

    Web of trust is easy to spoof, provided a certain level of autonomy in the system. All a hacker would have to do is spoof Millions (billions, trillions) of trust relationships making it look like something is highly trusted by lots of people. Suddenly that badbuy.com website looks highly trusted to someone who has never seen it before.

    And what happens when geeks gets a hold of the technology and slashdots the web of trust for Microsoft.com as -1 EvilCorp?

    Let us assume for a second that both the cases above actually occur in a web of trust, how would we correct it? Manual Override? Do you really trust your users to manually override this web of trust?

    So now badguy.com is properly untrusted, but now your user can manually override that trust level. Now what?

    Sorry, I don't want a web of trust, because it is too hard to correct a false positive, or false negative. It would need manual override of the trust relationships to fix broken trusts results and other, who knows what, problems.

    See my sig, it kind of explains things.

    --
    Agent K: A *person* is smart. People are dumb, stupid, panicky animals, and you know it.
  22. Defense-in-depth by davidwr · · Score: 2, Informative

    Yes, the CAs should have clear standards on what they can and cannot issue a certificate for.

    However, browser makers need to assume some CAs will issue non-compliant certificates.

    They should also assume some compliant certificates will be confusing to end users, whether it is because of a look-alike character, such as 1/l/!, 0/O, or many such UNICODE pairings. This applies not just to certificates but also second-level domains where an authoritative server run by badguy.com might return an address for a domain that uses characters that are supposedly illegal.

    In any case, web browsers need to flag these things and make it obvious the address or certificate isn't what it appears to be.

    Finally, end-user need to be educated that login.paypal.com is not the same as login.paypal.com\0.badsite.com or !ogin.paypa!.com or 1ogin.paypa1.com.

    Somehow I think the latter may be a lost cause with some people.

    --
    Knowledge is how to play a game, intelligence is how to win, wisdom is knowing what game to play.
  23. What if they could be sued? by wfstanle · · Score: 1

    Yes, they are in it to make money, but would they be as careless if they could be sued for any losses due to their negligence? (I am also including MS for all its security flaws.)

  24. Re: by clint999 · · Score: 0

    The CA issued a malformed Cert. The browser (firefox) did not catch the malformation. Who is to blame? Both I would think.

  25. Qwerty syndrome by Anonymous Coward · · Score: 0

    There are lots of terrible old technologies that are still in use precisely and only because they're in common use. Yes, XML (yes you probably knew I was going to say this when you read the subject line, let's get it over with quickly and move on) may be the worst possible cross between human readable (it isn't, at least not for large files) and machine readable (complex and bug inviting, as many security advisories have shown), but whole forests of tools have been written around it, most of which simply won't accept anything else. Yes, HTML may be a bastard of XML and SGML with corprus, complete with style sheets and scripting using yet another completely different syntax, but browsers want it so if you want people to read your site, you have to use it. Yes, Windows' user interface pseudo object oriented system may not be elegant, and even Microsoft would like to change over, but lots of software is written for it so we keep going down this road, piling up organic extensions. It's like we're all locked in a deadly embrace, a grim fandango of mutual dependency.

  26. slashd\0t meme by w0mprat · · Score: 1

    I'm l\0\0king forward to using the new slashd\0t \0wnzrd meme. (I've never witnessed the birth of a meme before, wow!).

    --
    After logging in slashdot still does not take you back to the page you were on. It's been that way for 20 years.
    1. Re:slashd\0t meme by Anonymous Coward · · Score: 0

      I was there for the birth of "The Japanese agricultural ministry is not in charge of Gundam;" which would have derived down to, "The Japanese agricultural ministry is not in charge of %whatever" or "%whatever is not in charge of Gundam."
       
      Sadly, it never took off (despite my efforts to establish it). This \0ne is easier t\0 type th\0, s\0 it might w\0rk.

  27. VeriSign Responds to Black Hat by VeriSign+Allen · · Score: 4, Informative

    Tim Callan, vice president of product marketing at VeriSign, responds (in more detail) to these Black Hat presentations in his new SSL blogpost: https://blogs.verisign.com/ssl-blog/2009/07/busy_day_at_black_hat.php He fills some of the holes that Marlinspike and Kaminsky dug.

  28. Firefox 3.5 is _not_ vulnerable by dveditz · · Score: 1

    Firefox 3.5 is _not_ vulnerable to this attack.

    1. Re:Firefox 3.5 is _not_ vulnerable by yossarianuk · · Score: 1

      do you have a source for that ? (I may bother to upgrade,,,)

    2. Re:Firefox 3.5 is _not_ vulnerable by jd · · Score: 1

      Probably Netcraft. It's where Slashdotters find out where everything else is dead.

      --
      It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
    3. Re:Firefox 3.5 is _not_ vulnerable by TheCabal · · Score: 1

      I sat in on his presentation at Vegas, he said that Firefox 3.5 was NOT vulnerable.

  29. Re: by Tacvek · · Score: 1

    Yes. The browser is a fault for treating an ASN.1 string as a null terminated string.
    The CA is at fault for issuing a certificate for a domain that does not exist, and in fact is not even legal under the domain name system.

    (Yes the second level domain does exist, but the company would not sell me a cert for some non-existant second level domain merely because the .com TLD exists.)

    --
    Stylish sheet to fix many problems in Slashdot's D3: https://gist.github.com/801524
  30. No, CAs aren't that stupid.... by nafrance · · Score: 1

    ...mostly.
    Verisign (& presumably the rest of their group - Thawte, Geotrust) and Comodo didn't issue it - their systems never allowed null characters in subjects.

    Some evidence so far (as this isn't the first time it's come up, just the first to be published like this and as with so much at Blackhat, sensationalised) points to Globalsign as the issuing CA, although I'd be surprised if they hadn't fixed it by now.

  31. Re:When C Strings Attack! Strange replies? by Desler · · Score: 1

    I really don't get the replies of only 256 byte (octet?) max length? Pascal (PL/I, Algol, etc) strings can have up to unlimited length depending on language, computer, etc implementation.

    Because Pascal strings stored the length in a single byte and that single byte could only represent an unsigned integer up to 2^8 - 1 or 255. Hence the comments about pascal strings and 255 character lengths.

  32. gentlemen that reminds me... by ei4anb · · Score: 3, Interesting

    of the day I found a similar exploit in IE6. During a pentest I noticed that a company had a password reset site with a url like "passwordedit.info.example.com" so I regestered "passwordedit.info" and sent e-mails to some employees saying "your password will soon expire, please go to passwordedit.info.example.com and change it". However the 'e' in "example" was a Unicode character thet looked/displayed like ASCII 'e' but was not.
    The trick was that IE stopped parsing the url at the bogus 'e' and went to "passwordedit.info" (my site) while displaying "passwordedit.info.example.com" in the url bar.
    My site recorded the new passwords while forwarding the change request to the real site
    IE6 was fixed and no press release was made (we are discreet)
    domains and URLs have been changed to protect the guilty

  33. Re:When C Strings Attack! Strange replies? by Anonymous Coward · · Score: 0

    Any modern(?), intelligent language should be able to handle a continuous string of bytes (mostly octets but even NLS and other "strings") without any terminator

    Seriously, what the fuck are you babbling about? A "continuous stream of bytes" is garbage without a well-defined prefix or terminator.

  34. ObjectPascal/Delphi blew away MSVC++ in strings by Anonymous Coward · · Score: 0

    "I miss pascal strings, where the first byte was the length of the string. It had lots of cool advantages in situations like this over C's null terminated strings." - by OrangeTide (124937) on Thursday July 30, @02:48PM (#28885923) Homepage

    IF you liked that? You MIGHT like this little tidbit of information... especially regarding STRING PROCESSING SPEED, of Delphi (Object Pascal), vs. MSVC++ &/or VB:

    ODDLY? This was from a COMPETING language's trade rag, VBPJ -> In "Visual Basic Programmer's Journal", Sept./Oct. issue 1997, when I was a VB5-6 &/or MSVC++ coder primarily, in the issue entitled "INSIDE THE VB5 COMPILER"? Delphi, oddly considering this was a competing language trade rag, absolutely WHOOPED both VB5 &/or MSVC++ 5 in 7/10 tests performed (to test programmatic speed & efficiency)!

    Especially in MATH and STRINGS work, blowing away VB5 in speed here, by MANY ORDERS OF MAGNITUDE no less, & beating even MSVC++, by double (which, mind you, EVERY PROGRAM DOES both strings & math work) literally 'taking me away' from, or rather, replacing my former favs in MSVC++ & VB, as my "weapon of choice" for building programs...

    (Some "Food 4 Thought"...)

    APK

    P.S.=> Of course, I expect the C/C++ & other competing language fiends to come in & try to disprove this, & that's ok (I program in the others as well & "right tool for the right job" etc. et al), but, I am looking back @ that article now (have the issue in front of me in fact) & just remembering how it influenced me to try Delphi (which I love versions 2.0 - 7.1, before it went .NET) - I thought YOU might find this interesting OrangeTide, & why I put it up for you to read here! apk

    1. Re:ObjectPascal/Delphi blew away MSVC++ in strings by Anonymous Coward · · Score: 0

      Fuck off Troll.

  35. Re: by KagatoLNX · · Score: 1

    Note that certs can and are used for things other than SSL on DNS names. In fact, the field used for the domain name is "Common Name". The CN field is used for a dozen things depending on what the cert is used for.

    We should probably blame Netscape and everyone else who pushed using X.509 unchanged instead of trivially adding a field that required a valid DNS name.

    This is a mismatch between the X.509 standard and how browsers use it. Most interesting is that the browsers have the information to correctly parse it, whereas the CAs don't have the information to do so, unless they are only issuing certs for SSL. As someone who would like to see widely usable PKI outside of the web-browser, I'd really rather fix the browsers than break the certs.

    --
    I think Mauve has the most RAM. --PHB (Dilbert Comic)
  36. Yes, but by dhammabum · · Score: 1

    It is good that Verisign have taken steps in their own baliwick to deal with illegal characters in their certificates, but their practices, including EV Certificates, won't stop other CA's from spoofing anyone's certificate, including Verisign. No holes are filled. This is a system-wide problem that must be fixed at the browser level.

    --
    I am not a robot. I am a unicorn.
  37. Protect the Guilty? Discreet? Nice Job!! by iYk6 · · Score: 1

    IE6 was fixed and no press release was made (we are discreet) domains and URLs have been changed to protect the guilty

    Exactly how does hiding the domains and URLs protect the guilty? We all know who makes IE6. And how can you call yourself discreet while posting the story on Slashdot and naming the guilty party?

    1. Re:Protect the Guilty? Discreet? Nice Job!! by JimboFBX · · Score: 1

      I'm going to take a guess and say its the company where he *used* to work

  38. Re:When C Strings Attack! Strange replies? by tuomoks · · Score: 1

    Yes, theoretically it is correct as Pascal strings are defined / described. This is an ages old argument but many languages (many "Pascals") have "strings" which have a descriptor or length not limited to 256, the programmer just doesn't have to take care of it. And they have no separate API or whatever for different "strings", mostly they are actually just handled by compiler. The pain of delimiters is bad, have to have another class or whatever to handle strings as continuous memory (the implementation may be whatever as in Haskel, etc.) And especially with Unicode or for example protocol stream it means scanning everything, every time instead of letting hardware to do it's work - great for one (maybe) but when talking thousand and thousands at the same time it eats cpu cycles which, especially in interface controllers, are already used too much.

    There are special hardware solutions but they are not very common, computers still (mostly) work on bit level (there are exceptions). The delimiters are bad even other way, what is a delimiter for one class of data is / may not be a delimiter but data in another class of information so transformations can get sometimes tricky if data can not be trusted - most common have been overflows of zero limited strings and/or terminators in protocol strings. Or zero and here and maybe the the non-breaking space in HTML or whatever.

    Actually I like C (and assembler) because of the power over code, but it definitely needs more code and more caution to use strings in those languages than in Pascal, PL/I, ADA, and other languages where strings are transparent (not Pascal strings as defined). Many interpreted languages can handle strings without terminator so.. All high level languages should (IMHO) have a class of string which is transparent in compiler, not some ever changing API, proven going from one octet to multiple for Unicode, etc - old (new?) style just doesn't seem to work too well - causes problems as this.

  39. Quick Fix for CAs? by Lieutenant_Dan · · Score: 1

    Scan your databases for FQDs for issued certs with the null string. Then revoke them.

    Then go after the people who requested them and ask for an explanation.

    --
    Wearing pants should always be optional.
  40. Well I like Python so we should use Python strings by Anonymous Coward · · Score: 0

    Saying that the solution to this is a better string type is like enforcing no-trucking routes by putting hairpin turns everywhere. Programmers shouldn't let any old crap into their system, that is how you get hacked. Period.

    But as long as we're arguing over who's programming language is better: we should all program in ZT
    http://www.philipp-winterberg.de/software/zte.htm

  41. Hmmm... by Kingrames · · Score: 2, Funny

    Would this mean that there's a similar site out there called Slashnaught.org?

    Or would that be Slashdot's good twin?

    --
    If you can read this, I forgot to post anonymously.
  42. you are an idiot by Anonymous Coward · · Score: 0

    Then go use Delphi instead of spewing drivel with randomly capitalized words.

    Delphi is Pascal, and the poster said he liked the way pascal handled strings (something about many advantages) over the way C does them. Why the fuck are you going on some sort of crazy rant over it when he essentially agreed with you (without using CRAZY TINFOIL HAT CAPS)

  43. Moxie at Black Hat by TheCabal · · Score: 3, Informative

    Moxie's presentation was very enlightening. Out of all the presentations I saw over the last two days, his was easily the most interesting.

    First, he went over his last presentation- that due to CA sloppiness, it is possible for an attacker to issue valid SSL certificates as an intermediary CA. No hack involved.
    Second, the null character exploit. This was the bulk of his presentation, and he went into detail why this works, and why Firefox pre-3.5 plus a bunch of other SSL stacks are vulnerable. Dont want to get a cert for every site you want to spoof? Get a wildcard \0 cert.
    Third, it is possible to defeat OCSP with the number 3.
    Fourth, he demonstrated how, due to these bugs in SSL and OCSP, it is possible to deploy your own "software updates" whenever Firefox or other program attempts to auto-update.

    I hope he puts his presentation up sometime soon.

    1. Re:Moxie at Black Hat by sp332 · · Score: 1

      You can find the archives of the talks here http://www.blackhat.com/html/bh-usa-09/bh-usa-09-archives.html , including Moxie's presentation and a video of his talk.

  44. Ownership? by fearlezz · · Score: 1

    [q]using contact information from Whois records, sends him an email asking to confirm his ownership of the site.[/q]
    I've requested several SSL certificates over the years. Never ever have I received such an email to confirm ownership, nor was I pre-confirmed as the domains were registered elsewhere. Okay, so the CA was not netsol or thawte. But it sure was a CA that was acknowledged by both MSIE6/MSIE7/MSIE8/FF2/FF3

    I don't see a reason why my CA wouldn't simply hand me a valid cert for paypal.com, no technical stuff, anyone can do this. Okay, my cert would probably be revoked as soon as someone finds out, but by then the damage could be millions...

    --
    .sig: No such file or directory
    1. Re:Ownership? by julesh · · Score: 1

      I've requested several SSL certificates over the years. Never ever have I received such an email to confirm ownership, nor was I pre-confirmed as the domains were registered elsewhere. Okay, so the CA was not netsol or thawte. But it sure was a CA that was acknowledged by both MSIE6/MSIE7/MSIE8/FF2/FF3

      Which CA do you use? Every one I've ever used has performed domain control validation, and it's supposed to be a standard step in processing a request for a cert.

    2. Re:Ownership? by fearlezz · · Score: 1

      I prefer not to say, criminals are reading /. as well.

      --
      .sig: No such file or directory
    3. Re:Ownership? by julesh · · Score: 1

      I prefer not to say, criminals are reading /. as well.

      I strongly suspect the criminals already know. The rest of us can remove the CA from our list.

  45. No you are, an uneducated idiot at that... by Anonymous Coward · · Score: 0

    "and the poster said he liked the way pascal handled strings (something about many advantages) over the way C does them" - by Anonymous Coward on Thursday July 30, @11:09PM (#28891981)

    Do you know WHY it is nicer and what advantage is yielded by knowing the length of a string beforehand (which is what the poster noted, NOT how it helps speed though)?

    I severely doubt you do, so I will tell you 1 gain:

    In knowing the size of a string, you avoid having to send 2 pointers thru a string, one always being DOUBLE the size of the other (& when the doublesized larger one can no longer advance, you are @ the midpoint of a string on the smaller one, which that midpoint in turn, can be doubled to get the length of an unknown length string)

    So - that added "pointer send" processing is avoided TOTALLY w/ pascal strings though & a gain results right there via avoiding having to do that kind of processing (which you WOULD have to do on a null terminated C string)

    Also - this knowledge, the midpoint of a string, or its length, does yield the ability to find other things faster... (like for searches, specifically BINARY SEARCHES, it helps to know the midpoint of a string (& for speed of said searches)).

    ----

    "Then go use Delphi instead of spewing drivel with randomly capitalized words." - by Anonymous Coward on Thursday July 30, @11:09PM (#28891981)

    Will do. I will, because it is faster than most other compilers in most things!

    I'll use it, alongside VB.NET & C# (Visual Studio 2005), VB 3-6, MSVC++, Leahy Fortran 77, Microsoft Macro Assembler, Ryan McFarland COBOL, & others on the PC (I program in 8-10 languages for the PC, & more for midrange & mainframe computers... I use whatever language is best suited for the tasks @ hand is all, & they do each have their merits/strengths over others @ times, depending on what is needed to be done).

    Somehow, though, just based on the stupidity in your replies (including your "Fuck off Troll" reply)?

    I doubt you code in even 1 language, or realize what I just wrote now... lol!

    ----

    "instead of spewing drivel with randomly capitalized words." - by Anonymous Coward on Thursday July 30, @11:09PM (#28891981)

    If my post is such drivel and so poorly written, then how could you understand it?

    ----

    "Delphi is Pascal" - by Anonymous Coward on Thursday July 30, @11:09PM (#28891981)

    Yes, it is... you MUST be a "genius" (that, or you read it back & spit it out, which is about ALL you know of the art of programming I wager).

    ----

    "Why the fuck are you going on some sort of crazy rant over it when he essentially agreed with you (without using CRAZY TINFOIL HAT CAPS)" - by Anonymous Coward on Thursday July 30, @11:09PM (#28891981)

    The poster I replied to in OrangeTide never mentioned speed gains - I do, first of all... learn to read & COMPREHEND what you read!

    And, there is nothing crazy in informing OrangeTide about what I wrote, as he may not have been aware that Delphi DOUBLES MSVC++ in string processing speeds and completely blows away VB by many orders of magnitude in the same (string work).

    Anyhow/anyways - Thus endeth the lesson for today... (even to a rude unintelligent & obviously uneducated goof, like you)

    APK

    P.S.=> You can stop following me around as you have all this month & modding me down or wising off to my replies... you look foolish doing so - &, it appears you have run out of mod points, finally, because you are unable to "mod down" my post here (as you have been doing all month to many of my posts here)... awwww, poor little AC troll ran out of his other registered sock puppet accounts mod points & now he is furiously raging spewing his anger on the page in his weak replies, lol! apk

  46. You're off-topic and a profanity spewing troll by Anonymous Coward · · Score: 0

    "Fuck off Troll." - by Anonymous Coward on Thursday July 30, @11:01PM (#28891931)

    See my subject-line above, & this url -> http://it.slashdot.org/comments.pl?sid=1320775&cid=28895275 , which is in regards to your other stupid reply here, as well...

    (You are off topic, & a trash mouthed troll, period, or doesn't my quote of you above illustrate that much? My other post, in the URL I just posted above, will function to show how stupid & undereducated you are in this art & science of computing, also...)

    APK

    P.S.=> It also appears that your other 'sock puppet' registered accounts with which you have been "modding me down with", are ALL OUT OF MOD POINTS, eh? Now, all you have, is your profanity & stupidity to attack me with, which is JUST HOW I LIKE IT, lol... because it is SO SIMPLE to "tear you apart" with those, it is not even funny anyhow... better luck next time, troll! apk

    1. Re:You're off-topic and a profanity spewing troll by Anonymous Coward · · Score: 0

      Disregard THAT. I suck COCK.

      APK

      P.S.=> My Daddy's.

  47. "eventually the law catches-up" by Anonymous Coward · · Score: 0

    only in the U.S. and a handful of other countries.

    Most other places, it's how you get rich.

  48. you're missing information by Anonymous Coward · · Score: 0

    have fun trying to register a real domain name with a : / or " in it. It simply cannot be done.

    there is a protocol layer and there are limitations placed by ICANN on your TLD.

    1. Re:you're missing information by julesh · · Score: 1

      have fun trying to register a real domain name with a : / or " in it. It simply cannot be done.

      there is a protocol layer and there are limitations placed by ICANN on your TLD.

      Yes, but you can put whatever you want in your subdomains, which is what this attack was based on, without having to follow ICANN's rules.

  49. weird that they both came up with this - same time by zukinux · · Score: 1

    "Two researchers, Dan Kaminsky and Moxie Marlinspike, came up with exact same way to fake being a popular website with authentication from a certificate authority."

    Here's what happened : Moxie Marlinspike found this and sent his boss a message through his website, but the problem was, Mr. Kaminsky had tried his DNS poisoning on that website and all the traffic went through Kaminsky. Kaminsky afterward declared that he had found a way to do it :)


    Of-course I'm j/k but Dan is a genius and can do it :)

  50. Re:When C Strings Attack! Strange replies? by nobaloney · · Score: 1

    Agreed, it is a shame, the null terminated came in C very late in game

    C doesn't implement strings. All implementations of C that I know of implement libraries that make it possible to use strings in C.

    But there's nothing to stop you from linking to your own library.

  51. Impersonating me's not very original, been done by Anonymous Coward · · Score: 0

    Yup. Having to resort to try to impersonate me. Figures. Not very original trolling either, as "it's been done" already here before. And the use of profanity (along with your twisted ideas, lol) is "not my style" either.

    APK

    P.S.=> Not even a "nice try" on my std. "trollometer" here - try be more original next time... apk

  52. Funniest part of this was this (strlen) by Anonymous Coward · · Score: 0

    I was hoping that this dolt would bring up the std. string functions libs that MOST C/C++ compilers have, one function of which, is StrLen -> http://www.cplusplus.com/reference/clibrary/cstring/strlen/

    (HOWEVER, because I waited on it, & he has NOT produced that? Well, his lack of putting up that simple function is merely just proving my words, that the fool I replied to is nothing more than that -> A trolling dunce who is someplace he does NOT belong in, messing w/ his betters...)

    I gave it a few days, & he has not recognized that much... & instead, he gave me more really WEIRD guff trolling me instead, here -> http://it.slashdot.org/comments.pl?sid=1320775&cid=28916873

    (LOL, what a freak he is, ontop of being stupid in coding & yet he had the nerve to try sound off on it here - anyhow/anways, lmao -> Hey, you read that url above, & YOU decide for yourselves, ontop of my being patient & waiting to see IF HE KNEW ABOUT STD. STRING FUNCTIONS!)

    APK

    P.S.=> Yes, you CAN/COULD use the method I extolled using pointer math++ operations in C++, but as I suspected (and yes, stated? The AC troll I am replying to, does indeed, not know a thing about coding, period, else he would have brought that up instead of my more "primitive method" that's doubtless behind the strlen functions in most null terminated strings C/C++ std. libs for strings (string.h file, specifically)... apk