Slashdot Mirror


The Dangers of Improper Cookie Use

shifted89 writes "Over the last year, the security community have exposed web application security for what it is — extremely lacking. However, for all the focus on XSS, CSRF, history stealing, etc., not much attention has been given to the cookie. Unfortunately, cookie misuse can be just as dangerous, if not more so than XSS attacks and InformIT illustrates why. In short, the author clearly demonstrates what can happen when a website improperly uses cookies for customer tracking — including a working illustration."

25 of 191 comments (clear)

  1. Old News by MyLongNickName · · Score: 4, Funny

    Cookie misuse has been chronicled here

    --
    See my journal for slashdot ID's by year. Mine created in 2005. http://slashdot.org/journal/289875/slashdot-ids-by-year
  2. Cookies? Javascript? Etc? by Anonymous Coward · · Score: 5, Funny

    I disable them all because I hate any innovation of the web past 1991. Anyone who disagrees with me is wrong. This article is proof.

    1. Re:Cookies? Javascript? Etc? by Kelson · · Score: 4, Insightful
      I disable them all because I hate any innovation of the web past 1991.

      Hmm. Animated GIFs? Check. Blink? Check. Scrolling status bar? Check. Background MIDI files? Check. Pop-ups? Check. Flash ads with full video and sound? Check. Garish color schemes? Double-check.

      I think you're on to something!

    2. Re:Cookies? Javascript? Etc? by BLACKtactx · · Score: 4, Insightful

      Do you count CSS as an innovation??. If so, i have to disagree with you. Wouldn't it be better to word it "I hate any innovation that annoys me", instead of a blanket "any" innovation. Or maybe I should just develop all my sites in size 15 font, using framesets, in times new roman, and 16 colours. Innovation in itself is not bad, innovation for the sake of it is. The misuse of tehcnology cannot also be blamed on the technology itself but the dumb people who develop. I find javascript incredibly useful to improve my ui, some people decide to make yellow scrolling text on a magenta background, thats not javascripts issue. Dont shoot the messenger. Better go, my brick cell phone is ringing, and Im missing Magnum PI reruns.

    3. Re:Cookies? Javascript? Etc? by kalaf · · Score: 4, Funny

      High resolution porn? No wait, I take it back!

  3. cookies passed as plaintext by brunascle · · Score: 3, Informative
    Second, cookies are passed as plaintext unless there is an encrypted session. As a result, anyone with a sniffer can capture the cookies contents and use them as their own.
    bingo. that's why i store the IP address along with the session ID in the database.
    1. Re:cookies passed as plaintext by Xzzy · · Score: 5, Insightful

      bingo. that's why i store the IP address along with the session ID in the database.

      There was a merchant site that I visited quite some time ago that did something like this. Except they screwed it up and, along with putting the session ID in the URL, they "automatically" tied the session id with account information. The effect this had was that anyone who visited a copied URL would pull up the account information of the person who had spread the URL around.

      It took some time to figure it out. The URL was posted on a fairly busy forum, and it was a fairly fast selling item, and 50+ people had used the link to try and make a purchase.. and every time someone checked out, the account was updated with their information.

      I'm not sure what the lesson here is, other than the fact that any "safe practice" can become insecure in the hands of idiots. Cookies aren't an inherently stupid idea, but the ease of using them invites a lot of abuses.

    2. Re:cookies passed as plaintext by jgc7 · · Score: 3, Insightful
      > bingo. that's why i store the IP address along with the session ID in the database.

      How does that do anything for the example given? If someone uses a sniffer at a wireless access point with NAT, they have access to the same IP as their victim.

      --
      70% of statistics are made up.
  4. practical, perhaps? by fermion · · Score: 4, Insightful
    I was going to read the article until the 5th cookie was set at which point i just assumed that the entire thing was an practical lesson. Be stupid enough to read an article about cookie abuse and get caught in the trap. Sort of like trying to find a windows virus filter only to find that the virus filter has infected you.

    Oh well, I guess this is just another lesson in how marketers will shoot themselves in the foot. Animated gifs are abused, so i turn animation off. Cookies are abused, so i reject any cookie that is not obviously necessary. Flash is useful, but no way to request that it does not start automatically, so either I don't install it or install a hack to block it. I don't even see the product that is being advertised.

    I hope this gets everyone off thier high horse, and realize that third party cookies should be rejected on all machines by default. What I really wish existed was a screen that popped up every time you went to a new site that informed the user of the site, and asked for a cookie preference for that site. That way, all cookies could be accepted at the corporate site, and no cookies might be accepted at google.

    --
    "She's a scientist and a lesbian. She's not going to let it slide." Orphan Black
    1. Re:practical, perhaps? by nekokoneko · · Score: 3, Interesting

      What I really wish existed was a screen that popped up every time you went to a new site that informed the user of the site, and asked for a cookie preference for that site. That way, all cookies could be accepted at the corporate site, and no cookies might be accepted at google.

      Actually, Konqueror does that if you set it up to ask what to do when you receive a cookie. I fiddled around with Firefox and couldn't find a way to do it, but maybe messing around with Network.cookie.cookieBehavior and Network.cookie.p3p

    2. Re:practical, perhaps? by PCM2 · · Score: 3, Funny
      Sort of like trying to find a windows virus filter only to find that the virus filter has infected you.

      Where the hell do you live? Soviet Russia?

      --
      Breakfast served all day!
  5. How old is this article? by Dekortage · · Score: 5, Insightful

    It says "updated Dec 15, 2006" but the comments at the end of the article are all dated from 2004. I mean, the problem is much older than that, but it seems the article was just updated with 2006 dates to make it seem more current. Or am I missing something?

    --
    $nice = $webHosting + $domainNames + $sslCerts
  6. Cookie on cookie misuse link by blindcoder · · Score: 4, Insightful

    I like how the first thing the 'cookie misuse' site is doing is trying to do is to set a cookie. The 'why' remains unknown.
    Other things they do is prohibit tabbed browsing by using javascript to open an image from a thumbnail to a new window. Can someone please send these guys to a usability crash-course?

    --
    See my blog for my free opinions.
    1. Re:Cookie on cookie misuse link by J0nne · · Score: 4, Informative
      Other things they do is prohibit tabbed browsing by using javascript to open an image from a thumbnail to a new window.

      I can't believe how common that still mistake still is.
      It's not like it's hard to use the following instead:
      <a href="image.jpg" onclick="popup(this.href);return false;">link</a>...
    2. Re:Cookie on cookie misuse link by grcumb · · Score: 4, Insightful
      care to enlighten us on the correct way [to open a new window from HTML] or do you intend to let us die dumb?

      The correct way is - and always has been - to leave that to the user. Useability studies have shown time and again that new windows popping open unannounced are unwelcome, even frightening to many computer users. And the quickest way to piss off power users like me is to presume to know better than I how your site should be displayed.

      This behaviour is another legacy of assuming that the entire world browses with certain versions of MSIE. The only reasonable way in that browser to keep track of multiple sites was to open links in new windows. But even then, such presumption was unwelcome to most people, even many IE users.

      The only remaining (valid) use of the target attribute is in a frameset, and that monstrousity is not needed any more, what with the moderately decent CSS positioning support that is present in all modern browsers.

      --
      Crumb's Corollary: Never bring a knife to a bun fight.
  7. I love the start of this article by fullphaser · · Score: 3, Insightful

    As it references XSS attacks and then jumps to cookie abuse like it is something newer than XSS, I mean you know the whole web 2.0, almost everything being session and cookie based, yes turn those boogers off their dangerous, and return to the safe land of 1998 where static web pages reigned supreme. The fact is that we can't just dismiss the cookie, yes we can play safely in the field with it, but past that it is a integral part of today's web infrastructure and there is no short term replacement for it, between JS, ASP, and PHP all nearly relying on the whole concept of the cookie to validate session etc. You can't just say they are dangerous and to stop accepting them in general, and you can't just tell the web designer to stop using them, for the primary reason that it isn't practical.

    --
    Did someone say cake?
  8. Worse and worse by Dracos · · Score: 3, Informative

    Cookie abuse reached new heights a few weeks ago when top sites in Google search results throw cookies on the search results page. So far it's not a guaranteded occurance, and only happens for the top search result. Still, it's jumping the gun.

    I can't wait for the Mozilla devs to clean up their cookie code so that blocking cookies is as easy and configurable as blocking images. Even being able to prompt to block everything other than a session cookie would be a nice improvement.

    1. Re:Worse and worse by afidel · · Score: 4, Informative

      That's because your browser is pre-downloading the content from those sites, so yeah they are going to send their normal cookies. Turn off the preload feature and problem solved.

      --
      There are 4 boxes to use in the defense of liberty: soap, ballot, jury, ammo. Use in that order. Starting now.
  9. Re:Obligatory by Archangel+Michael · · Score: 3, Insightful

    Okay, it is ONE of my problems. Sheesh

    No need to beat a man while he's down.

    --
    Agent K: A *person* is smart. People are dumb, stupid, panicky animals, and you know it.
  10. Obligatory Simpsons reference.... by Illusion2269 · · Score: 5, Funny

    Mindy: What's wrong?
    Homer: Oh, yeah, like you don't know. We're gonna have sex!
    Mindy: Oh...well, we don't have to.
    Homer: Yes we do! The cookie told me so.
    Mindy: Well...desserts aren't always right.
    Homer: But they're so sweet!

  11. More "Cookie Monster" Hysteria by Doc+Ruby · · Score: 5, Informative
    The "friendly" article does start off sensibly, mentioning that "Cookies are not programs, they can't read your personal data, and they don't cause spam.". OK, main scary cookie myths put aside.

    FTFA:
    This value pair is my personal identification code that can be used to track my movements across the internet and build a profile about my surfing habits. This is possible because a cookie can be read at any time by the domain that owns it. As a result, when I visit Slashdot.org, doubleclick.net will attempt to read its cookie that is on my computer. This will provide doubleclick.net with my id value, and their database will be updated. In other words, they now know that I like to visit Informit.com and Slashdot.org. Already their profile on my surfing habits can tell them I am probably a computer geek.


    That section about the "personal identification code" talk is very weaselly. It makes cookies sound like any website can read a cookie on your computer that's flagged as "owned" by that website at any time. Cyrus Peikari and Seth Fogie (article authors) leave out the important, necessary link: the DoubleClick cookie can be read only when your computer makes an outgoing HTTP connection to DoubleClick. Like when a DoubleClick banner ad is included in a Slashdot page's HTML. Which HTTP request includes a CGI param (REFERER) pointing to the Slashdot page from which the IMG tag instructed the computer to pull the DoubleClick banner image. That's how Doubleclick gets its cookie, and the context that you visited a Slashdot page.

    DoubleClick cannot read its cookie any other time, when there's no HTTP connection from your computer to DoubleClick. Like all the rest of the pages on which DoubleClick has no banner or other "self-clicking" link. There are web bugs, invisible images tags embedded in other pages just to hit their server with the REFERER of the page triggering their bug, updating your computer's cookie with their counter (etc). But they cannot be read "at any time".

    Besides, the cookie is a nonessential part of this snooping. DoubleClick doesn't need to keep its counter on your computer - the IMG hit can update its server-side counter DB. It can ID you, though not as precisely, by your IP# and other CGI parameters you send with every HTTP request. Or DoubleClick's deal with, say, Slashdot, is that Slashdot encode the DoubleClick banner IMG tags the Slashdot server sends you with its pages with a unique ID, like your Slashdot userid. ACs and public terminals mostly escape, but they're not really targets for these marketdroids.

    And you can turn off cookies in any non-retarded browser, making them anonymous (encoded IMG URLs are much harder - see?). And you can inspect the cookies stored on your computer.

    All these issues were discussed in great detail by the HTTP Working Group as we invented cookies, almost a decade ago. Some people were philosophically opposed to letting untrusted servers store any data on users' computers. Though every page, every image is stored on users' computers, after retrieval for presentation. And we realized that stopping cookies would mean only people with money to make "cross-site" deals and maintain large centralized databases would get the power to exploit cookies for tracking. So the cost would motivate more profit-exploitation of the tech. Ultimately only profiteers would track you, and there'd be plenty of them, without even the local control that cookies offer. And the entire Web would lose even voluntary easy tracking of intersession client state.

    We decided to make cookies simple and use them. They're mostly harmless - a good balance with the huge benefit they deliver all day long in the Web Era. But I guess there's still profit to be made by scaring people on the Web, like the naive "technologists" to whom this InformIT article is directed, with incorrect cookie hysteria, and offers to help protect us.

    That's the way the cookie crumbles.
    --

    --
    make install -not war

  12. Cookies by KermodeBear · · Score: 4, Informative

    I have a friend who works for a medical software company. Their system handles all kinds of personal information; SSNs, medical records, body scans, etc. The authentication is cookie-based; All the information about a user's access is a serialized, base64 encoded data structure.

    Yup, you heard it right. base64 decode your cookie, change a few values, stick it back in... Ta-da, you're an admin.

    Improper cookie use can be a nasty, nasty thing. The worst part is that this problem was brought up to the lead developer, who had originally wrote this auth system, but... "Well, it is base64 encoded, noone will ever figure that out." Yeah, right.

    --
    Love sees no species.
    1. Re:Cookies by The+MAZZTer · · Score: 4, Informative

      If I see a nonsensical combination of upper and lower case letters, numbers, and punctuation, especially if it has one or two equal signs tacked onto the end, I immediately think "base64!".

      Firefox allows base64 encoding for data: urls, and we can use this to make a quick-n-dirty base64 decoder. Just type data:text/plain;base64, (including the comma) into the address bar and paste the string on the end, and hit enter to see the decoded string (if it's plaintext).

      Base64 is not encryption and it should not be used where encryption is needed (or in this case, a secure DATABASE). Base64 is a way to represent binary data in plaintext without having to worry about data corruption due to non-binary safe programs.

  13. Let's discuss something new by claes · · Score: 3, Informative

    Firefox 2 includes the new WHATWG-specified client-side persistent storage. However, some argue it is critically flawed. Learn the arguments now and we can discuss this further on Slashdot in 2010!

  14. You lie! FUD! FUD! by fm6 · · Score: 3, Funny

    If you were really that old-fashioned, you wouldn't have to disable JavaScript. The graphical web browser was invented in 1992, so you'd be compelled to use a text-only browser, such as Lynx. And those don't have any JavaScript to disable.

    You are obviously part of an Evil Conspiracy. Please rant some more so I can figure out which one.