Slashdot Mirror


New Crypto Attack Affects Millions of ASP.NET Apps

Trailrunner7 writes "A pair of security researchers have implemented an attack that exploits the way that ASP.NET Web applications handle encrypted session cookies, a weakness that could enable an attacker to hijack users' online banking sessions and cause other severe problems in vulnerable applications. Experts say that the bug, which will be discussed in detail at the Ekoparty conference in Argentina this week, affects millions of Web applications."

156 comments

  1. Re:Who knew! by axx · · Score: 1

    This is /. aren't you supposed to say "What a surprise, .NET has flaws!" ?

    --
    No wit here.
  2. Nyuck Nyuck by Anonymous Coward · · Score: 0

    I never could find how session ids were generated, suffice to say I didn't trust MS to implement them properly.

    I ended up rolling my own session management in "old asp" using a COM wrapper to crypto api for access to the RNG + hashing functions, and allowed for a SQL backend, so we could run load-balanced servers and still have a session. I would do an application-key hmac on the output of the RNG (which I also didn't trust), concatenated with a knowable, sequential, unique part.

    I don't use ASP anymore.

    1. Re:Nyuck Nyuck by lwriemen · · Score: 1

      OK, but why are you using Windows if you don't trust Microsoft?

  3. Oh come on... by santax · · Score: 2, Funny

    Just give us the exploit!

    1. Re:Oh come on... by mcgrew · · Score: 1

      That's why I never bank over the internet, and do as little online buying as possible. If I have to buy online I use a prepaid credit card.

      So while this is interesting to me, I'm in no danger.

    2. Re:Oh come on... by Anonymous Coward · · Score: 0

      Yeah, it's way safer to give your CC to the clerk so he can easily scan it and copy your card.

    3. Re:Oh come on... by LordArgon · · Score: 1

      I wouldn't say no danger. I don't understand why people think that not using their info online means nobody can access their info online. If your data is stored anywhere, there's a good chance some sequence of events could leak it.

      That said, you've probably reduced your vulnerable surface area, but don't get too confident; incompetence comes in all forms, many of which are probably handling your (and my) data.

  4. Not so bad after all... by EvilRyry · · Score: 4, Informative

    >If the padding is invalid, the error message that the sender gets will give him some information about the way that the site's decryption process works.

    This is one reason you should send user friendly error messages to your consumers instead of stack traces, stack traces can contain details that an attacker could use against you. It sounds like you're safe if you're following best practices already.

    1. Re:Not so bad after all... by Mongoose+Disciple · · Score: 1

      Exactly. If the web devs are incompetent enough to let an end user see a stack trace error message, you've got much bigger problems than this hack. Professionally, it's about the equivalent of setting your root password on a machine to 'password'.

    2. Re:Not so bad after all... by Neil+Watson · · Score: 1, Redundant

      > Professionally, it's about the equivalent of setting your root password on a machine to 'password'.

      That certainly never happens.

    3. Re:Not so bad after all... by nametaken · · Score: 1

      If the attacker requires the stack trace, I feel better about this already. Is that a requirement of this exploit?

      While I do see unhandled exceptions kicking stack traces to remote clients far too often, at least I know I've always covered that.

    4. Re:Not so bad after all... by KarmaMB84 · · Score: 3, Informative

      The attack apparently relies on analyzing errors thrown by the application. If an app wraps everything in a try-catch and only rethrows if the app is in development and a generic error message to the public, it's doubtful they could ever pull off an exploit.

    5. Re:Not so bad after all... by johann21 · · Score: 1

      > This is one reason you should send user friendly error messages to your consumers instead of stack traces...

      Right, and isn't the default CustomerErrors setting in ASP.NET set to RemoteOnly? Meaning that that the exception & stack trace are only sent when you are browsing from localhost? If you were dumb enough to send full errors from a production system, then you deserve to have your application exploited by this.

    6. Re:Not so bad after all... by Mongoose+Disciple · · Score: 2, Informative

      You are correct. (I think the property's called CustomErrors, but otherwise you're dead on.)

      You'd have to manually decide you wanted your end users to see unfriendly error messages for the exploit as described to work. In other words, being negligent isn't sufficient for this to work -- you need to do something actively stupid.

      I believe the same is true for the JSF exploit this is based on, but it's been a year or two since I've touched JSF at this point.

    7. Re:Not so bad after all... by owlstead · · Score: 1

      Not so, you are forgetting side channel attacks, in particular side channel attacks based on computation time.

      I.e. different exceptions thrown at different locations will take a specific amount of time, which can be leaked and used by performing statistical analysis.

      Sounds far fetched, but it works beautifully in practice. Of course, it is still way better than throwing stack traces around.

      Oh, and make sure the user gets an easy to understand message and that the server *logs* the exception.

    8. Re:Not so bad after all... by Abcd1234 · · Score: 1

      Not so, you are forgetting side channel attacks, in particular side channel attacks based on computation time.

      Yeah, but those are a *hell* of a lot harder, and are subject to noise from network jitter, server load, and other variables. The odds of being able to deduce the crypto keys in a reasonable amount of time drop substantially in that case, as you need a lot more requests to smooth out that variability.

    9. Re:Not so bad after all... by owlstead · · Score: 1

      It's hell of a lot harder, but once the statistical analysis is in place and the right conclusions can be retrieved from them (setup a server and perform tests locally) the computer will do the job. But yes, it will take an awful amount of requests, for practicality a bot net will probably be needed.

    10. Re:Not so bad after all... by Anonymous Coward · · Score: 1, Insightful

      There is no reason for an application to do that. ASP.NET already does that by default. If an exception occurs the user is presented with a friendly error message that basically says, "something went wrong, try again later." The full error message is written into the logs on the server and can be reviewed by an admin. Said admin can also browse to the site via localhost to get the full error message as it occurs, something remote users will not see.

      This "exploit" relies on the "bank" deploying the site to store sensitive information in cookies that are handed off to the browser and for the admin to have changed the settings to pass full exception information to remote users. If you know a financial institution that does either, let alone both, avoid doing business with them or anyone they might be associated with at all costs.

    11. Re:Not so bad after all... by Anonymous Coward · · Score: 0

      "If the padding is invalid, the error message that the sender gets will give him some information about the way that the site's decryption process works"

      Crypto timing attacks do not need stack traces. "The information about the way crypto works" is not necessarily explicit text, it can be a measurable latency difference (hence the thousands of requests necessary to find the key).

      It's a bit frustrating to see so many clueless programmers comment a genuine security hole without any understanding of how things work.

    12. Re:Not so bad after all... by Anonymous Coward · · Score: 0

      Are we really sure we need verbose error messages?

      If you look at the Blackhat presentation on the generic vulnerability, in particular slide 16 (PDF page 33) it seems to indicate otherwise:

      http://netifera.com/research/poet/PaddingOracleBHEU10.pdf

    13. Re:Not so bad after all... by Anonymous Coward · · Score: 1, Insightful

      Just to expand a litle:

      "See if there is any error message. Even a blank page is enough information."

      Makes me think that this may be an issue after all

  5. when it comes to anything important: by Kristopeit,+M.+D. · · Score: 0, Troll

    roll your own at the lowest possible layer. anything else and you're leaving your chin open.

    1. Re:when it comes to anything important: by TheNinjaroach · · Score: 5, Insightful

      roll your own at the lowest possible layer. anything else and you're leaving your chin open.

      I don't know about that. I'm not out to write my own implementation of OpenSSL anytime soon. Some tasks are simply best left to field experts.

      --
      I went to eat some animal crackers and the box said, "Do not eat if seal is broken." I opened the box and sure enough..
    2. Re:when it comes to anything important: by Anonymous Coward · · Score: 0

      When it comes to encryption, this is widely regarded as a really, really bad idea. Leave encryption to the experts.

    3. Re:when it comes to anything important: by Anonymous Coward · · Score: 1, Insightful

      I originally modded you funny, but I'd like to retract and mod you "scary".

      Now you could implement HMAC using other OpenSSL primitives, and that would be less than the highest possible level. But you WOULDN'T DO THAT!

      When it comes to crypto, use the highest possible layer. I've never used ASP, and i'm rather glad, but before now I would have guessed it exposed encryption libraries to allow you to send a session cookie over HTTPS/HTTP only.

    4. Re:when it comes to anything important: by Anonymous Coward · · Score: 0

      A wise man knows what he doesn't know. If you know enough about cryptography to make a good implementation, then your job does not involve writing web applications.

    5. Re:when it comes to anything important: by M.+Kristopeit · · Score: 0
      i'm a systems engineer. i develop web applications that are not broken into.

      the wisest man knows everything he needs to know.

      you're an idiot.

    6. Re:when it comes to anything important: by jpapon · · Score: 3, Insightful

      If you know enough about cryptography to make a good implementation, then your job does not involve writing web applications.

      Very true, but there's no point in feeding trolls, they never get full.

      --
      -- Let us endeavor so to live that when we pass even the undertaker shall be sorry. -- M. Twain
    7. Re:when it comes to anything important: by Thud457 · · Score: 1

      Typical slasdot "jack of all trades, master of all "

      Wait, that's not how the saying goes...

      --

      the preceding comment is my own and in no way reflects the opinion of the Joint Chiefs of Staff

    8. Re:when it comes to anything important: by Anonymous Coward · · Score: 0

      M. Kristopeit (1890764) writes: Alter Relationship on Monday September 13, @01:39PM (#33563164)

      i'm a systems engineer. i develop web applications that are not broken into.

      the wisest man knows everything he needs to know.

      you're an idiot.

      lol who's an idiot? God you need some new material, I'm guess you got tired of saying "Invented by Shampoo" eh?

      So Mr. Non-idiot, what are the web applications that you've developed that no one here can break into? Inquiring idiotic minds would like to know.

    9. Re:when it comes to anything important: by iamhigh · · Score: 1

      Where's the "back to 4chan" mod?

      --
      No comprende? Let me type that a little slower for you...
    10. Re:when it comes to anything important: by AusIV · · Score: 1

      Here's the thing: In the working world if you roll your own implementation and your implementation gets compromised then you can probably expect to be fired. If you use a widely deployed, standard implementation and that implementation gets compromised you not only have someone to blame, but your employer would have a hard time finding someone to replace you that wouldn't have made the same mistake.

    11. Re:when it comes to anything important: by Kristopeit,+Michael · · Score: 0
      agreed. so you just have to not implement anything that can get compromised.

      it isn't hard.

    12. Re:when it comes to anything important: by Anonymous Coward · · Score: 0

      jesus tittyfucking christ Michael D. Kristopeit! what is this, 57 accounts you've registered so far in your clearly insane paranoia over being moderated?

      lets see:
      http://slashdot.org/~Michael+Kristopeit
      http://slashdot.org/~madddddddddd
      http://slashdot.org/~Michael+D+Kristopeit
      http://slashdot.org/~Kristopeit%2C+Michael
      http://slashdot.org/~Kristopeit%2C+M.+D.

      and I'm just sure you have plenty others, don't you?

      the reason everyone mods you down Michael D. Kristopeit, is because nobody wants to hear what you have to say.

      you know why? because you are NOTHING.

      the hilarious part is you seem to think this is all some conspiracy, but can never help but to sink to mere childish insults. you have the self-control of a retard at a petting zoo.

    13. Re:when it comes to anything important: by Anonymous Coward · · Score: 0

      Precisely.

      And for the general edification of those new to Michael David Kristopeit's antics, you'll probably want to know that he is an ugly fucker too.

    14. Re:when it comes to anything important: by Mike+Kristopeit · · Score: 1
      certainly there is SOMEONE that wants to hear what i have to say... if not, why would you assume anyone would want to hear you say nothing except that i am not worth listening to? if no one wanted to read it, then why would you believe anyone would want to read your response? do you believe i'm forcing people to read what i write? i assure you, i'm not. believing otherwise would be believing that this is all some conspiracy where i have the power to control others... which again would be ignorant and hypocritical. by the way, the medium i'm utilizing is the written word, which is read, not heard... so whether or not anyone "wants to hear" is irrelevant... and as i'm writing and not speaking, you have not yet established i am even capable of saying anything, as i have said nothing. i'm beginning to lean towards your idiocy, moron.

      perhaps SOMEONE ELSE YET is indifferent about reading what i write, but would rather wish OTHERS not to read what i write... "hearing what i have to say"... perhaps that someone or group of someones have something to gain by lying or misrepresenting facts and attempting to discredit others instead of providing facts of their own. perhaps you fall into that category, idiot.

      i HAVE more accounts, because I CAN have more accounts. it's a flaw in the system. slashdot's moderation system is based on the assumption that 1 person = 1 user... limiting posting abilities and distributing moderation abilities so no one user has a "reign of terror"... yet they do ABSOLUTELY NOTHING to ensure 1 person = 1 user. until that obvious hole is closed, i will utilize the abilities it provides me. not doing so would be ignorant.

      you are a coward that is unable to form an argument without taking a named god's name in vain, using top tier obscenities, referencing non-intercourse sex-acts with the female anatomy, and insulting the mentally handicapped... and then hypocritically claiming lessor acts are "mere childish insults."

      you are NOTHING.

      ur mum's face have the self-control of a retard at a petting zoo.

    15. Re:when it comes to anything important: by Anonymous Coward · · Score: 0

      I hear you fuck your mum's tooth gap.

      you are NOTHING.

    16. Re:when it comes to anything important: by Mike+Kristopeit · · Score: 1
      i am michael kristopeit... YOU are nothing, coward.

      post your address... or are you afraid of the repercussions of your actions?

      action without responsibility is not action.

      you're an idiot.

    17. Re:when it comes to anything important: by Anonymous Coward · · Score: 0

      i am michael kristopeit...

      you say it like it means something. always remember, you are NOTHING.

      action without responsibility is not action.

      so why u mad?

    18. Re:when it comes to anything important: by Mike+Kristopeit · · Score: 1
      ur mum's face is mad, coward.

      i OWN you.

    19. Re:when it comes to anything important: by Anonymous Coward · · Score: 0

      yep. u mad.

    20. Re:when it comes to anything important: by Kalriath · · Score: 1

      You're right. It isn't hard.

      It's fucking impossible.

      --
      For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
    21. Re:when it comes to anything important: by Kalriath · · Score: 1

      Micheal, has it occurred to you that people mod you down because you're a fucking asshole, who can't post a single thing without calling the other person an idiot?

      Go fuck yourself.

      (And more importantly, building something that cannot be compromised is impossible. There is always someway, it just may not have been thought of yet).

      --
      For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
    22. Re:when it comes to anything important: by Anonymous Coward · · Score: 0

      Shush. We don't want him either. You keep him.

      - Anonymous

  6. Patch? by Anonymous Coward · · Score: 0

    When will MS release a patch for this? This could be really, really bad. I think it still requires that an attacker capture a cookie in order to steal the session, but not totally sure about that?

    Anyone know just how serious this is?

    1. Re:Patch? by Anonymous Coward · · Score: 2, Interesting

      Default ASP.NET credentials are basically a signed username with an expiration date. So if an attacker can figure out your encryption, they should be able to change their identity. So user "Joe Bob" should be able to become user "Super Admin" by decrypting his cookie, editing his user id, and re-encrypting it.

    2. Re:Patch? by UnknowingFool · · Score: 1

      My understanding is that it allows an attacker to masquerade as another user. So if they can intercept your network (like public wifi) they can intercept your session and pretend to be you. If you've decided to pay your bills online at the local cafe for example and forget to signoff, they can take your session and start making their own payments.

      --
      Well, there's spam egg sausage and spam, that's not got much spam in it.
    3. Re:Patch? by Anonymous Coward · · Score: 0

      Exactly, this is what they do after recovering the keys with another flaw.

  7. Re:Who knew! by ammorais · · Score: 5, Interesting

    What a surprise, encryption has flaws!

    RTFA. It's not about flaws in encryption. It's about "ASP.NET's implementation of AES has a bug in the way that it deals with errors when the encrypted data in a cookie has been modified"
    So it's the ASP.NET AES implementation that has flaws. The problem seems to be that the errors reveal enough information about how to decrypt the data.

  8. Re:Who knew! by WrongSizeGlass · · Score: 3, Insightful

    This is /. aren't you supposed to say "What a surprise, .NET has flaws!" ?

    No, no, no ... you're supposed to say "this doesn't affect Linux". But does it affect Mono?

  9. So... by fuzzyfuzzyfungus · · Score: 1

    Will more of the script kiddie hacking packages have "hardcore" venomous snake related names and graphics(ASCII for the l33t) or "hilarious" anal violation pun derived ones?

    1. Re:So... by Culture20 · · Score: 1

      Will more of the script kiddie hacking packages have "hardcore" venomous snake related names and graphics(ASCII for the l33t) or "hilarious" anal violation pun derived ones?

      Neither. ASP is short for aspie. The hacking packages will have very descriptive names with poor user interfaces. Also, I don't understand what's so funny about violations of "am/are not a lawyer". Pretending to give real legal advice can get you in hot water. In some countries, you could get sent to prison and get "am/are not a lawyer"-ly violated.

  10. flawed by design by Anonymous Coward · · Score: 0

    Recently I reviewed code of a colleague.
    "Q: Why does the app store authorization i cookies?"
    "A: But it's encrypted!"

    Only a idiot would store "important stuff" in cookies. It's only a matter of time to break it.

    1. Re:flawed by design by ysth · · Score: 1

      The argument for storing important stuff in cookies is to save the time and other expenses of a database or key-value store lookup of a session id on every request. Given secure encryption, it's a reasonable choice; the only good argument against it is that the encryption might not be as secure as you think...

    2. Re:flawed by design by Anonymous Coward · · Score: 0

      Given secure encryption, it's a reasonable choice; the only good argument against it is that the encryption might not be as secure as you think...

      sure, and given a spherical frictionless cow, I can improve a dairy farm's milk output by an order of magnitude.

      If you think you can be careless with your data just because it's encripted your almost certantly wrong.

    3. Re:flawed by design by Dalcius · · Score: 1

      save the time and other expenses of a database or key-value store lookup of a session id on every request.

      So you save time on a cache/DB lookup by doing crypto processing instead ... after which your web application will begin processing the user's request... in most cases querying the database, updating user history, etc.

      This seems to me like missing the forest for the trees.

      Doing a hash lookup on your cached session is near constant time, avoids security holes introduced by sensitive data client-side, and avoids stacking session data on top of *every request* to the webserver.

      That's not even tackling the more serious issue of trusting a user ID from the client without a password because "it's encrypted".

      --
      ~Dalcius
      Rome wasn't burnt in a day.
  11. Re:Who knew! by Anonymous Coward · · Score: 4, Informative

    What a surprise, encryption has flaws!

    Nope, the cryptography is still flawless. ASP.NET just failed to use it correctly. AES-CBC would be perfectly secure if they used MAC to authenticate the data. MACs have been a critical part of crypto protocol design since the "DES ages" and padding oracle attacks have been known since 2002.
    Just like RC4 is still secure if used properly, but WEP is broken due to protocol flaws (the problems with RC4 were known before WEP was designed).

    So kids, make sure you always use MAC with your ciphers.

  12. 100% reliable? by Mongoose+Disciple · · Score: 4, Insightful

    TFA has a bizarre idea of a "100% reliable" attack:

    "It's worth noting that the attack is 100% reliable, i.e. one can be sure that once they run the attack, they can exploit the target. It's just a matter of time."

    By that logic, this attack is 100% reliable against (web platform of your choice) too.

    Beyond that, this attack requires fairly verbose error messages be sent back to the user of a web application. While I'm sure there do exist some ASP sites where this is the case, I don't think it has been in any of the non-intranet sites I've seen in my career.

    It just is not standard in any exposed web site, especially the kind of web site where you would care about customer information getting out, to allow useful error messages reach the end user. It is by far the standard to catch the exceptions, log them on the server, and show the end user a generic error message which would not be helpful in the case of this exploit.

    1. Re:100% reliable? by Unequivocal · · Score: 2, Interesting

      100% seemed wrong to me - there seems like a lot of ways to secure against the attack based on the article, but that article seems unreliable in the details as you point out. This attack does seem to require some kind of non-generic output from the ASP server side:

      The attack that Rizzo and Duong have implemented against ASP.NET apps requires that the crypto implementation on the Web site have an oracle that, when sent ciphertext, will not only decrypt the text but give the sender a message about whether the padding in the ciphertext is valid.

      But what's really not clear is their reference to "side channels" where this information might also be obtained. Perhaps they can gain some understand of the errors from the time it takes the process to return to the query or other metrics?

      In terms of speed - they claim they haven't run across a .NET implementation that they couldn't break in 50 minutes (avg 30 min). So this isn't an arbitrary N-time exploit - this is pretty concrete.

    2. Re:100% reliable? by Mongoose+Disciple · · Score: 3, Informative

      Basically, what I'm saying (that I don't think I expressed very clearly in my post that you replied to) is that what they're saying in the article is: If you find an ASP.NET web site (or a JSF one, for that matter) that gives back enough detail in its error messages to malformed/misized crypto packets, you can figure out what the size really should be and make it work from there, and then it'll work every time. It's like saying "A third of the time, it works every time!" Well, that's not 100%.

      To put it another way, entering 'admin' and 'admin' will give you full access to 100% of machines that have a user called admin with admin privs that also set their password as admin. Or, the Blaster Worm still owns 100% of Windows 98 machines that haven't been patched in a decade. While technically true it's a useless statistic.

      I have not personally encountered a site that would be useful to crack (ASP or JSF) that provides the end user with the kind of error messages they're talking about. There's no reason you couldn't, but you just never would.

      More details on the "side channels" would've been nice, since the primary vector they talk about is, in practical terms, useless.

    3. Re:100% reliable? by Dancindan84 · · Score: 1

      They've done studies, you know. 60% of the time it works, every time.

      --
      "Always forgive your enemies; nothing annoys them so much." - Oscar Wilde
    4. Re:100% reliable? by Anonymous Coward · · Score: 0

      It's worth noting that the attack is 100% reliable, i.e. one can be sure that once they run the attack, they can exploit the target. It's just a matter of time

      We're 100% dead, it's just a matter of time. Every OS is 100% unreliable. It will crash, it's just a matter of time. 100% of your RAM's bits will fail. It's just a matter of time.

    5. Re:100% reliable? by Anonymous Coward · · Score: 0

      Brute-Force is 100% reliable. It's just a matter of time.

    6. Re:100% reliable? by sproketboy · · Score: 0, Troll

      Hey mongoose don't bring Java into this you fucken M$ wanker. It affects ASP only.

    7. Re:100% reliable? by Anonymous Coward · · Score: 0

      Is that you icebike?

    8. Re:100% reliable? by TBBle · · Score: 1

      It's 100% reliable for sites in a vulnerable configuration (ie. the sites the attack targets).

      They presumably mean this to distinguish from attacks which require some level of luck or coincidence (eg. triggering a race condition) to exploit.

      Or for attacks which require a certain state to be achieved but which there's no useful upper bound on when that state might be achieved due to the actions of the attack, eg. a purely passive attack.

      So in short, they're saying that the attack is able to drive it's own progress towards its goal, and (I guess) always makes some small amount of progress on every iteration.

      --
      Paul "TBBle" Hampson
      Paul.Hampson@Pobox.Com
    9. Re:100% reliable? by Mongoose+Disciple · · Score: 1

      Read the article. It clearly says the same "vulnerability" exists in Java Server Faces.

      Except it's a joke of a vulnerability in both cases.

  13. Re:Who knew! by Anonymous Coward · · Score: 0

    Who the hell is dumb enough to send "unfriendly" error messages in the first place???

    The only time you send stack traces is when your site is in pre-production/development phases.

  14. Meh... by Anonymous Coward · · Score: 2, Insightful

    "The attack allows someone to decrypt sniffed cookies, which could contain valuable data such as bank balances, Social Security numbers or crypto keys. The attacker may also be able to create authentication tickets for a vulnerable Web app and abuse other processes that use the application's crypto API."

    Anyone storing these things in a cookie, regardless of encryption, needs to step away from the keyboard and stop developing web applications.

    This is a non-issue as long as you realize that what is encrypted can be decrypted and keeping that in mind when you store information in a cookie.

    1. Re:Meh... by RightSaidFred99 · · Score: 1

      Bullshit. By this "Logic" you can never send or receive..well, anything over a computer network.

      If I encrypt data using a session key that only I have, my assumption is only I see that data. If the encryption provider is broken, it's the encryption that's broken, not my code.

      Your closing bit of wisdom that what is encrypted can be decrypted is equally facile. By this logic, we shouldn't be sending anything over the internet because SSL can be decrypted, PGP can be decrypted, etc...

      1. Point out that "what is encrypted can be decrypted"

      2. Shut down teh interwebz

      3. ???

      4. Profit!

    2. Re:Meh... by owlstead · · Score: 1

      "This is a non-issue as long as you realize that what is encrypted can be decrypted"...

      That statement is not true in any pragmatical sense. I can create random secret AES key, encrypt a piece of plain text with it and send it to you. Then throw away the key. Call me back when you've decrypted it. You can specify any size, but anything over 10 MB will be a bugger to upload.

      Of course, the cookie should mostly be used to keep session state, not bank details, I'm with you there.

  15. Re:Who knew! by Anonymous Coward · · Score: 1, Informative

    ASP.NET uses a hashed message authentication code by default. So not sure what point you are trying to make by talking about them as a solution.
    Source: see 'protection' at http://msdn.microsoft.com/en-us/library/1d3t3c61.aspx

  16. Re:Who knew! by Anonymous Coward · · Score: 0

    Sadly, many many people.

  17. ASP.NET problem? Ha! More like Web App Problem by PenguinBob · · Score: 1

    Seems to be more of a problem with the web application and less of ASP.NET. I mean, sure you can get the encryption key to the cookies, but seriously who puts information like a bank balance or a social security number in a cookie anyway? You should have that stored server-side and only use a session id.

    1. Re:ASP.NET problem? Ha! More like Web App Problem by 16K+Ram+Pack · · Score: 1

      Exactly. Anyone who's liable to an attack like this probably has bigger things to worry about in their software.

    2. Re:ASP.NET problem? Ha! More like Web App Problem by owlstead · · Score: 1

      On the one hand you are absolutely right. On the other hand, they make it an encrypted cookie for nothing. If you encrypt something the overall idea with developers will be that it is a safe place to store data.

      So it comes down to 3 culprits:
        - no (H)MAC used to protect the data (always a bad thing, as one of the first posters correctly pointed out): BAD PROTOCOL
        - too much information leaked by default ASP.NET implementation
        - bad decision to put sensitive data in a cookie by the application engineers

      And it could even come to 4 culprits:
        - bad documentation - if you provide encrypted cookies in a framework: document what they should be used for

    3. Re:ASP.NET problem? Ha! More like Web App Problem by Mongoose+Disciple · · Score: 1

      - too much information leaked by default ASP.NET implementation

      Incidentally, it's not -- the default behavior is to not provide the information in question, except to a user on the server. That is, a developer running both the web browser and the web server on one machine (a common development situation) would get the information about the mangled ciphertexts, but any remote user would not.

      It's possible to configure error messages such that every user would get the detailed error messages the exploit needs (or that no user could get them, even running on the web server), but you'd have to go out of your way to do so.

  18. Follow the links by aBaldrich · · Score: 2, Informative
    The guy who's giving the conference says:

    The first part of the presentation introduces the audience to Padding Oracle Attacks, the cryptographic concepts of the vulnerability, and finally how to exploit it. We also describe the algorithms implemented in POET (Padding Oracle Exploit Tool). POET is the free tool that we released a few months ago which can automatically find and exploit Padding Oracle vulnerabilities in web applications. The second part presents a previously unknown advanced attack. The most significant new discovery is an universal Padding Oracle affecting every ASP.NET web application. In short, you can decrypt cookies, view states, form authentication tickets, membership password, user data, and anything else encrypted using the framework's API! Finally we demonstrate the attacks against real world applications. We use the Padding Oracle attack to decrypt data and use CBC-R to encrypt our modifications. Then we abuse components present in every ASP.NET installation to forge authentication tickets and access applications with administration rights. The vulnerabilities exploited affect the framework used by 25% of the Internet websites.The impact of the attack depends on the applications installed on the server, from information disclosure to total system compromise.

    http://ekoparty.org/juliano-rizzo-2010.php

    --
    In soviet russia the government regulates the companies.
    1. Re:Follow the links by Unequivocal · · Score: 2, Interesting

      Thanks. It also got me thinking that if all this transactional stuff affected by POA is secured in an SSL channel, then it would be hard to get at it to begin with? This attack seems predicated on getting a hold of other's encrypted cookies/password in order to be powerful? This is just a sophisticated man-in-the-middle attack with capability to unwind *one* encryption channel? If SSL is in operation, then this doesn't help?

      They claim it would work against many bank sites, but it seems like all bank sites use SSL.

      What am I missing?

    2. Re:Follow the links by Anonymous Coward · · Score: 0

      What you are missing is simple: you think plain-text "information" is necessary at one step of the exchange while this is not needed at all.

      Crypto attacks use server response times: an error will modify this delay, letting you learn parts of the key by attacking different parts of the ciphertext.

      SSL has been attacked a long time ago by using timing attacks and the remedy is to add an artificial random latency to all your crypto operations (including failures).

      Simple, clean, reliable -just like the security breach.

  19. Fanbois, invoke the monocrop argument! by Anonymous Coward · · Score: 0

    And all the paid MS astroturfing fanbois started singing in choir the monocrop argument. Uh, no... Wait : .net is not the most successful platform for webapp. Darn. The monocrop fallacy ain't working this time, need to find another fallacy.

  20. Re:Who knew! by Anonymous Coward · · Score: 2, Insightful

    I'm going to be a crypto pedant here for a moment. Don't use the words "perfectly secure" to refer to any cryptographic scheme other than a true one-time pad. The phrase "perfect security" has a *very* specific meaning in cryptology, defined by C. E. Shannon, and the only thing that meets the definition is a true one-time pad (a symmetric key that is perfectly random - the odds of any particular bit in the string being 1 are exactly 50% - and longer than the message it encrypts and is only used for that one message).

    AES is extremely secure (no one who publishes has found a practical attack against it that's easier than brute force, and all the best cryptanalysis folks who publish have been trying since the original submission of Rijndael for the AES contest), but it cannot be "perfect" - because a brute force attack will work. Even a brute force attack won't work against a one-time pad.

  21. Re:Who knew! by Anonymous Coward · · Score: 0

    Stack dumps make me look smart. Chics dig stack dumps.

  22. Re:Who knew! by icebike · · Score: 0

    Even one time pads are susceptible to brute force attacks.

    The only way you can make the assertion that they are not is to assume the original message was simply random characters, with no obvious language.

    If the original was normal human readable text it becomes immediately obvious when your brute force succeeds and a subsequent dictionary comparison of each word yields a hit.

    --
    Sig Battery depleted. Reverting to safe mode.
  23. Does it affect asp.net user/roles authentication? by Anonymous Coward · · Score: 0

    I don't generally bother storing anything in a cookie if I can avoid it. There are simply better ways to do things IMHO.

    On the other hand, if this will allow someone to spoof an asp.net user session (rather than a roll your own authentication system) then I may be in trouble.

    Of course if it needs a verbose error in order to work, I'm fine. FriendlyError.aspx doesn't show stack traces.

  24. Re:Who knew! by colinrichardday · · Score: 1

    Which human readable text? The point of trying to brute force a one-time pad encoded message (without having access to the pad itself) is that any message of the same length is just as possible. How do you determine the actual message from all of the other possible messages of the same length?

  25. Re:Who knew! by Anonymous Coward · · Score: 0

    For every plaintext of given length and every 1TP ciphertext of the same length there is a trivially obtainable 1TP key that converts the latter into the former.

  26. Another "exploit" far less powerful than implied by Anonymous Coward · · Score: 0

    I immediately thought, "how would you even snip some one else's cookie in the first place"? Unless the site was not using SSL and you sniffed it off an open WiFi connection. Maybe this is what they meant by "side channels".

    Copied this comment from "asmx86" on the TFA's talkback comments:

    Totally useless. If you can sniff in realtime then you can already hijack their session which means accessing the site with user's credential.

    So, what they discovered is that you can crack the content of this and see whats in it - which means the application itself must SAVE in these cookies important data, maybe stupid programmers do that - the way to do it is just using the session id and save data server side.

    Besides all this, all banks in the world use SSL - try to break that...

    Anyway, good research but too much smoke if you know what I mean.

  27. Re:Who knew! by Anonymous Coward · · Score: 0

    Even one time pads are susceptible to brute force attacks.

    This is outright wrong. If it's susceptible to brute force attacks, it's not a one time pad.

    Reason being, if you don't know the key, you can decrypt a one-time-pad to produce any possible message by appropriately changing the key.
    This is also how OTP can provide deniable encryption: if you have the ciphertext, you can construct another OTP key that decrypts to totally different material, at your choice.

  28. peopleeeeeee helllooooooo? by elvena · · Score: 1

    Cmon!

    1) HTTP over SSL - sniff and BREAK that.

    2) Important information in the cookies? That person should not be called programmer.

    So maybe, MAYBE.. you could apply this to i-want-to-make-this-conference-very-popular-selling-some-smoke-yay.com.ar - thats it.

    Whats the big deal here? Good research, sure.. too much SMOKE to publicity some mid-lame conference (Mid basically, there is some very intelligent people at it, wonder why...)

    1. Re:peopleeeeeee helllooooooo? by John+Hasler · · Score: 2, Funny

      > That person should not be called programmer.

      The title is usually "Web developer", is it not?

      --
      Warning: this article may contain humor, sarcasm, parody, and perhaps even irony. Read at your own risk.
  29. Re:Who knew! by icebike · · Score: 0

    Any message being possible only makes sense when you define "and message" to include total nonsense strings of text.

    You can use the 5th grade test to see if your brute force attack worked.

    Had the output to a 5th grader, and if can read it out loud your brute force worked.

    If I handed you two messages:

    1) The account numbers to the secret Swiss Bank account are 3432376482 and 367282345. Please do not access the accounts more than once a month.

    --and
    2) aljkhwerh;lkjerja;ke ;werj ;kljr;qijaof; ;ileurie;oir;iw;; ;lekjeri ;wkrie9jg; ;'keroje;kj ;wljejrei ioj;akjie;titj ww';ler;lj e;kerjw

    Which one of those would your 5th grader choose?

    --
    Sig Battery depleted. Reverting to safe mode.
  30. Re:Who knew! by icebike · · Score: 0

    Any possible message is far from any reasonable message. A random sting of characters is not the sort of thing people encrypt.

    Try to put this in real world terms here, and stop being such a pendant.

    --
    Sig Battery depleted. Reverting to safe mode.
  31. That's some dumb stuff to be storing in cookies... by rescendent · · Score: 2, Insightful

    "The attack allows someone to decrypt sniffed cookies, which could contain valuable data such as bank balances, Social Security numbers or crypto keys. "

  32. Re:Who knew! by Mongoose+Disciple · · Score: 4, Insightful

    Respectfully, are you sure you understand how a one-time pad works?

    Attempting to brute force a one-time pad is as likely to produce a third option:

    3) The account numbers to the secret Swiss Bank account are 3435464482 and 363578345. Please do not access the accounts more than once a month.

    as your #1. In other words, the same message with totally different account numbers. Or any other message of the same length.

  33. Re:Who knew! by rcuhljr · · Score: 2, Insightful

    I don't think you're getting it.
    Brute forcing a one time pad makes "The account numbers to the secret Swiss Bank account are 3432376482 and 367282345. Please do not access the accounts more than once a month." just as likely as "The account numbers to the secret Swiss Bank account are 123456789 and 987654321. Please do not access the accounts more than once a month." and you have no way of telling which one was the original message.

  34. Re:Who knew! by compro01 · · Score: 2, Insightful

    if the original was normal human readable text it becomes immediately obvious when your brute force succeeds

    You will get any possible message of the same length, including several normal human readable ones. Barring having other information, there isn't any way to determine which one is the actual message. For example, if you have a 28 character message, attempting to brute force the OTP it will give you both of the results below, both equally plausible, along with many others which are equally plausible.

    meeting canceled, stay home.
    meeting at 10:00, room 1103.

    --
    upon the advice of my lawyer, i have no sig at this time
  35. Re:Who knew! by rcuhljr · · Score: 1

    Eh nevermind just ignore my post, I just saw your other 'pendant' comment; you have to be a troll.

  36. Re:Who knew! by Anonymous Coward · · Score: 0

    I'm pretty sure this .NET is server-side.

  37. Re:Who knew! by Anonymous Coward · · Score: 1, Insightful

    I don't think you know how a one time pad works - trying to brute force a one time pad will yield both "The account numbers to the secret swiss bank account are 12345 and 67890" and "The killer is staying in the Slashdot hotel, room number 1235", along with literally every permutation of letters and numbers (or whatever you're encrypting) that can be possibly produced. The only attacks against OTP are side attacks, against things such as your random number generator and transmission of the key.

  38. Re:Who knew! by Anonymous Coward · · Score: 0

    According to government statistics, if you mean 5th graders here in the US, they wouldn't be able to read either one.

  39. Re:Who knew! by zindorsky · · Score: 4, Insightful

    Even one time pads are susceptible to brute force attacks.

    Nope, absolutely incorrect. That's what makes one-time pads different. When the key length is the same as the plaintext length, it is possible have perfect security. Look up unicity distance.

    If the original was normal human readable text it becomes immediately obvious when your brute force succeeds and a subsequent dictionary comparison of each word yields a hit.

    But your brute force attack will yield every single possible plaintext (with the same length as the original plaintext). Which is the real one?

    For example, if the ciphertext is BWIJAA, your brute force attack will get ATTACK for one key, and GOHOME for another. (And every other 6 character string.)

    --
    If the geiger counter does not click, the coffee, she is not thick.
  40. Re:Who knew! by Artefacto · · Score: 2, Insightful

    Try not to be ignorant, not to say idiotic. "Any possible message" includes "any reasonable message". Come back when you understand Shannon's theorem.

  41. don't roll your own by Anonymous Coward · · Score: 0

    So kids, make sure you always use MAC with your ciphers.

    There are actually a couple of things that people should probably generally know:

            http://www.daemonology.net/blog/2009-06-11-cryptographic-right-answers.html

            http://www.daemonology.net/blog/2009-06-24-encrypt-then-mac.html
            http://rdist.root.org/2010/09/10/another-reason-to-mac-ciphertext-not-plaintext/

    And as for MACs: don't try to roll your own, but use HMAC. Doing a simple (m = plaintext, k = key) solution as on of the following

            H(k || m)
            H(m || k)

    is not secure even though many people think they are "salting" things with a key of some kind:

            http://rdist.root.org/2009/10/29/stop-using-unsafe-keyed-hashes-use-hmac/

  42. Re:Who knew! by icebike · · Score: 1

    Would any message of the same length make sense?

    --
    Sig Battery depleted. Reverting to safe mode.
  43. Oracles are not new by bk2204 · · Score: 2, Interesting

    Basically, the problem here is that ASP.NET leaks information about incorrectly decrypted data. If the attacker can get information about the failed decryption, then that's called an oracle. The secure way to handle any sort of decryption error is simply to say "decryption error", regardless of whether it's a padding error, a MAC (message authentication code) error, invalid plaintext, or whatever. You should never give the user the invalid decrypted data or any information about it.

    Some SSL/TLS implementations have this problem, too, because they treat a MAC error differently than other decryption errors. Secure implementations, including OpenSSL, have the sane behavior: simply stating that the decryption failed.

    A good way to make padding oracle attacks irrelevant is to design protocols to use cipher modes that don't require padding. In other words, instead of using CBC, use CFB. This does have some tradeoffs, but overall CFB is a good choice. (For example, OpenPGP uses CFB.)

    1. Re:Oracles are not new by solinym · · Score: 1

      If you're encrypting then HMACing, then telling them whether HMAC passed or not shouldn't matter much (under normal assumptions), since they can't get it to pass except under very rare conditions (P(2^-n) for n bits of HMAC). But yeah, ideally, you want to leak as little info as possible to the end user.

      I personally also find CBC and padding a little obnoxious and artificial, and used CFB in certain applications of my own that I wrote as learning exercises before such things were widely available - see http://www.subspacefield.org/security/hard_drives_of_doom/

      The whole idea of decryption "failing" is a bit weird and specific to certain modes and padding techniques; generally, any encryption which doesn't add information (padding, b64 encoding, metadata such as MAC) cannot fail, since there's just as many plaintexts as ciphertexts, so it is one-to-one.

      I find no problem with a library throwing a "decryption failed" exception internally, but in your web app that interacts with the user, you want to catch all exceptions and simply return an error code meaning something like "your message was not accepted". Your software should be like an enigmatic sphinx, giving out as little information as possible. In fact, the strategy used by firewalls is to simply ignore denied packets and not even respond - but this makes it difficult to distinguish crypto failures from network failures.

      Schneier once pointed out that you should never take your asserts out of production security code. According to his argument, an assert means "I cannot give a proper response under these conditions", and therefore only secure response is for the program to terminate. Now for a daemon that doesn't respawn, that may be a bit annoying, but I think you can easily modify this by throwing an exception to an outer loop that terminates the connection, emulating a respawn. Yes, this does give out some information, but under the circumstances, there's little alternative.

    2. Re:Oracles are not new by hesaigo999ca · · Score: 1

      >You should never give the user the invalid decrypted data or any information about it
      Exactly, you would just send out a properly formatted error message stating a code (implicit to your company) and the rest very simple ...contact your admin etc...as most programmers use codes, but do not need to offer a whole stack trace anymore.

  44. Re:Who knew! by Anonymous Coward · · Score: 0

    Stack dumps make me look smart. Chics dig stack dumps

    And that is why you are fated to die a virgin

  45. Re:Who knew! by icebike · · Score: 0

    I know exactly how a one time pad works. EXACTLY. Stop asking the question.

    Brute force attacks yield mountains of garbage, and a few nuggets of highly probable deciphers, of which usually only one makes language and contextual sense.

    --
    Sig Battery depleted. Reverting to safe mode.
  46. Re:Who knew! by Lokitoth · · Score: 1

    You are being pedantic. He clearly means any sensical message of the same length. Which makes one time pads more secure as the message length increases (provided the key size is still longer than the message).

  47. Re:Who knew! by 0123456 · · Score: 2, Informative

    I know exactly how a one time pad works.

    No you don't, if your posts on the subject are anything to go by.

  48. Re:Who knew! by Anonymous Coward · · Score: 0

    I don't think you have a clue how a one time pad works, based on your comments here. You can make the message "qwerty iopas fghjkl xcvbn qwertyui" decrypt to anything which has the same length, so you could get something like "The attack will happen this Monday" AND "The attack will happen this Friday" AND "icebike does not understand OTPs!!"

  49. Re:Who knew! by Mongoose+Disciple · · Score: 3, Informative

    Any, no. But certainly there are many, many messages of the same length that would make sense.

    To put it another way, let's say a /. sig is 120 characters (I don't know the exact number offhand) and that a million /. users have sigs, all of which are different and make some kind of sense. If I encrypt one with a one-time pad, there's no way for you, using brute force, to figure out which user's sig it is -- each of those million possibilities (and many, many more) would appear equally possible to your best discernment.

    You're saying that as long as you come up with a message that looks like words and forms a sentence that's the right length, you've successfully brute forced the pad. That's not remotely the case.

  50. Re:Who knew! by BitZtream · · Score: 3, Insightful

    Actually the implementation and use of AES in the ASP.NET framework is fine.

    Websites that aren't trapping internal exceptions are bugged.

    The problem here is the developer using the code who isn't catching the exception, and worse still allows it to pass through directly to an untrusted 3rd party (the user).

    Its not an ASP.NET bug if you proceed to print the password on the screen when users attempt to login, this really isn't any different. The dev using the ASP.NET framework is using it wrong.

    --
    Persistent Volume manager for Kubernetes - https://github.com/dwimsey/openshift-pvmanager
  51. Re:Who knew! by Anonymous Coward · · Score: 0

    a pendant is something that hangs, for example a locket hanging from a chain.

    Did you mean to say pedant? http://en.wikipedia.org/wiki/Pedant. Oh, whoops - guess I was a pedant...

  52. Re:Who knew! by bluefoxlucid · · Score: 1

    Often it's repeated that programmers should not implement their own crypto libraries. I've been considering writing and public-domaining a cyrpto library front-end (an API library) that itself takes back-end plug-ins to implement stream/block cipher (or stream cipher AES ... basically a PRNG with a fixed IV having its output AES encrypted, and using the stream as a keystream i.e. XOR vs plaintext to make one-time-pad). Yes, there's crypto libraries now; but mine would explicitly have code and documentation explaining the mitigation mechanisms for algorithmic flaws and other implementation details that avoid brokenness.

    The point here would be 1) to implement non-flawed algorithms (i.e. AES) in a documented, non-flawed way; and 2) to implement flawed algorithm mitigation.

    For example, with RC4 you can statistically discover key bytes with weak IVs. In WEP the attacker assumes the first byte is 0xAA; then, for 24 bit IVs, all he needs is an IV (a+3, n-1, X) key index (a), element space (n), and any X. With 8 bit elements (1 byte at a time), this is n=256.

    To mitigate this, make sure (n) never equals (256); also making sure (a) never equals 3 will prevent the attacker from figuring out the first word of the key, which is needed to find the second (which you need to find the third etc.), totally eliminating the starting point. This means you can theoretically allow (a!=3,n-1=255,X) or (a=3,n-1!=255,X) and be secure. If you simply leave (n-1!=255), you eliminate 0.0056 bits of the 24 bit IV; if you leave (a!=3) as well, you eliminate 0.011 bits. If you eliminate the initialization case (3,255,X), you only lose 1.7 x 10^-7 bits; however, if the attacker knows/can guess the second byte of the WEP header, your security falls again.

    The best security for RC4 is to just ban (n-1=255), leaving 23.994 bit IVs instead of 24 bit IVs. If other weak conditions are present, we'll also examine their cases and detect/alter them as well. Of course, you can't just make n-1=255 imply n-1=254; instead, generate a random value between 1 and 254. If you think that generating a random 8 bits is faster, then have a custom get_random_RC4_IV() that does that and, failing that, subtracts a random value between 1 and 255 when it encounters n-1=255.

    All encryption algorithms implemented for that library would be implemented and documented as such. Here's the attack. Here's the conditions. Here's the conditions we can eliminate. Here's the impact on entropy. Here's other considerations. Here's what considerations we ignore and why. Here's our final implementation plan and why we feel it's optimal. Here's the impact on entropy.

    And that is why YOU shouldn't be writing your own AES implementation, or whatever else.

  53. Re:Who knew! by MaskedSlacker · · Score: 1

    *Boggle*

    Really?

    Let's try an experiment since you seem too thick to understand this. Here is my encrypted message:
    zxc
    I'll give you a hint that the clear text is an English word, and the one-time pad used to encrypt it used only letters (so we're talking modulo 26 addition here). This means that there are 17,576 one time pads I could have used.

    You're right that the vast majority of those one-time pads can be eliminated, because they give garbage decrypted text. Among these would be:
    abc, ujc, asd, qwe
    Applying these one-time pads to the cipher text is left as an excersize to the reader.

    However, there is a large subset of the 17,576 possible one-time pads that produce readable clear text, among them:
    fpy, rwi, yco
    which respectively decrypt the cipher text to:
    the, hat, bum

    Can you tell which was the real clear text? No you can't. And for longer messages you can't tell between 'Bill ate the cat' and 'Bill fed the cat.' from a cipher text of 'era and qwe omn' because there is a possible one-time pad for each.

  54. More info: by gbrayut · · Score: 1
    More details about the attack can be found here and here. The original paper indicates that it affects may common libraries:

    Another way is to look for known source code keywords. You can start by looking for code that imports low level cryptography libraries such as:

    C/C++: OpenSSL, Crypto++
    Python: PyCrypto, M2Crypto
    .NET: .NET Cryptography, Microsoft CryptoAPI
    Java: Java Crypto Extension, BouncyCastle

    Then look for routines that perform encryption and decryption. If there’s some code to handle error while decrypting, and/or no sign of MAC usage, then it’s high probability you have found a target for the Padding Oracle attack. Regardless of which method one uses, the most important thing is to analyse and understand the meaning of error messages returned by the target upon receiving mangled ciphertexts. In short, you need to know when the padding is VALID, and when it’s INVALID.

  55. Re:Who knew! by SchroedingersCat · · Score: 1

    It has been shown that E&A (encrypt & authenticate) is inherently insecure: http://www.cryptopp.com/wiki/Authenticated_Encryption. And this is is exactly the scheme used by ASP.NET

  56. Re:Who knew! by suomynonAyletamitlU · · Score: 1

    So kids, make sure you always use MAC with your ciphers.

    Yes, I've always been a big proponent of MAC and c.

  57. Re:Who knew! by slimjim8094 · · Score: 1

    OK. You don't get it. Let me try and explain it a little bit better - admittedly, the other explanations are a bit lacking.

    A one time pad is an encryption key of the same length as the original message. For a 15 character message, I need a 15 character pad. But I can construct a pad to give me *every single message of length 15*. So I have no way of figuring out which one it is, because I can make it say *anything*, as long as the length is right.

    So I could try and brute-force a message of length 10, but I'd be able to "decrypt" every word and phrase of length 10.

    *This* is why OTP is the only 'secure' encryption - it's precisely because the tumblers on our virtual lock never fall into place, since they often do anyways.

    --
    I have developed a truly marvelous proof of this comment, which this signature is too narrow to contain.
  58. Re:Who knew! by Svartalf · · Score: 1

    This presumes you can get the proper plaintext determined that way.

    With a one-time pad, you're talking about something where you can conceivably get "intelligible" content and it could be the message with chaff around it- or it could be a false positive. Unless you know the plaintext from before it was encoded (along with any chaff measures you might have applied to the selfsame...)- you can't be sure you've got the message.

    --
    I am not merely a "consumer" or a "taxpayer". I am a Citizen of the State of Texas
  59. Re:Who knew! by Phleg · · Score: 1

    Not to mention, it's just as likely as "The president will be delivered at the drop-off location at precisely 0400 hours. He then will be transported to a secure, hidden facility."

    --
    No comment.
  60. Re:Who knew! by Anonymous Coward · · Score: 0

    To be fair with sufficently trivial messages and enough knowledge of the context SOME one time pads can be brute forced.

    Your example shows why in practice they cannot. However If the message is "Meet me at sunrise", and I happen to know that the message was intended to convey a meeting time as well as be familiar with the typical speech patterns of the sender, I'm much more likely to be able to crack that.

    However in all cases this pretty much applies: http://xkcd.com/538/

  61. Huh? by abulafia · · Score: 1

    You do realize that there's no exploitable pattern in a proper OTP, yes?

    This means that for a sufficiently long OTP encrypted text, both your comment and my comment look like "valid" decryptions. As are bomb making instructions, the menu for Obama's dinner last night, whatever your password to /. is, and the combination to your bank's vault.

    --
    I forget what 8 was for.
  62. Re:Who knew! by Anonymous Coward · · Score: 0

    They do use a MAC by default since ASP.NET 2.0. You'd have to turn it off for an attack to work.

  63. Re:Who knew! by roady · · Score: 1

    How can such a low ID say such nonsense. You sir are a shame to our kind.

  64. Re:Who knew! by roady · · Score: 1

    With an OTP you will also find a key that says:

    I can't meet today

  65. Re:Who knew! by Anonymous Coward · · Score: 0

    The question is when you're going to post the one time pad to decrypt the messages you've posted in this thread, as the cipher text is nothing but complete nonsense.

  66. Re:Who knew! by sjames · · Score: 1

    How about if I hand you a third message reading "The account numbers to the secret Swiss Bank account are 7846268231 and 532783502. Please do not access the accounts more than once a month.". It's just as likely with yet another brute forced key. So is "The deal is off. I don't know what I was thinking" with some null padding at the end. So is "Hello, would be code breaker, don't you wish I would re-use my OTP?".

    Now which one will the 5th grader choose?

  67. Re:Who knew! by sproketboy · · Score: 1

    Right because C# stupidly does not support checked exceptions like Java.

  68. Re:Who knew! by sjames · · Score: 1

    No, it yields every possible message of that length (including shorter messages padded out with spaces or zeros). You may be thinking about polyalphabetic cyphers where the key is shorter than the message. In a one time pad, the key is as long or longer than the message. It even yields LONGER messages in LZW compressed form.

    There is no way to choose between "attack at dawn" and "attack at noon" or even "don't attack!!" for example. They are all equally probable.

  69. Re:Who knew! by Anonymous Coward · · Score: 0

    Of course, .NET runs on wishes and sparkles, not servers like other programming languages. You do realise you can run ASP.NET apps on Linux too, right?

  70. That's why I stay from top frameworks... by Anonymous Coward · · Score: 0

    As we've seen with Windows etc, stick with just as good off the beat frameworks.

  71. Re:Who knew! by Anonymous Coward · · Score: 0

    Ooh! Ooh! Wishes and sparkles, just like the iPad!

  72. Re:Who knew! by godefroi · · Score: 1

    Has nothing to do with checked exceptions, and everything to do with turning on development-mode error messages on production websites...

    --
    Karma: Poor (Mostly affected by lame karma-joke sigs)
  73. a description of the attack in plain english by solinym · · Score: 1
    The root cause of the problem, like the earlier Flickr API Signature Forgery vulnerability, is “web developers used encryption when they should have used MAC”.

    MAC = Message Authentication Code, prevents a client from forging a valid value. You can think of it like a digital signature, except that it’s much faster and the same key creates and verifies the data - which is perfect when your web app generates, sends the value to the client, receives the value from the client, and wants to verify that it is the same thing it sent originally (i.e. hasn't been changed/forged).

    Given an oracle, this vuln does make decrypting a token – and thus getting the plaintext – O(n), instead of O(2^n) as brute force would dictate. It doesn’t require plaintext, just a ciphertext, and the attack finds the plaintext a byte at a time, from the end. From skimming it, it seems their paper doesn’t actually describe the attack (see below), but rather just describes how to test for the presence of the vulnerability.

    Anyway, the oracle condition typically occurs when you hand something to the client and check it later, which is really a sign you should be using MAC (specifically HMAC). You can also use encryption if you want to hide the value, but for random nonces and session IDs, it doesn’t usually matter (doesn’t hurt, either). You’ll want to encrypt-then-MAC if you do both.

    Background knowledge necessary for the attack:

    PKCS#5 padding is: If your input is a multiple of the block length, add a full block of padding. Otherwise, add enough octets to pad to a block length. Each octet of the pad always has the number of octets of padding used. So for example, the plaintext ALWAYS ends in 01, or 02 02, or 03 03 03, etc.

    In CBC mode: flipping bits in the previous ciphertext block flips the same bits in the next plaintext block after decryption. See my paper[1] for a pretty picture.

    Attack

    Suppose your plaintext ends in 04 04 04 04. If I twiddle the last octet of the (previous block of) ciphertext, only one value will give valid padding in the plaintext – 01. Now I fix the last octet to 02 (by flipping the two least significant bits), and go to work on the previous octet, trying to make the plaintext end in 02 02.

    As a side effect, if I know what bits I had to flip to get the valid padding values, I know that your plaintext differs from the valid padding value in exactly those bits. But the real problem is that the only thing between me and a valid plaintext is this padding (and the vagaries of your block cipher mode). It's like using a screwdriver when you should be using a hammer. You'll see this over and over again in crypto; "use things for what they are designed", or "only rely on the actual security guarantees of your primitives".

    Extra credit:

    • Figure out how to handle a plaintext already ending in 01, or trying to determine the fourth-to-last octet in the example above. Come up with a general algorithm that works for all cases. Compare to Vaudenay's.
    • Ponder the merits of encrypt-then-MAC vs MAC-then-encrypt, with respect to timing side channels, attacks like this, etc.

    [1] http://www.subspacefield.org/security/web_20_crypto/ - the premise of which could have been "you probably want to use MAC, not encryption"

    [2] http://www.subspacefield.org/security/security_concepts.html - for crypto-related reading (I'll put this description in there shortly)

    1. Re:a description of the attack in plain english by solinym · · Score: 1

      Oh yeah, forgot how to apply this to the first block - I think it depends on IV, and if it's not part of the blob under client control, or can't be tampered with, it requires special handling. They seem to discuss this in their paper.

  74. Re:Who knew! by Anonymous Coward · · Score: 0

    Sometimes, yes. This is what gives the one-time pad its strength.

  75. wreckless disregrd by Anonymous Coward · · Score: 0

    I have no problem with the fact that these guys found the exploit or that they disclosed the exploit publically. My problem on this is that they disclosed it publically before disclosing it to the vendor. the result is a potential 0 day attack. Now potentially million of man hours will be wasted because this weekend and during this coming week all around the world. As I understand it, this sxploit effects many different platforms, not just asp.net. These guys were wreckless. , unfortunately, some people will cheer them on and think that this is good

  76. Re:Who knew! by jgoemat · · Score: 1

    If I handed you two messages:

    1) The account numbers to the secret Swiss Bank account are 3432376482 and 367282345. Please do not access the accounts more than once a month.

    --and 2) aljkhwerh;lkjerja;ke ;werj ;kljr;qijaof; ;ileurie;oir;iw;; ;lekjeri ;wkrie9jg; ;'keroje;kj ;wljejrei ioj;akjie;titj ww';ler;lj e;kerjw

    Which one of those would your 5th grader choose?

    The problem was you would be handing that 5th grader every single possible message. Look at it this way. Let's say you KNOW that the message says "Your PIN number is XXXX" with XXXX replaced by the actual PIN number. In most crypto systems you could brute-force the key used to encrypt the data by trying each one and testing the results against this string to see if it matches the correct format. If you go through every possible key, then one of the resulting strings contains the correct PIN number.

    In a one-time pad you can immediately figure out the first 19 bytes of the pad because you know what the start of the message is. That doesn't do you any good however because you have absolutely no idea what the remaining 4 bytes of the pad are. And those first 19 bytes of the pad will never be used again in the current message or in any other (hence the one-time pad). The last four bytes of the pad are equally likely to be anything that would result in four digits given the encrypted text you received. The result of your "brute-force" attack would be 10,000 possible keys yielding 10,000 possible PIN numbers that all would match the encrypted message you received.

    Congratulations, you used your knowledge of what the message must contain to tell you exactly what you already knew with no way to find out anything you don't already know.

    Put another way, you can use whatever rules you would use to test that the resulting decrypted message was valid and generate the possibilities without ever looking at the message. In an example below let's say that you have three characters and you know they form a three letter word. You can either:

    1. 1) Try every random possible value for the one-time pad to decrypt the message and check each result against a dictionary to find the possible words
    2. 2) Ignore the message and generate three random bytes, then try every random possible value for the one-time pad to decrypt the message and check each result against a dictionary to find the possible words (will give the same result as #1)
    3. 3) Ignore the pad and the encrypted message and just look through your dictionary to find all possible three letter words

    All produce the same results and are just as likely to be the correct text of the message. Trying to brute-force the actual message is no better than trying to brute-force random bytes.

  77. Re:Who knew! by jgoemat · · Score: 1

    Even one time pads are susceptible to brute force attacks.

    The only way you can make the assertion that they are not is to assume the original message was simply random characters, with no obvious language.

    If the original was normal human readable text it becomes immediately obvious when your brute force succeeds and a subsequent dictionary comparison of each word yields a hit.

    Actually you can substitute random bytes for the message and your brute force will be equally successful. How does that help you tell what the message actually said?

  78. Re:Who knew! by man_of_mr_e · · Score: 1

    It's true that they're susceptible to brute force attacks. However, the inability to know when you have the correct cipher makes it pointless. Yes, you can brute force the key, but because you don't know if it's the actual key or not, you have no way to know if you've succeeded. Simply being readable text doesn't mean anything because there are millions of other readable text pads that can come out of it.

    My guess is that you don't really understand how the one-time pad works.

  79. Re:Who knew! by michaelok · · Score: 1
    Ok, .NET fans, keep punting. I guess the next answer will be it's the fault of the testers, for not envisioning this scenario. Which is a decent answer too, but I think the original commenter had it right about checked exceptions.

    I'm all for .NET, I love how I can create a web service quickly, and I've been impressed to see how it has been quietly building up to a solid base, and there are folks building good apps around it like Roy Osherove's TypeMock, even though Rails gets all the fanfare. but fall in the middle for checked exceptions, having seen massively stupid apps with 2/3 of the code handling the exception in every method, and other apps turning an exception into an unchecked exception. Use them, with care.

    The argument, way back when, against checked was, "we are good, smart programmers, don't treat us stupid, we will document the exceptions so if you should trap it (or turn off dev mode, or whatever the latest excuse is), you can, otherwise leave us alone." But then you have other folks out there, the lean developers, saying forget about documentation, just code it. (As an aside, I think the future will be massively un-maintainable web apps being tossed because the original developers have long gone, and unless you have an deep understanding like DHH, forget about figuring out the code, meanwhile well-document but dull C code will carry on)

    The counter-argument, as proven by this very very very costly example is, a little reminder doesn't hurt.