Slashdot Mirror


YouTube Hit By HTML Injection Vulnerability

Virak writes "Several hours ago, someone found an HTML injection vulnerability in YouTube's comment system, and since then sites such as 4chan have had a field day with popular videos. The bug is triggered by placing a <script> tag at the beginning of a post. The tag itself is escaped, but everything following it is cheerfully placed in the page as is. Blacked out pages with giant red text scrolling across them, shock site redirects, and all sorts of other fun things have been spotted. YouTube has currently blocked such comments from being posted and set the comments section to be hidden by default, and appears to be in the process of removing some of these comments, but the underlying bug does not seem to have been fixed yet."

146 of 224 comments (clear)

  1. Series of tubes... by ae1294 · · Score: 5, Funny

    All of your tubes are belonging to US now.

    1. Re:Series of tubes... by KevMar · · Score: 5, Funny

      Somebody set up us the script bomb

      --
      Im a gamer, not a grammer major. This post is full of spelling and grammer mistakes.
    2. Re:Series of tubes... by Anonymous Coward · · Score: 3, Insightful

      Really? They're really only removing some of them? When they can just do a simple delete query and wipe everythin with a properly escaped script tag at the top of the comment? Wow. Just wow.

      The solution to this is for users to be asked if they want to participate in commented sections when signing up. Not just at youtube, but everywhere. And probably not just comments, but any user input area.

    3. Re:Series of tubes... by Stalks · · Score: 2, Informative

      Don't you mean...

      "Somebody script up us the bomb"

    4. Re:Series of tubes... by ae1294 · · Score: 4, Funny

      Really? They're really only removing some of them? When they can just do a simple delete query and wipe everythin with a properly escaped script tag at the top of the comment? Wow. Just wow.

      Shhh.... one word... overtime pay.

    5. Re:Series of tubes... by daremonai · · Score: 5, Funny

      That was actually two words ... Oh no, now we owe you overtime. Sneaky.

    6. Re:Series of tubes... by jhoegl · · Score: 1

      You somehow think IT gets OT.... that is pretty funny.
      Most Corporate IT get Salary, without OT.

    7. Re:Series of tubes... by XnavxeMiyyep · · Score: 4, Insightful
      Well, look at the bright side!

      YouTube has currently .... set the comments section to be hidden by default

      This is the greatest possible improvement to YouTube short of removing the comments section entirely.

      --
      I put the 't' in electrical engineering.
    8. Re:Series of tubes... by LuNa7ic · · Score: 1

      Oh my goodness, so many spams and scams are coming through the portal - Somebody call Senator Conroy, quick!

      --
      *runs*
    9. Re:Series of tubes... by mysidia · · Score: 1

      UPDATE VIDEO_COMMENTS set commentext='i am a fucking tool\n' where commentext like '>script%'

    10. Re:Series of tubes... by uninformedLuddite · · Score: 1

      I have alerted John Travolta and Tom cruise expect this lack to be remedied shortly

      --
      The new right fascists are bilingual. They speak English and Bullshit.
  2. I experienced this! by Anonymous Coward · · Score: 5, Funny

    I went to youtube, but all I saw was crap material. Someone had injected a bunch of crap!

  3. htmlspecialchars() by Anonymous Coward · · Score: 1, Interesting

    Problem solved?

    1. Re:htmlspecialchars() by Anonymous Coward · · Score: 1, Interesting

      I think you can count the lines of PHP in the Youtube codebase on zero hands, but yes, that would be the gist of it.
      Proper escaping isn't that hard, so this sounds like a poorly thought-out anti-injection measure accidentally circumvented the usual escaping. Generic blacklist-based XSS filters are pretty much useless, there's just too many ways to get a browser to execute some code, even without the general potential for fucking up your site.

    2. Re:htmlspecialchars() by Anonymous Coward · · Score: 1, Insightful

      It's not that hard for a small typo to result in something like this:

      $text =~ s/([<>])/'&#'.ord($1).';'/ge;
      vs
      $text =~ s/([<>])/'&#'.ord($1).';'/e;

      And not that hard to introduce such a bug when working on existing code to support new output mediums (such as in ajax responses or mobile or the like). In theory code review is supposed to catch it, but...

    3. Re:htmlspecialchars() by Peach+Rings · · Score: 1

      Does anyone understand what IF_HTML_FUNCTION is supposed to mean in the exploit code? As far as I can tell it's just plain text with no special meaning, it's just copied and pasted blindly from some previous code. Am I wrong?

    4. Re:htmlspecialchars() by Anonymous Coward · · Score: 2, Insightful

      Indeed, which is why everyone but Perl programmers use library functions rather than writing their own regular expressions for working with markup. As a bonus you avoid little bugs like forgetting to escape '&', and it'll probably escape '"' and ''' as well so you can use it for attributes.

    5. Re:htmlspecialchars() by Purity+Of+Essence · · Score: 1

      Yeah, I was wondering about this to. I ran into the exploit last night and noticed that in the page source. Fortunately, all the injected code did was insert a marquee comment asserting the video posters deviant sexuality while breaking the rest of the page.

      --
      +0 Meh
    6. Re:htmlspecialchars() by stereoroid · · Score: 1

      I saw something similar - like "Big Red Scrolling Text" in big red scrolling text, and the page cut off at that point. Looked to me like someone was playing with HTML tags, nothing more. I am running NoScript, as I suspect most Slashdot readers are, so nothing from outside YT got executed at all.

      --
      (this is not a .sig)
  4. Ha ha by grub · · Score: 1

    Awesome. The youtubers getting their panties in a knot have to lighten up. Based on some if their comments, you'd think the world was coming to an end.

    --
    Trolling is a art,
    1. Re:Ha ha by bsDaemon · · Score: 5, Funny

      Based on the typical YouTube comment (or video, for that matter), I already hard sort of expected that to be the case.

    2. Re:Ha ha by SpeedyDX · · Score: 4, Funny

      YouTube is supposed to be a kid-friendly place. Parents could do their best to try to responsibly monitor and guide their kids' surfing habits, but still fail because of this exploit. This is not funny, nor awesome. This is not someone finding a potential exploit and graciously letting Google know so they can patch it up. Just a bunch of 4channers screwing around, and to hell with the consequences. And people like you encouraging that type of behaviour.

      Just because this is The Internet(TM), it doesn't mean that common courtesy need not apply.

    3. Re:Ha ha by Anonymous Coward · · Score: 2, Informative

      From what I've seen, there were not only simple insults and racist annoyances, but numerous redirects to the hardest shock site you've probably ever seen. That video makes 2girls1cup, benzin.avi and even the hardest war-porn look like family-friendly softcore entertainment in comparison. It has something to do with 1 man and 1 jar and I dare you to Google that if you have doubt this is emotionally scarring material.

    4. Re:Ha ha by JohnFen · · Score: 1

      YouTube is supposed to be a kid-friendly place.

      Good lord, that's the funniest thing I've read in a while. Thank you.

      You tube itself (the videos) are generally fine, but the comment section is one of the more famous and major of the internet cesspools. I would never characterize it as "kid-friendly".

    5. Re:Ha ha by Anonymous Coward · · Score: 1, Insightful

      Have you taken a look in the real world lately. Common courtesy doesn't seem to apply there either.

    6. Re:Ha ha by mickwd · · Score: 1

      Well, given that such a low ID would have been given out a number of years ago now........

      People do get older, you know.

    7. Re:Ha ha by twidarkling · · Score: 4, Insightful

      Physical age doesn't necessarily correspond to mental age. Personally, I've been getting more immature as years pass.

      --
      Canada: The US's more awesome sibling.
    8. Re:Ha ha by negRo_slim · · Score: 1

      YouTube is supposed to be a kid-friendly place.

      Good lord, that's the funniest thing I've read in a while. Thank you.

      Yup soon the Texas Donk Squad will over take Sesame Street in children's programming.

      --
      On the Oregon Cost born and raised, On the beach is where I spent most of my days
    9. Re:Ha ha by jack2000 · · Score: 1

      It is so bad i had to re-purpose a greasemonkey script that changes the style of youtube to hide the comments section. What were they thinking taking out the option to hide the damn comments.

    10. Re:Ha ha by Cylix · · Score: 1

      Well, given that such a low ID would have been given out a number of years ago now........

      People do get older, you know.

      No they don't. PooFace!

      --
      "You should always go to other people's funerals; otherwise, they won't come to yours." -- Yogi Berra
    11. Re:Ha ha by bsDaemon · · Score: 1

      i don't know... what were they thinking allowing comments in the first place?

    12. Re:Ha ha by hattig · · Score: 1

      Pressure, meet fragile, breakable glass.

      Oh god, why why did I look for that as well?

      AND WHY WHY WHY!!!!!!!!!!! FFS!!!!!!!!!!!

    13. Re:Ha ha by Johnno74 · · Score: 4, Funny

      Physical age doesn't necessarily correspond to mental age. Personally, I've been getting more immature as years pass.

      "I have abandoned the quest for eternal youth and instead setttled for lifelong immaturity"

    14. Re:Ha ha by PBoyUK · · Score: 1

      Yes. Shortly after, blood soaked shards of glass start dropping out of his ruptured anus.

      It's one of those few times you feel lucky for the video being of poor quality. Though I can't blame youtube for having seen this. My curiosity led me to it some years ago,

    15. Re:Ha ha by GameboyRMH · · Score: 1

      Ohhhhhh, Donk as in Badonkadonk. I was expecting to see a group of cowboy-hatted heroes travelling in blinged-out cars with ridiculously huge rims solving crimes and teaching children important life lessons along the way.

      --
      "When information is power, privacy is freedom" - Jah-Wren Ryel
  5. Evolution of an exploit by Anonymous Coward · · Score: 5, Informative

    The evolution of this bug exploit was quite interesting to follow up close.

    At first it simply prevented any further comments to be posted.
    Then text was added.
    Then the text was scrolling.
    Suddenly, the entire page was blacked out except for the added text.

    And that's when the more technical minded people realized much much more was possible.
    Bam! Popups!
    Infinite popups that lead to browser crashes!
    Page redirects to shock sites!
    The most sophisticated version I saw actually replaced the Youtube video in-place with the 1man1jar video..

    And when the exploit was blocked in the comments, it had a small resurgence as video reply title, before being smacked down once more.

    Glorious.

    1. Re:Evolution of an exploit by larry+bagina · · Score: 5, Interesting

      Reminds me of the slashdot <a onhover=".."> bug. It was a while back (2000-2002 era?) but inline javascript wasn't filtered from a tags. The first exploit (that I saw, anyhow) simply used DHTML (as it was then known) to add (paraphrasing) "I can't believe this hasn't been fixed" to the post. (which took about 5 minutes given the speed of computers, javascript, and dom manipulation). About 30 seconds later, redirects to porn, last measure, etc appeared. Slashdot's initial response was to mod them down to -5 and then deleting them.

      --
      Do you even lift?

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

    2. Re:Evolution of an exploit by wmbetts · · Score: 4, Insightful

      I'm really surprised it used for trolling rather than making money. That seems like a phishers wet dream.

      --
      "Ubuntu" -- an African word, meaning "Slackware is too hard for me". - stolen from Dan C alt.os.linux.slackware
    3. Re:Evolution of an exploit by Anonymous Coward · · Score: 4, Interesting

      I saw someone on /g/ claim to have pulled 300k+ youtube user cookies doing this. The bad thing is your YT account is usually tied to gmail now. Scary... glad I had noscript on.

    4. Re:Evolution of an exploit by baka_toroi · · Score: 1

      So you'd rather have phishers/scammers fuck you over than a silly joke?

    5. Re:Evolution of an exploit by nurb432 · · Score: 1

      Trolling is just a distraction from the real meat.

      --
      ---- Booth was a patriot ----
    6. Re:Evolution of an exploit by hattig · · Score: 2

      Hmm, I remember that, I remember embedded Freshmeat as an embedded iframe thing into a Slashdot post at the time...

      I don't think I could do that off the top of my head anymore. But my cooking skills have improved!

    7. Re:Evolution of an exploit by Cyberllama · · Score: 1, Troll

      Youtube is on Noscript's whitelist by default.

    8. Re:Evolution of an exploit by alexo · · Score: 1

      There is something to be said for BB Code.

    9. Re:Evolution of an exploit by icebraining · · Score: 1

      Then you should contact him to update the FAQ, because it says nothing about Youtube.

    10. Re:Evolution of an exploit by Cyberllama · · Score: 1

      That's odd. Perhaps it was on the whitelist when I installed it (well over a year ago) but isn't anymore. I recall it being whitelisted by default then, but I suppose I could be crazy.

    11. Re:Evolution of an exploit by mzs · · Score: 1

      I think the parent confused yahoo and youtube simply.

  6. An update by Virak · · Score: 5, Informative

    They actually got it fixed a bit after I submitted this story. A shame, lemonparty was a big step up from the usual level of discussion on YouTube videos. More seriously, I'm interested in finding out exactly what happened here. Hopefully Google will post some sort of explanation. YouTube is a massive site and it's somewhat bizarre seeing them make the sort of mistake you'd expect from something put together by a drooling moron with nothing but a "How to learn PHP in 24 hours!" book.

    1. Re:An update by mikael_j · · Score: 1

      Yes, this does seem like the kind of bug I'd expect halfway competent dev to take into consideration when building a site. A very simple fix is to translate all < and > characters to the & lt; and & gt; versions instead, AFAIK youtube doesn't even allow HTML in comments anyway...

      --
      Greylisting is to SMTP as NAT is to IPv4
    2. Re:An update by MalHavoc · · Score: 2, Interesting

      I'd also be interested in knowing if this bug had been an issue for a long time. It seems like the sort of exploit that would have been very quickly discovered. I'm not a big YouTube comment reader, but I've noticed some interface/UI tweaks to the way comments can be thumbed up/down in recent weeks. Perhaps this crept in as a result of those.

  7. They hid all comments... by Inf0phreak · · Score: 5, Insightful

    wait for it... wait for it... And nothing of value was lost!

    --
    ________
    Entranced by anime since late summer 2001 and loving it ^_^
    1. Re:They hid all comments... by Yvanhoe · · Score: 1

      The day youtube implements a slashcode moderation system, internet will awake to global consciousness...

      --
      The Wise adapts himself to the world. The Fool adapts the world to himself. Therefore, all progress depends on the Fool.
    2. Re:They hid all comments... by hankwang · · Score: 1

      Obligatory: http://xkcd.com/202/

    3. Re:They hid all comments... by Kreigaffe · · Score: 1

      at least most of the youtube comments are most likely made after the video has been viewed. they sorta have a leg up on slashdot there.

      ps: no i didn't read the article

      --
      ... still waiting for this free-as-in-beer free beer I keep hearing about. :|
    4. Re:They hid all comments... by GameboyRMH · · Score: 1

      It looks like the Arachnotron from Doom 2, but with a giant butt instead of a giant brain. A much scarier monster. I'd hate to see its goatse attack x_x

      --
      "When information is power, privacy is freedom" - Jah-Wren Ryel
  8. Really? by Dremth · · Score: 2, Interesting

    Wow. You'd think somebody would've figured out something like this a long time ago.

    1. Re:Really? by Scrameustache · · Score: 4, Insightful

      Wow. You'd think somebody would've figured out something like this a long time ago.

      But since merely gazing at youTube comments lowers your IQ by at least 20 points, I'm actually amazed someone found it. Must have used some of kind of proxy who looked at it, got dumber for it, but managed to pass along the code to someone who could look at it without being exposed to the dumb.

      --

      You can't take the sky from me...

  9. It happened to Slashdot years ago. by Anonymous Coward · · Score: 1

    Someone used an > to fool the tag parser and did recurring alert boxes and also redirects to Goatse. It's quite a common problem, as illustrated by Bobby Tables.

  10. The very definition of Youtube by Anonymous Coward · · Score: 5, Funny

    Lots of people anonymously "injecting" a bunch of crap into a website for all others to see.

    This exploit is just an alternative to the original "Upload Video" button.

  11. I'd love to see the Comments removed period by Anonymous Coward · · Score: 2, Interesting

    A lot of the comments are just troll BS. Most people log on for videos not to read the ramblings of basement dwelling trolls. I try to ignore them but they can be really obnoxious. I don't post on Youtube but I have had things pirated and posted just so they could make obnoxious comments. The work posted was just previs stuff that was just done for editing slugs but it was presented as finished work. It caused some trouble with a client so I got a lot more careful about letting development work out there. It's just sad a handful have to spoil things for everyone else. I used to post a lot of development work on my web site but I stopped completely. Trolls are like the people that talk and answer phone calls and take infants to movies. They really spoil the experience for the rest of us. I say if the comments can't be a constructive outlet then remove them and get rid of that security hole completely. The other option for security would be removing the HTML and go pure text. It's nice having HTML input but you don't really need the formatting for comments and it's always going to be a source of potential holes.

    1. Re:I'd love to see the Comments removed period by grumbel · · Score: 4, Interesting

      A lot of the comments are just troll BS.

      Yes, but I blame the comment system for that. A comment system that doesn't allow links, doesn't allow more then a handful of characters, is a complete usability nightmare when you want to browse more then the last ten comments, doesn't allow search and doesn't support threads or replies properly is just useless when you actually want to write something insightful. A comment system should encourage informative posts, not make them impossible like the Youtube system does.

      The latest changes that the highest rated comments and comments from the video upload appear on top have helped a bit to cleanup the mess, but its still far away from being a comment system where people actually can have a meaningful discussion.

    2. Re:I'd love to see the Comments removed period by Thantik · · Score: 2, Interesting

      On top of that they need to implement some sort of penalty system for people who regularly post things that are downvoted. If out of 10 posts, the amount of downvotes you've gotten is higher than 80% then implement a week long "cool-off" period in which it resets to 0

    3. Re:I'd love to see the Comments removed period by Dr+Herbert+West · · Score: 3, Informative

      Really? You put client-facing work on YouTube? Ouch.

      If you don't want to spare the bandwidth on your own site (how much data are you pushing, anyway?) then try Vimeo. Cleaner, better optimization, has private (need a password) channels, offers a "pro" service where you get unlimited uploads, etc.

      It's mainly used by video artists, tech demos, etc.

    4. Re:I'd love to see the Comments removed period by Lije+Baley · · Score: 1

      Yes, if only they had a more sophisticated comment system, then the level of discourse would be closer to that of Slashdot or /b/.

      --
      Strange things are afoot at the Circle-K.
  12. Why natural language needs grouping symbols by Anonymous Coward · · Score: 5, Funny

    a "How to learn PHP in 24 hours!" book

    Does that mean:

    1. It teaches you, over the course of an unspecified period of time, how to learn PHP in 24 hours?
    2. It teaches you, over the course of 24 hours, how to learn PHP? or
    3. After 24 hours have elapsed, it teaches you how to learn PHP?

    Note that it doesn't actually teach you PHP. It just teaches you how to learn it.

    1. Re:Why natural language needs grouping symbols by JamesP · · Score: 1

      Actually, it teaches you PHP if you're on the cast of '24 hours'

      --
      how long until /. fixes commenting on Chrome?
    2. Re:Why natural language needs grouping symbols by maxwell+demon · · Score: 3, Funny

      No, it tells you how you learn the lesser-known language named "PHP in 24 hours" which differs from normal PHP in that the scripts always take 24 hours to run.

      --
      The Tao of math: The numbers you can count are not the real numbers.
    3. Re:Why natural language needs grouping symbols by weicco · · Score: 2, Funny

      I can't wait 24 hours! Got to get 12 hour book...

      --
      You don't know what you don't know.
    4. Re:Why natural language needs grouping symbols by roman_mir · · Score: 1

      It does no such thing, that book talks about a guy I know, who is about to learn PHP. The guy's name is How, yes all my friends are like that.

    5. Re:Why natural language needs grouping symbols by CODiNE · · Score: 2, Funny

      I've seen the book, option 3 is the correct answer.

      It's 1,440 pages of "Wait one minute, then turn the page" which sadly forces one into an inescapable loop for 24 hours. After one has starved, missed sleep and soiled oneself through this excruciating 24 hour period the last page says only this:

      Buy the book titled 'This book teaches you PHP'.

      I was thoroughly disappointed.

      --
      Cwm, fjord-bank glyphs vext quiz
    6. Re:Why natural language needs grouping symbols by tomhudson · · Score: 1

      I'm in Canada - we're on METRIC time, you insensitive clod! 100 seconds per minute, 100 minutes per hour, 10 hours per day!

    7. Re:Why natural language needs grouping symbols by noidentity · · Score: 1

      Note that it doesn't actually teach you PHP. It just teaches you how to learn it.

      Does this mean that you learn how to teach it?

    8. Re:Why natural language needs grouping symbols by osu-neko · · Score: 5, Funny

      No, it tells you how you learn the lesser-known language named "PHP in 24 hours" which differs from normal PHP in that the scripts always take 24 hours to run.

      An optimized version, then? ;)

      --
      "Convictions are more dangerous enemies of truth than lies."
    9. Re:Why natural language needs grouping symbols by Anonymous Coward · · Score: 1, Informative

      That's DECIMAL time, not metric time.

      SI units only define second, so there is 1 second, 1 kilo-second, 1 mega-second, 1 giga-second, etc...

      http://en.wikipedia.org/wiki/Decimal_time
      http://en.wikipedia.org/wiki/Metric_time

      If you look in the first link, you'll notice that 1 decimal-second = 0.864s

    10. Re:Why natural language needs grouping symbols by Kreigaffe · · Score: 4, Funny

      The first time I hear anyone ever fucking utter the word "Kibisecond" I'm just going to shoot them in the face. There's no other choice.

      --
      ... still waiting for this free-as-in-beer free beer I keep hearing about. :|
    11. Re:Why natural language needs grouping symbols by safetyinnumbers · · Score: 1

      No, it tells you how you learn the lesser-known language named "PHP in 24 hours" which differs from normal PHP in that the scripts always take 24 hours to run.

      Well that's the Halting Problem sorted then. Faster cgi scripts - not so much.

    12. Re:Why natural language needs grouping symbols by Anonymous Coward · · Score: 2, Funny

      How many Lojbanists does it take to change a broken light bulb? ...

      Two: one to figure out what to change it into, and one to figure out what kind of bulb emits broken light.

    13. Re:Why natural language needs grouping symbols by mpeskett · · Score: 1

      If I ever need to refer to 1024 seconds, I'll be sure to do so when you're not around.

    14. Re:Why natural language needs grouping symbols by tom17 · · Score: 1

      They are a bit late, its all x.org now.

    15. Re:Why natural language needs grouping symbols by mjwx · · Score: 2, Funny

      If I ever need to refer to 1024 seconds, I'll be sure to do so when you're not around.

      Dont worry, he'll be back in a kibisecond.

      --
      Calling someone a "hater" only means you can not rationally rebut their argument.
    16. Re:Why natural language needs grouping symbols by L4t3r4lu5 · · Score: 2, Insightful

      Self-fulfilling prophecy?

      It's been nice knowing you.

      --
      Finally had enough. Come see us over at https://soylentnews.org/
  13. Exploits by REggert · · Score: 1

    I wonder how many times this vulnerability was used to deliver malware.

    --

    cp /dev/zero ~/signature.txt

  14. tags, quoting and XSS by Gopal.V · · Score: 1

    If I had to guess, I think it's a variant of an attack I've seen before.

    1. Re: tags, quoting and XSS by Peach+Rings · · Score: 1

      Ah the intricacies of the Firefox codebase.

  15. Someone needs to lose their job over this by l0ungeb0y · · Score: 1, Funny

    What idiot doesn't check user input with at least a regex replace to look for offending tags in fields *YOU KNOW* will be rendered by an HTML interpreter (browser)?
    Languages like PHP even have built-in routines that will strip out all HTML tags except for safe one you specify, it's been a few years, but I believe it's called htmlSafeTags(string, array of safe tags).

    This isn't a simple mistake, it's a sign of pure incompetence since the developer put no forethought into the uses of the tool he was developing and blindly trusted user input from a textarea. User input is dirty, dirty dirty and any developer who does not clean and sanitize it before consuming it is not doing his/her job.

    1. Re:Someone needs to lose their job over this by Krahar · · Score: 5, Informative

      This isn't a simple mistake, it's a sign of pure incompetence since the developer put no forethought into the uses of the tool he was developing and blindly trusted user input from a textarea. User input is dirty, dirty dirty and any developer who does not clean and sanitize it before consuming it is not doing his/her job.

      The summary states that the first script tag was escaped as it should be. It was a bug, not a lack of foresight.

    2. Re:Someone needs to lose their job over this by Sigma+7 · · Score: 1

      What idiot doesn't check user input with at least a regex replace to look for offending tags in fields *YOU KNOW* will be rendered by an HTML interpreter (browser)?

      http://thedailywtf.com/articles/injection-proofd.aspx

      Reactive regexing offending tags such as "script", "object" or "embed" don't work if you don't know they exist. As such, it's easier to simply include functions in the programming language API that escape/unescape strings sent in through user input so that junk like that doesn't get echoed into something hazardous.

    3. Re:Someone needs to lose their job over this by lgw · · Score: 1

      YouTube doesn't support HTML in comments, so someone got too clever for their own good.

      Here's a simple solution to avoid all this sort of BS forever: reject any comment with the < or & characters in it. Done. Why do extra work to create security holes?

      --
      Socialism: a lie told by totalitarians and believed by fools.
    4. Re:Someone needs to lose their job over this by christopherfinke · · Score: 1

      reject any comment with the < or & characters in it.

      What if you want to comment about AT&T or write a mathematical equation stating that x < y.

      Users should be able to enter anything they want; htmlspecialchars() and nl2br() ensure that it will be displayed exactly as they entered it.

    5. Re:Someone needs to lose their job over this by LordSnooty · · Score: 1

      Freedom of speech? You'll take my ampersand from my cold, dead hands.

    6. Re:Someone needs to lose their job over this by The+MAZZTer · · Score: 1

      Sounds like someone forgot the global flag on their regex.

    7. Re:Someone needs to lose their job over this by soliptic · · Score: 1

      idiot ... check user input with ... a regex

      ahem.

    8. Re:Someone needs to lose their job over this by sourcerror · · Score: 1

      If there's a script tag in a comment, it's obviously malicious, so it shouldn't have appeared after all. (You know, telling the submitter that it's malformed.)

    9. Re:Someone needs to lose their job over this by Krahar · · Score: 1

      If you are watching a video about doing something in HTML and Javascript, then I'd expect that the comments could have quite a few script tags in them that the submitters fully expect to be displayed without malicious intent.

    10. Re:Someone needs to lose their job over this by lgw · · Score: 1

      Have you read Youtube comments? Clearly not, or you wouldn't be going on about mathematical equations. All of the common insults popular amoung school childer are possible without special characters, so it would be fine - you barely need capital letters.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    11. Re:Someone needs to lose their job over this by thejynxed · · Score: 1

      Or better yet, don't allow scriptable elements/strings in the user input period. A general purpose video site does not need or require fancy formatting or scripting elements in comments.

      Plain text. It works folks.

      --
      @Mindless Drivel: 100% of Twitter posts ever Tweeted.
  16. Interest pondering the how and why of such fails by DRJR · · Score: 3, Interesting

    I find it interesting pondering the how and why these things fail-- the insight into how the code must have been put together to fail on a particular input.

    My initial guess for this one would be that they escape html and scripts separately-- scripts do not need greater than, less than, and ampersand escaped-- and that detecting the keyword 'script' switched modes from html to script. The fact that the first script tag is properly html-escaped suggests that while it was properly detected, the code to switch between html and script modes did not take this detection into account and switched anyway. I'm going to further guess that this do to some support code meant for the programmers' side inadvertently managed to cross over into user land.

    My two cents.
    --Dave Romig, Jr.

  17. ... if you want to keep it by xororand · · Score: 4, Informative

    Get the YouTube Comment Snob addon for Firefox.

    YouTube Comment Snob filters out undesirable comments from YouTube comment threads. You can choose to have any of the following rules mark a comment for removal:

    * More than # spelling mistakes: The number of mistakes is customizable, and the extension uses Firefox's built-in spell checker.
    * All capital letters
    * No capital letters
    * Doesn't start with a capital letter
    * Excessive punctuation (!!!! ????)
    * Excessive capitalization
    * Profanity

    1. Re:... if you want to keep it by Rallion · · Score: 4, Funny

      *Reads list of filtering options*

      So does it just hide the whole comment section, or show it as being empty?

    2. Re:... if you want to keep it by ObsessiveMathsFreak · · Score: 1

      You mean, people actually read Youtube comments enough to warrant this addon?

      --
      May the Maths Be with you!
    3. Re:... if you want to keep it by trajanus22 · · Score: 1

      Won't this have the same effect as turning the comments off?

    4. Re:... if you want to keep it by christopherfinke · · Score: 1

      You can turn this option off, or you can specify the language of the dictionary you want to use for spell-checking.

    5. Re:... if you want to keep it by Anonymous Coward · · Score: 1, Funny

      Did anyone else read that list as:

      * All capital letters
      * ????
      * Profanity

  18. Massive rickroll? by mwvdlee · · Score: 5, Funny

    If they didn't redirect ALL videos to a Rick Astley video, they have missed the opportunity of a lifetime.

    --
    Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
    1. Re:Massive rickroll? by Dachannien · · Score: 1

      I wanted to watch a Rick Astley video, but it redirected me to another Rick Astley video.

    2. Re:Massive rickroll? by DMiax · · Score: 1

      Not very original, since it was the april fool from youtube itself a few years ago.

  19. Re:Interest pondering the how and why of such fail by mwvdlee · · Score: 1

    Why would they have a distinction between a HTML and a script mode on comments? Is there any reason you'd ever want a comment to contain a script?

    --
    Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
  20. Is it Christmas already? by dswensen · · Score: 4, Interesting

    Comments turned off by default? Great! Any chance they can make that permanent?

    1. Re:Is it Christmas already? by Max+Romantschuk · · Score: 2, Insightful

      The comments never bothered me. I simply don't read them.

      --
      .: Max Romantschuk :: http://max.romantschuk.fi/
    2. Re:Is it Christmas already? by Wingnut64 · · Score: 4, Informative

      Any chance they can make that permanent?

      Use Addblock Plus and add the following element hiding rules:

      ##div#watch-discussion
      ##div.watch-comment-entry

      --
      echo 'Header append X-HD-DVD "0x09f911029d74e35bd84156c5635688c0"' >> /etc/apache2/httpd.conf
    3. Re:Is it Christmas already? by osu-neko · · Score: 1

      The comments never bothered me. I simply don't read them.

      This sounds good in theory. In practice, people who read a lot generally cannot help but successfully read entire sentences in their peripheral vision. Nothing short of removing the text from my visual field will prevent the meaning of the words from becoming instantly lodged in my brain the moment they appear anywhere visible.

      --
      "Convictions are more dangerous enemies of truth than lies."
    4. Re:Is it Christmas already? by corychristison · · Score: 1

      Use Addblock Plus

      I was not aware there was a version of Adblock Plus for those of us with A.D.D.!

      Spaghetti cat!

    5. Re:Is it Christmas already? by moonbender · · Score: 1

      I'm sure there's a Greasemonkey script that removes the comments. Hell, a user CSS hack would probably do it.

      --
      Switch back to Slashdot's D1 system.
    6. Re:Is it Christmas already? by Max+Romantschuk · · Score: 1

      This sounds good in theory. In practice, people who read a lot generally cannot help but successfully read entire sentences in their peripheral vision. Nothing short of removing the text from my visual field will prevent the meaning of the words from becoming instantly lodged in my brain the moment they appear anywhere visible.

      You're an accomplished speed reader.

      I read _a lot_ myself, but never learned the skill to read anything other than what I focus on for the most part. Simply reading a lot doesn't automatically grant you the skill to be able to read like you do. You likely have a genetic advantage... Or perhaps disadvantage, in this particular case. ;)

      --
      .: Max Romantschuk :: http://max.romantschuk.fi/
  21. Re:Interest pondering the how and why of such fail by linguizic · · Score: 1

    Exactly, why not just escape the whole thing? Or if you're even more paranoid, why not just strip the script tags and everything in between? That being said, the fact that this exploit exists in the first place shows that they're not doing either one of those things.

    --
    Does this sig remind you of Agatha Christie?
  22. Trolling as a method to expidite bug fixes? by twidarkling · · Score: 5, Interesting

    Since this was turned in to a massive, YouTube-wide trolling effort, it's being fixed nearly immediately. What if 4chan hadn't gotten a hold of it though? What if some scammers/spammers did? And used it for weeks? It would have been more subtle, and with YouTube's traffic, it could have been massively successful. Who knows what effect that could have had if this wasn't caught quickly. Did 4chan just do a good thing?

    --
    Canada: The US's more awesome sibling.
    1. Re:Trolling as a method to expidite bug fixes? by Anonymous Coward · · Score: 1, Interesting

      For some reason, you're assuming it wasn't used by scammers, and that it wasn't known for more than a few hours.

    2. Re:Trolling as a method to expidite bug fixes? by twidarkling · · Score: 1

      Fine, assume it was. If this hadn't happened, how much *longer* would it have gone on. My main point still stands, trolling expedited the bug fix.

      --
      Canada: The US's more awesome sibling.
    3. Re:Trolling as a method to expidite bug fixes? by Anonymous Coward · · Score: 1, Insightful

      Probably not long. Google isn't known for complacency, and popular web services in general react quickly. Except for Facebook, anyway.

      If it wasn't known, then it might have been undetected for weeks. But until Google says otherwise, we can't know that this wasn't already the case.

    4. Re:Trolling as a method to expidite bug fixes? by Anonymous Coward · · Score: 1, Interesting

      Probably. I know some people on 4chan /g/ though, hours before this hit slashdot, were bragging about getting people's youtube/gmail session cookies via an XSS attack through this exploit, then logging into their gmail accounts, looking for other account information to figure out the gmail password, as most people use the same password for everything (it's not so simple to simply reset the gmail password, as you need to re-enter in the current password again, having just the session cookie isn't enough). I'm sure a sizable portion of people had their email accounts hijacked.

      Who knows how long that has been going on.

    5. Re:Trolling as a method to expidite bug fixes? by phoenix321 · · Score: 1

      "What if 4chan hadn't gotten a hold of it though? What if some scammers/spammers did?"

      What tells you they didn't?

    6. Re:Trolling as a method to expidite bug fixes? by dkf · · Score: 1

      But until Google says otherwise, we can't know that this wasn't already the case.

      Fortunately, they already have all the data with potential exploits and are reasonably well known for their ability to search for things. Depending on how things are stored, it even might be as simple as doing a first-cut by looking for an unescaped < character.

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    7. Re:Trolling as a method to expidite bug fixes? by mxs · · Score: 1

      You assume, of course, that this bug is recent, 4chan was the first to discover it, and that there hasn't been any subtile, massively successful abuse for weeks.

    8. Re:Trolling as a method to expidite bug fixes? by JustinRLynn · · Score: 1

      4Chan did an obviously bad thing in comparison to someone doing a very bad thing in an insidious fashion. I'd compare it to solving the problem of urban decay through nuking the whole place... You have to do it from orbit, just to be sure.

  23. Server vs. Client? by Kaenneth · · Score: 1

    How much of this kind of problem is caused by the standard behavior of browsers to make a 'best guess' at interpreting 'bad' HTML, since the parsing rules are very lax compared to XML?

    Should unmatched tags cause the browser to stop and say 'Parsing Error, Invalid HTML'? (or whatever user-friendly message the browser author writes)

    'cause I could totally imagine someone, somewhere writing a browser that sees '&lt's and auto-re-encodes them, then does it's tag parsing.

    Back around 1998 I worked for a company that made e-commerce sites as their first tester for less than a month. The first bug I found was that a new user could insert script tags in their username (any field, really), my employers response was "Why would anyone want to hack a website?"... I wouldn't drop the issue, so they dropped me.

    1. Re:Server vs. Client? by PatPending · · Score: 1

      The first bug I found was that a new user could insert script tags in their username (any field, really), my employers response was "Why would anyone want to hack a website?"... I wouldn't drop the issue, so they dropped me.

      Did you then DROP their tables?

      --
      What one fool can do, another can. (Ancient Simian Proverb)
  24. as usual, xkcd has this covered: by http · · Score: 2, Interesting
    --
    If opportunity came disguised as temptation, one knock would be enough.
    3^2 * 67^1 * 977^1
  25. Take inspiration by Robotron23 · · Score: 1

    Get inspired from places with mature attitudes on drug abuse; those with safe injecting sites.

    Youtube feels like a drug to me at times...I'd elaborate on this viewpoint but a vid of a cat and a dog chasing their own tails at the same time interests me more.

  26. I'm just worried about... by dandart · · Score: 1

    someone stealing my cookies. They're MY cookies. -_-

  27. The Safari Shut Up extension by bonch · · Score: 1

    Shut Up is a Safari extension that removes the comment sections from several popular websites. Enjoy less bullshit in your web browsing.

  28. doesn't work anymore by xororand · · Score: 1

    I haven't actually tried Comment Snob addon in some time and it seems that it hasn't been updated to work with the latest changes on YouTube. Maybe someone with a little free time has the passion to fix it.

    1. Re:doesn't work anymore by christopherfinke · · Score: 4, Informative

      I'm the author, and I uploaded a new version that works with the latest YouTube design a few days ago. It's just pending approval by Mozilla.

    2. Re:doesn't work anymore by Doctor_Jest · · Score: 1

      Thanks for the update! I was scratching my head until I realized there was a "redesign" on the part of Youtube. :)

      --
      It's the Stay-Puft Marshmallow Man.
  29. Keep It Simple by DrYak · · Score: 1

    Nice, long and contrived explanation.

    Much more likely they forgot to set the correct parameter to have ALL the occurrence replaced instead of the left-most longest occurrence.
    (for example, they forgot to put a "g" after the RegExp)

    --
    "Sufficiently advanced satire is indistinguishable from reality." - [Tips: 1DrYakQDKCQ6y52z6QbnkxHXAocMZJE61o ]
    1. Re:Keep It Simple by DRJR · · Score: 1

      Sadly, something like that-- using the wrong regular expression-- would be the simple example at most places I've worked. I've often found the cause of some bugs to convoluted to the point of being baffling. I've seen a commercial PHP script that used an if-then statement with dozens of branches that each did nothing more that included a single file, nested, and then did it again. The final include files were almost identical except the name of the product to be displayed and its description. I was to add a product to that mess. I was mystified as to how someone thought _that_ was a good idea. Well, I got permission and rewrote it into a database lookup in maybe 15 minutes. Adding new products afterwards was certainly easier.

      Interesting thought about the missing global flag, though. Considering it appeared to replace all occurrences except in that one case, I'm leaning away from that. I guess there could have been multiple expressions in play where one was missing a flag, but I cannot think of a reason off hand why someone would want to do that.

      You did get me thinking though-- as I once wrote a parser in PHP using PERL Regular Expressions just for kicks-- how easy it is to blow the backtrack limit or the recursion limit when using recursion to properly handle more than one state. Once only subpatterns (either via adding + after + or . or via (?>) ) ultimately kept things under control (and was good for speed too), but I did not add them until my expression was confirmed working properly. During my first test run to verify the expression, I blew the backtrack limit which caused the expressions to silently stop replacing the string and return the rest of it unchanged. A separate call (which wasn't added to the final version) is required to detect the error although it quickly became obvious what had happened. The error patterns are similar. However, a complex pattern would be required to cause it. Again that could be caused by the wrong pattern, a programmer's test pattern instead of the one intended for the user.

      Obviously I don't know the answer any more than anyone else does (save those at Google/youTube). I speculate for fun because its interesting and it keeps me thinking-- which always comes in handy at debug time.

      Thanks for the alternate viewpoint.
      --Dave Romig, Jr.

  30. Regarding the Zoho topic this is ironic by thetoadwarrior · · Score: 1

    We only just had a big debate over whether going to university makes you a better coder or not in the Zoho topic. http://news.slashdot.org/story/10/07/01/208222/Zoho-Dont-Need-No-Stinking-PhD-Programmers

    In there Google and their army of PhDs was mentioned as proof that a degree really matters.

    It appears even with a PhD you're still susceptible to making school boy errors. Zoho can make these sorts of errors for much less by hiring kids straight out of high school. :P

    1. Re:Regarding the Zoho topic this is ironic by Jane+Q.+Public · · Score: 1

      The fact that educated people make mistakes is not equivalent to whether uneducated people can make educated programming decisions.

      Outside of school, do you really think someone will pick up on the math and other concepts necessary to, for just one example, calculate the Big-O of a part of their program? Or understand why they should?

    2. Re:Regarding the Zoho topic this is ironic by MillionthMonkey · · Score: 1

      Outside of school, do you really think someone will pick up on the math and other concepts necessary to, for just one example, calculate the Big-O of a part of their program?

      Sure, why not? I found it to be O(1).

    3. Re:Regarding the Zoho topic this is ironic by thetoadwarrior · · Score: 1

      Yes I do think they can. The fact is they can get the same books that uni students use. They lack thw professor but between the books and internet I don't think it is a big deal.

      The other thing to keep in mind is that it wasn't a serious comment so no need to get sand in your pussy.

    4. Re:Regarding the Zoho topic this is ironic by Jane+Q.+Public · · Score: 1

      Sure they can. I don't dispute that. My question is, how many of them will? My guess -- and I think it's a good guess -- is pretty damned few.

  31. So - I don't care by tuomoks · · Score: 1

    It's only bad design / coding / development - who cares! It happens all the time and will happen as long as the subpar designs / development / coding is allowed. Mostly I would blame the design of these systems - it's very difficult to (safely) implement anything which is already broken, as most of the systems today! Or - if you don't agree, list the systems that haven't been broken one time or other? Or - which will not be broken in future?

    Seriously - after fighting long enough years for safe and secure design, I honestly don't understand these? It has been 100% - really hundred percent - every time a problem with design for no other reason except ignorance, greed, lack of experience, whatever - but anyway something you would have got fired earlier! Now - blame others, blame a product, blame a vendor, blame a hacker, etc - give me a break!

  32. Re:Interest pondering the how and why of such fail by DRJR · · Score: 1

    Agreed. I think that's what they were trying to do, but it failed. Another poster reminded me of a particular way PERL Regular Expressions can fail in PHP that would an escaping half-processed in this manner.

    You have to wonder, though, most languages designed for web pages already have an optimized function for this type of escaping. Why not use it? Either they are trying to be clever or they reinvented the function in an incomplete way.

    Maybe if the paranoia level it low, they'll announce what it was when its fixed.
    --Dave Romig, Jr.

  33. Not all comments turned off. by formfeed · · Score: 1

    Actually, all youtube-comments marked "insightful" were still readable...

  34. What I learned from this story by SmallFurryCreature · · Score: 3, Funny

    What I learned from this story:

    That goatse.cx is very old news and that there are whole new horrors I never even heard of.

    Someone must be looking out for me.

    You know you are living a blessed life when you got no idea what 1man1jar or lemon party is. Reminds me of being a little kid and having no idea what the adults were talking about. Only this time I know the value of ignorance.

    Let me see. 1 man 1 jar, must be about a man collecting pennies to buy a gift for his mother.

    Lemon party? Sweet lemonade for a hot summer day? Sounds fun.

    2girls1cup? Two girls riding the magic cup at disney?

    Please, don't correct me. Ignorance is bliss.

    --

    MMO Quests are like orgasms:

    You may solo them, I prefer them in a group.

    1. Re:What I learned from this story by GameboyRMH · · Score: 1

      Isn't it funny that in ye olden days of the interwebs hello.jpg was the worst thing out there...and now it hardly qualifies as shock material. Just a dude stretching a natural orifice with his boring ol' hands, yawn. Imagine what will be considered serious shock material 10 years from now...or don't.

      --
      "When information is power, privacy is freedom" - Jah-Wren Ryel
  35. 1 Man 1 Jar? Big deal. by GameboyRMH · · Score: 1

    1 Man 1 Jar is in the same league as 2 Girls 1 Cup or Mr. Hands. Not up in the same league with the Ukrainian snuff videos, benzin.avi or terrorist beheading videos, and certainly not the "hardest you've ever seen" unless you're new to the Internet.

    That said a man stuffing a jar up his ass and having it break is still not something you want to see.

    --
    "When information is power, privacy is freedom" - Jah-Wren Ryel