David Recordon ([info]daveman692) wrote in [info]lj_dev,
@ 2006-01-26 16:36:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Discussing The Security Changes
As we announced last week in [info]news, we have changed the canonical URL of most journal, community, and syndicated content. We have also now changed our cookie handling as Brad previously described. In the end this means that it is much more difficult to steal a useful cookie. Our goal with our new cookie scheme is to limit the damage that can occur when your cookies do get stolen, which we're just going to assume is inevitable, as vulnerabilities have been found in all major browsers and we're quite sure new vulnerabilities will continue to be found.

Shortly before our news post last week, we became aware that it was possible to use the “-moz-binding” CSS attribute within Mozilla and Mozilla Firefox to execute arbitrary offsite JavaScript. As this attribute is designed to allow attaching an XBL transform and JavaScript to any node within the DOM, it is quite easy to use in a malicious fashion. A bug has also been filed in Mozilla's BugZilla tracker to try and address this issue. Over a year ago, we sponsored and developed a patch for Mozilla to support HTTPOnly cookies which emerged in Internet Explorer 6 and would have prevented this attack, though this patch was never included in Mozilla.

We immediately altered our cleaner to strip this attribute from entries and comments, though also realized that wasn't even half the battle. As we allow custom CSS in many of our styles, as well as the ability to link to an external stylesheet in a variety of fashions, it was quite possible to take advantage of this exploit and hijack the session cookie of any user who views your journal. As we, along with many other sites, used one cookie to authenticate a user, this cookie was quite powerful if stolen. If the user had not chosen to bind their cookie to their IP address, a malicious user could steal it, login as that user, deface the account and spam with it, as well as modify that user's style to include the exploit thus causing this problem to spread much like a virus.

Borrowing the idea from another development team within Six Apart, we decided we needed to break our cookies into three categories. One cookie would be our master cookie, this cookie would only be accessible on www.livejournal.com where we will not display untrusted content. A second cookie will be accessible on all subdomains of livejournal.com, though it only will say if you are logged in or not; it is solely for optimization. We then will issue one cookie for each journal you visit. This cookie will be only accessible on username.livejournal.com or community.livejournal.com/username as it is limited to a single journal. This cookie will only grant you the permission to read protected entries and post in the particular journal. This means that if the journal owner steals your cookie, they will be able to do nothing more than view their journal as if they are you. In the end you will have n+2 cookies, with n being the number of journals you visit.

Due to the fact that we cannot clean every external CSS stylesheet linked to every time we generate a journal page, this change is required. While it does not fully protect us from some new cross site scripting vulnerability that can be exploited via entries or comments, they are much easier to block, patch, and recover from quickly. With Mozilla deciding to allow the execution of arbitrary JavaScript via CSS, there is no other viable solution than the one we have undertaken.

We've already taken a variety of steps to further protect your account such as we've implemented a page where you can see all of your login session, now require your password to change your email address, and now send secure password reset emails. We also are planning future improvements, especially related to external CSS stylesheets, and hope everyone realizes the amount of attention we place on the security of every account. We're more than happy to answer any questions you have in regards to the changes we've made over the past week, though also hope it is understood that we are limited in what information we can share when actively dealing with a situation such as this.


Page 1 of 2
<<[1] [2] >>

(Post a new comment)


[info]dkogan
2006-01-27 12:50 am UTC (link)
There's an extension noscript for Firefox which can be used to filter what scripts you allow to run where (so you can allow www.livejournal.com, but not a script loaded from www.hackers-r-us.com trying to load from within an LJ page). Not sure if that includes the sort of scenario described here, though.

Looks like kind of a bleak scenario going on here.

(Reply to this)(Thread)(Expand)

(no subject) - [info]zetawoof, 2006-01-27 12:58 am UTC (Expand)
(no subject) - [info]dkogan, 2006-01-27 01:05 am UTC (Expand)
(no subject) - [info]zetawoof, 2006-01-27 02:51 am UTC (Expand)
(no subject) - [info]njyoder, 2006-01-27 01:22 am UTC (Expand)

[info]trulybloom
2006-01-27 01:03 am UTC (link)
I appreciate your diligence with security issues.

