Live data from Hacker News

XSS Twitter in minutes; Why you shouldn't store important data with 37signals

brian.mastenbrook.net

21–30 of 61 posts

Re: XSS Twitter in minutes; Why you shouldn't store important data with 37signals

#21
I think what we've really learned from this is that the current JavaScript security model is not good for what people are using the web for these days.

We really need something like a "" block, where anything inside could never use JavaScript (including links that are to javascript: URLs). This would make life a lot easier for web developers.

Re: XSS Twitter in minutes; Why you shouldn't store important data with 37signals

#22

I think what we've really learned from this is that the current JavaScript security model is not good for what people are using the web for these days. We really need something like a " " block, where anything inside could never use JavaScript (including links that are to javascript: URLs). This would make life a lot easier for web developers.

Then XSS attacks would insert before =)

What we need is literal separation of control statements (eg, ) from content such that neither can be easily misinterpreted, but that would be a significant departure from existing design.

Re: XSS Twitter in minutes; Why you shouldn't store important data with 37signals

#23

I think what we've really learned from this is that the current JavaScript security model is not good for what people are using the web for these days. We really need something like a " " block, where anything inside could never use JavaScript (including links that are to javascript: URLs). This would make life a lot easier for web developers.

Then XSS attacks would insert before =) What we need is literal separation of control statements (eg, ) from content such that neither can be easily misinterpreted, but that would be a significant departure from existing design.

That shouldn't work for the same reason that you can't escape a bound SQL query parameter in a pre-parsed query.

Re: XSS Twitter in minutes; Why you shouldn't store important data with 37signals

#24
post #10

Can someone help to compile a good security policy and guideline for web apps? I guess every web app should have a page dedicated to security similar to privacy policy and terms of service. What are the essential information should go there? Special email dedicated to report security issues? PGP key to encrypt emails? and What else?

Don't trust any data that comes from outside your app (urls, querystrings, http request headers, databases, files) and you'll be right. Perl's Taint Mode enforces this automatically. Don't know if any other languages have it? http://www.webreference.com/programming/perl/taint/

I don't think taint mode is helpful for this. All data comes from outside of your program, but you somehow still have to display it. As we've seen recently, this is hard to get right. Escaping HTML is one thing, but what if you want to let a user type in a URL? Make sure to exclude javascript: URLs. Even if you whitelist only "http://... URLs, how do you know that a browser bug won't allow an attacker to inject JavaScript, compromising any account used by a user of that web browser?

Basically, web browsers need taint mode. The programming language that produces the web page is a whole other issue.

Re: XSS Twitter in minutes; Why you shouldn't store important data with 37signals

#25
post #23

Earlier quoted context omitted.

Then XSS attacks would insert before =) What we need is literal separation of control statements (eg, ) from content such that neither can be easily misinterpreted, but that would be a significant departure from existing design.

That shouldn't work for the same reason that you can't escape a bound SQL query parameter in a pre-parsed query.

That would require escaping the HTML on the server prior to output, which is exactly what we already have (and regularly fails, even when people think they're doing it right).

The real analogue to SQL query parameter binding would be an output format that keeps the two distinct.

Re: XSS Twitter in minutes; Why you shouldn't store important data with 37signals

#26
post #23

Earlier quoted context omitted.

That shouldn't work for the same reason that you can't escape a bound SQL query parameter in a pre-parsed query.

That would require escaping the HTML on the server prior to output, which is exactly what we already have (and regularly fails, even when people think they're doing it right). The real analogue to SQL query parameter binding would be an output format that keeps the two distinct.

Or encoding all the text in the tag, or , or etc etc etc.

It's kind of a moot point since it will never happen, but it's not rocket science.

Re: XSS Twitter in minutes; Why you shouldn't store important data with 37signals

#27
post #18

I'm usually the first person here to jump to 37s' defense. I know some of their people, they're hometown heroes, and I use and like their products. This is hard to defend, guys. It is literally the-simplest-thing-not-to-fuck-up. Nobody's asking you not to have security vulnerabilities. In fact: nobody's even asking you to fix vulnerabilities. We just need a reliable way to communicate with you about them. If you're s…

Actually it's pretty easy to defend.

I never used to have travel insurance but after my first intercontinental flight my suite-case broke and I learned the importance of having one.

In a perfect world your support team would be able to distinguish between someone rambling about bytes and an actual security issue. That's hard without a lot of technical knowledge.

I believe that's why the Rails security team responded rather quickly and 37 Signals support team didn't. I'm sure they will do better in the future.

Re: XSS Twitter in minutes; Why you shouldn't store important data with 37signals

#28

I think what we've really learned from this is that the current JavaScript security model is not good for what people are using the web for these days. We really need something like a " " block, where anything inside could never use JavaScript (including links that are to javascript: URLs). This would make life a lot easier for web developers.

Ironically applications that bypass HTML entirely and use JavaScript to build up the DOM (e.x. Cappuccino apps) are largely immune to XSS attacks (as long as you avoid innerHTML and such)

Re: XSS Twitter in minutes; Why you shouldn't store important data with 37signals

#29

I think what we've really learned from this is that the current JavaScript security model is not good for what people are using the web for these days. We really need something like a " " block, where anything inside could never use JavaScript (including links that are to javascript: URLs). This would make life a lot easier for web developers.

It's probably better to disable the JavaScript engine based on certain heuristics, for instance when there is invalid character encoding in attributes.

Re: XSS Twitter in minutes; Why you shouldn't store important data with 37signals

#30
post #27
post #18

I'm usually the first person here to jump to 37s' defense. I know some of their people, they're hometown heroes, and I use and like their products. This is hard to defend, guys. It is literally the-simplest-thing-not-to-fuck-up. Nobody's asking you not to have security vulnerabilities. In fact: nobody's even asking you to fix vulnerabilities. We just need a reliable way to communicate with you about them. If you're s…

Actually it's pretty easy to defend. I never used to have travel insurance but after my first intercontinental flight my suite-case broke and I learned the importance of having one. In a perfect world your support team would be able to distinguish between someone rambling about bytes and an actual security issue. That's hard without a lot of technical knowledge. I believe that's why the Rails security team responded…

The problem isn't that 37S tech support doesn't know how UTF-8 works. The problem was that security reports were routed to tech support in the first place. Again, the solution to this problem is a single web page with just a couple pieces of information on it.
Post reply on HN