In this post, you specifically mention Mozilla, Mozilla Firefox, and Internet Explorer 6 - you also said, "as vulnerabilities have been found in all major browsers." What other browsers are you looking at for possible security issues? Opera, perhaps?

(Reply to this)(Thread)(Expand)

(no subject) - [info]daveman692, 2006-01-27 01:05 am UTC (Expand)
(no subject) - [info]trulybloom, 2006-01-27 06:14 am UTC (Expand)
(no subject) - [info]daveman692, 2006-01-27 06:18 am UTC (Expand)
(no subject) - [info]trulybloom, 2006-01-27 06:59 am UTC (Expand)
(no subject) - [info]daveman692, 2006-01-27 07:03 am UTC (Expand)
(no subject) - [info]trulybloom, 2006-01-27 07:39 am UTC (Expand)
(no subject) - [info]matgb, 2006-01-27 12:34 pm UTC (Expand)
(no subject) - [info]dinozavr, 2006-01-27 02:00 pm UTC (Expand)
Good Point - [info]matgb, 2006-01-27 02:08 pm UTC (Expand)
Re: Good Point - [info]dinozavr, 2006-01-27 02:22 pm UTC (Expand)
(no subject) - [info]trulybloom, 2006-01-28 01:55 am UTC (Expand)

[info]wcu
2006-01-27 01:08 am UTC (link)
Hi David,

I was wondering if you could please elaborate on the state of the lol..

Thank you,

Jason

(Reply to this)(Thread)(Expand)

(no subject) - [info]irishmc, 2006-01-27 02:33 am UTC (Expand)
(no subject) - [info]mcfnord, 2006-01-27 07:40 am UTC (Expand)

[info]njyoder
2006-01-27 01:20 am UTC (link)
Due to the fact that we cannot clean every external CSS stylesheet linked to every time we generate a journal page, this change is required.

So you don't clean external CSS at all? o_O

Anyway, for what you DO clean, why not whitelist CSS attributes? I don't see any point in allowing new, unknown CSS features. If they're important, someone can request they be added to the whitelist.

community.livejournal.com/username as it is limited to a single journal.

As discussed here, the cookie path security can be circumvented. You either need to get all the browsers to fix this (and it appears all the major ones need to be) or you have to give individual subdomains for each community. Without addressing this, getting a cookie for one community gets you a cookie for all communities the user is a part of.

Given that you can insert that -moz-binding in external CSS, if I can get someone to visit my community, I can then take all of their other community cookies.

(Reply to this)(Thread)(Expand)

(no subject) - [info]daveman692, 2006-01-27 01:25 am UTC (Expand)
(no subject) - [info]njyoder, 2006-01-27 01:31 am UTC (Expand)
(no subject) - [info]daveman692, 2006-01-27 01:37 am UTC (Expand)
(no subject) - [info]njyoder, 2006-01-27 01:43 am UTC (Expand)
Try This - [info]daveman692, 2006-01-27 03:09 am UTC (Expand)
Re: Try This - [info]njyoder, 2006-01-27 03:20 am UTC (Expand)
Re: Try This - [info]njyoder, 2006-01-27 03:28 am UTC (Expand)
Re: Try This - [info]njyoder, 2006-01-27 05:51 am UTC (Expand)
Re: Try This - [info]daveman692, 2006-01-27 05:59 am UTC (Expand)
Re: Try This - [info]mart, 2006-01-27 07:25 am UTC (Expand)
Re: Try This - [info]njyoder, 2006-01-27 07:57 am UTC (Expand)
Re: Try This - [info]mart, 2006-01-27 08:03 am UTC (Expand)
Re: Try This - [info]clauclauclaudia, 2006-01-28 05:35 pm UTC (Expand)
Re: Try This - [info]mart, 2006-01-29 01:11 am UTC (Expand)
Re: Try This - [info]zenten, 2006-02-03 02:30 am UTC (Expand)
Re: Try This - [info]clauclauclaudia, 2006-02-03 03:51 am UTC (Expand)
(no subject) - [info]kunzite1, 2006-01-27 01:30 am UTC (Expand)
(no subject) - [info]njyoder, 2006-01-27 01:32 am UTC (Expand)
(no subject) - [info]kunzite1, 2006-01-27 01:40 am UTC (Expand)
(no subject) - [info]desh, 2006-01-27 01:44 am UTC (Expand)
(no subject) - [info]kunzite1, 2006-01-27 01:47 am UTC (Expand)
(no subject) - [info]desh, 2006-01-27 01:51 am UTC (Expand)
(no subject) - [info]kunzite1, 2006-01-27 01:55 am UTC (Expand)
(no subject) - [info]desh, 2006-01-27 02:14 am UTC (Expand)
(no subject) - [info]kunzite1, 2006-01-27 02:24 am UTC (Expand)
(no subject) - [info]njyoder, 2006-01-27 01:48 am UTC (Expand)
(no subject) - [info]lumiere, 2006-02-03 03:16 pm UTC (Expand)
(no subject) - [info]njyoder, 2006-01-27 01:46 am UTC (Expand)
(no subject) - [info]nikolasco, 2006-01-27 01:47 am UTC (Expand)
(no subject) - [info]kunzite1, 2006-01-27 01:50 am UTC (Expand)
(no subject) - [info]nikolasco, 2006-01-27 02:08 am UTC (Expand)
(no subject) - [info]njyoder, 2006-01-27 01:51 am UTC (Expand)
(no subject) - [info]nikolasco, 2006-01-27 01:55 am UTC (Expand)
(no subject) - [info]nikolasco, 2006-01-27 02:06 am UTC (Expand)
(no subject) - [info]daveman692, 2006-01-27 02:29 am UTC (Expand)
(no subject) - [info]mylifeasamoose, 2006-01-27 05:19 am UTC (Expand)
(no subject) - [info]daveman692, 2006-01-27 05:26 am UTC (Expand)
(no subject) - [info]pauamma, 2006-01-27 10:50 am UTC (Expand)
(no subject) - [info]mart, 2006-01-27 07:29 am UTC (Expand)
(no subject) - [info]njyoder, 2006-01-27 08:14 am UTC (Expand)
(no subject) - [info]mart, 2006-01-27 01:55 pm UTC (Expand)

[info]neugotik
2006-01-27 01:28 am UTC (link)
It'll be great when we can close out open sessions - that will really help if/when we see one open at an IP we don't want open (but we might not _be_ at) - nice work!

Thanks for closing up those loopholes: I use Firefox more & more on both my work PC & home Mac. I appreciate that you are closing these security issues up for Mozilla/Firefox.

(Reply to this)(Thread)(Expand)

(no subject) - [info]vanbeast, 2006-01-27 01:38 am UTC (Expand)
(no subject) - [info]kunzite1, 2006-01-27 01:42 am UTC (Expand)
(no subject) - [info]vanbeast, 2006-01-27 01:47 am UTC (Expand)
(no subject) - [info]jc, 2006-01-27 09:22 pm UTC (Expand)
(no subject) - [info]vanbeast, 2006-01-27 09:52 pm UTC (Expand)
(no subject) - [info]zimzat, 2006-01-27 01:51 am UTC (Expand)
(no subject) - [info]zetawoof, 2006-01-27 02:48 am UTC (Expand)
(no subject) - [info]zimzat, 2006-01-27 04:03 am UTC (Expand)
(no subject) - [info]zetawoof, 2006-01-27 09:57 am UTC (Expand)
(no subject) - [info]zimzat, 2006-01-27 10:09 am UTC (Expand)
(no subject) - [info]crschmidt, 2006-01-27 04:50 am UTC (Expand)

[info]nikolasco
2006-01-27 01:49 am UTC (link)
Could you please kill, relocate, or fix customview.cgi . It runs on www.livejournal.com thereby circumventing the entire cookie dance.

(Reply to this)(Thread)(Expand)

(no subject) - [info]nikolasco, 2006-01-27 03:35 am UTC (Expand)
(no subject) - [info]feldgendler, 2006-01-27 04:02 am UTC (Expand)
(no subject) - [info]nikolasco, 2006-01-27 04:33 am UTC (Expand)
(no subject) - [info]daveman692, 2006-01-27 05:35 am UTC (Expand)
(no subject) - [info]ffrinch, 2006-01-27 06:37 am UTC (Expand)

[info]the_kestral
2006-01-27 01:52 am UTC (link)
have these changes caused a problem with the mobile lj use? I was able to log in the other day but I cant seem to read any of my friend's posts from my mobile.

(Reply to this)(Thread)(Expand)

(no subject) - [info]daveman692, 2006-01-27 02:30 am UTC (Expand)
(no subject) - [info]the_kestral, 2006-01-27 02:47 am UTC (Expand)
(no subject) - [info]the_kestral, 2006-01-28 04:48 pm UTC (Expand)

[info]thehumangame
2006-01-27 03:00 am UTC (link)
Hrm. Any plans to let us include javascript code in our custom S2 styles now that this increased security has been implemented, or is this just a second layer of protection against vulnerabilities?

(Reply to this)(Thread)(Expand)

(no subject) - [info]zetawoof, 2006-01-27 03:32 am UTC (Expand)
(no subject) - [info]kunzite1, 2006-01-27 03:47 am UTC (Expand)
(no subject) - [info]zetawoof, 2006-01-27 04:32 am UTC (Expand)
(no subject) - [info]kunzite1, 2006-01-27 04:39 am UTC (Expand)
(no subject) - [info]zetawoof, 2006-01-27 07:03 am UTC (Expand)
(no subject) - [info]kunzite1, 2006-01-27 07:19 am UTC (Expand)
(no subject) - [info]mylifeasamoose, 2006-01-27 05:17 am UTC (Expand)
(no subject) - [info]zetawoof, 2006-01-27 07:01 am UTC (Expand)
(no subject) - [info]feldgendler, 2006-01-27 04:08 am UTC (Expand)
(no subject) - [info]kunzite1, 2006-01-27 04:29 am UTC (Expand)
Re: Reply to your comment... - [info]feldgendler, 2006-01-27 04:43 am UTC (Expand)
Re: Reply to your comment... - [info]kunzite1, 2006-01-27 04:51 am UTC (Expand)
Re: Reply to your comment... - [info]feldgendler, 2006-01-27 04:58 am UTC (Expand)
Re: Reply to your comment... - [info]kunzite1, 2006-01-27 05:03 am UTC (Expand)
Re: Reply to your comment... - [info]feldgendler, 2006-01-27 02:50 pm UTC (Expand)
(no subject) - [info]nikolasco, 2006-01-27 05:01 am UTC (Expand)
(no subject) - [info]kunzite1, 2006-01-27 05:05 am UTC (Expand)
(no subject) - [info]jamesd, 2006-01-27 04:50 am UTC (Expand)
Re: Reply to your comment... - [info]feldgendler, 2006-01-27 04:55 am UTC (Expand)
Re: Reply to your comment... - [info]dojothemouse, 2006-02-08 07:08 pm UTC (Expand)
Re: Reply to your comment... - [info]feldgendler, 2006-02-09 02:36 am UTC (Expand)

[info]jamesd
2006-01-27 03:55 am UTC (link)
> we cannot clean every external CSS stylesheet linked to every time we generate a journal page

To be quite clear about this, LiveJournal is knowingly choosing to leave its users vulnerable to problems it knows are unavoidable by continuing to allow external CSS.

> With Mozilla deciding to allow the execution of arbitrary JavaScript via CSS, there is no other viable solution than the one we have undertaken

With respect, that's a ridiculous claim to make to this audience. Capabilities to upload to LiveJournal and filter hundreds of different CSS files exist, if necessary. LiveJournal is simply choosing not to use them and to leave users fundamentally insecure as a result of that decision.

This is not solely or primarily LiveJournal's fault, for the vulnerabilities originate with the browser authors, who incorrectly assume that all content used on or via a site is trustworthy. But LiveJournal is the responsible party for what it allows its site to expose people to.

(Reply to this)(Thread)(Expand)

(no subject) - [info]laughingjudge, 2006-01-27 05:01 am UTC (Expand)
(no subject) - [info]mylifeasamoose, 2006-01-27 05:14 am UTC (Expand)
(no subject) - [info]daveman692, 2006-01-27 05:30 am UTC (Expand)
(no subject) - [info]jamesd, 2006-01-27 06:15 am UTC (Expand)
(no subject) -