<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>how to secure cross-domain single-sign on (sso)</title>
        <description>hi (:

I just implemented this pattern http://www.theserverside.com/patterns/thread.tss?thread_id=31258 on top of PHP's in-built session handling functions.

I have single sign-on (SSO) and single log-out (SLO) working across several domains.  Functionally, I'm very happy with it but I'm concerned about security.

So far, I've implemented session ID regeneration on all changes of privileges as well as on fresh sessions.  Only the &amp;quot;master&amp;quot; domain ever (re)generates the session ID, passing it on to the slave via a http redirect (if requested).

The master will never redirect outside its list of valid slave domains.  And if a slave receives a session ID in the query string, it self-redirects to strip it out... so the ID should hopefully stay out of referrer logs.

I'm wondering if this is any less secure than just using PHP's in-built session on a single domain?

Edit: I should mention this is not SSO across different webapps, it's a single application and userbase that spans several second-level domains.

All advice/abuse appreciated!

thanks!
shy (:</description>
        <link>http://sla.ckers.org/forum/read.php?4,16753,16753#msg-16753</link>
        <lastBuildDate>Thu, 23 May 2013 04:23:21 -0500</lastBuildDate>
        <generator>Phorum 5.2.15a</generator>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?4,16753,17490#msg-17490</guid>
            <title>Re: how to secure cross-domain single-sign on (sso)</title>
            <link>http://sla.ckers.org/forum/read.php?4,16753,17490#msg-17490</link>
            <description><![CDATA[Don't forget to handle csrf issues]]></description>
            <dc:creator>erez</dc:creator>
            <category>CSRF and Session Info</category>
            <pubDate>Sun, 18 Nov 2007 01:12:34 -0600</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?4,16753,17440#msg-17440</guid>
            <title>Re: how to secure cross-domain single-sign on (sso)</title>
            <link>http://sla.ckers.org/forum/read.php?4,16753,17440#msg-17440</link>
            <description><![CDATA[OK no sorry I was way off track, don't even know what I was referring to now I see you are managing several .com's... session id is the only way.  Think I thought originally you were passing all the parameters and re-establishing the session that way..]]></description>
            <dc:creator>serachewhi</dc:creator>
            <category>CSRF and Session Info</category>
            <pubDate>Thu, 15 Nov 2007 14:27:33 -0600</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?4,16753,17359#msg-17359</guid>
            <title>Re: how to secure cross-domain single-sign on (sso)</title>
            <link>http://sla.ckers.org/forum/read.php?4,16753,17359#msg-17359</link>
            <description><![CDATA[serachewhi Wrote:<br />
-------------------------------------------------------<br />
&gt; I just skim read this, so might be off track...<br />
&gt; why do you need to persist the session via the<br />
&gt; browser based parameters anyway?  Use a server<br />
&gt; side or other 'out of band' communication.  For<br />
&gt; example, maintain session in a common database<br />
&gt; (you said its the same app, right? )<br />
<br />
Hi serachewhi, thanks for your input!<br />
<br />
I'm not sure I fully understand what you mean.  Would you mind going into more detail?<br />
<br />
It is the same app, yep, and sessions *are* stored in the database.  The only information being passed through the browser is the session ID itself as would be the case with a &quot;regular&quot; session.<br />
<br />
thanks!<br />
shy (:]]></description>
            <dc:creator>shyguy</dc:creator>
            <category>CSRF and Session Info</category>
            <pubDate>Mon, 12 Nov 2007 11:14:41 -0600</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?4,16753,17216#msg-17216</guid>
            <title>Re: how to secure cross-domain single-sign on (sso)</title>
            <link>http://sla.ckers.org/forum/read.php?4,16753,17216#msg-17216</link>
            <description><![CDATA[I just skim read this, so might be off track... why do you need to persist the session via the browser based parameters anyway?  Use a server side or other 'out of band' communication.  For example, maintain session in a common database (you said its the same app, right? )]]></description>
            <dc:creator>serachewhi</dc:creator>
            <category>CSRF and Session Info</category>
            <pubDate>Tue, 06 Nov 2007 12:33:09 -0600</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?4,16753,16795#msg-16795</guid>
            <title>Re: how to secure cross-domain single-sign on (sso)</title>
            <link>http://sla.ckers.org/forum/read.php?4,16753,16795#msg-16795</link>
            <description><![CDATA[hi kuza55<br />
<br />
it is actually several .com's hence the extra measures, and fortunately it is a single application.. which hopefully means: if there's XSS is one, it's in available on all the other domains anyways.<br />
<br />
i think for serious changes i will do as you said and lock it to one host (SSL), and require re-authentication.<br />
<br />
the current system is cookie-only PHP sessions without SSL auth.. just wanted to make sure I'm not introducing a huge security hole.. i was a bit iffy about passing the SID in the URL (brief as it may be!)<br />
<br />
thank you for your input (:]]></description>
            <dc:creator>shyguy</dc:creator>
            <category>CSRF and Session Info</category>
            <pubDate>Tue, 16 Oct 2007 06:27:58 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?4,16753,16794#msg-16794</guid>
            <title>Re: how to secure cross-domain single-sign on (sso)</title>
            <link>http://sla.ckers.org/forum/read.php?4,16753,16794#msg-16794</link>
            <description><![CDATA[I haven't read the pattern you linked to, so this may or may not be relevant, anyway; I do not see why a SSO system is necessary, if you've just got distinct subdomains.<br />
<br />
All you would need to do would be to set the cookies to .domain.com rather than just domain .com and then the cookies would be sent along with the request for all subdomains.<br />
<br />
This can cause further issues with an XSS condition on *any* subdomain being potentially devastating, though that can be mitigated by adding an additional authentication cookies to specific subdomains such as settings.domain.com so that major changes can only occur from that domain, and with those specific cookies.<br />
<br />
Having said that, if you envisage some need for SSO across multiple domains, then the method you described is the best method, though I would recommend using a different token for each application, so that an XSS in one application does not lead to the compromise of another.]]></description>
            <dc:creator>kuza55</dc:creator>
            <category>CSRF and Session Info</category>
            <pubDate>Tue, 16 Oct 2007 04:23:06 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?4,16753,16793#msg-16793</guid>
            <title>Re: how to secure cross-domain single-sign on (sso)</title>
            <link>http://sla.ckers.org/forum/read.php?4,16753,16793#msg-16793</link>
            <description><![CDATA[i'd really love to hear someone's thoughts, no matter how small.. even if it's just a link to a more appropriate place to discuss this. sla.ckers.org is the most suitable place I've found so far..<br />
<br />
anyway, would love to hear back from some of you<br />
<br />
thanks<br />
shy (:]]></description>
            <dc:creator>shyguy</dc:creator>
            <category>CSRF and Session Info</category>
            <pubDate>Tue, 16 Oct 2007 03:41:30 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?4,16753,16753#msg-16753</guid>
            <title>how to secure cross-domain single-sign on (sso)</title>
            <link>http://sla.ckers.org/forum/read.php?4,16753,16753#msg-16753</link>
            <description><![CDATA[hi (:<br />
<br />
I just implemented this pattern http://www.theserverside.com/patterns/thread.tss?thread_id=31258 on top of PHP's in-built session handling functions.<br />
<br />
I have single sign-on (SSO) and single log-out (SLO) working across several domains.  Functionally, I'm very happy with it but I'm concerned about security.<br />
<br />
So far, I've implemented session ID regeneration on all changes of privileges as well as on fresh sessions.  Only the &quot;master&quot; domain ever (re)generates the session ID, passing it on to the slave via a http redirect (if requested).<br />
<br />
The master will never redirect outside its list of valid slave domains.  And if a slave receives a session ID in the query string, it self-redirects to strip it out... so the ID should hopefully stay out of referrer logs.<br />
<br />
I'm wondering if this is any less secure than just using PHP's in-built session on a single domain?<br />
<br />
Edit: I should mention this is not SSO across different webapps, it's a single application and userbase that spans several second-level domains.<br />
<br />
All advice/abuse appreciated!<br />
<br />
thanks!<br />
shy (:]]></description>
            <dc:creator>shyguy</dc:creator>
            <category>CSRF and Session Info</category>
            <pubDate>Sat, 13 Oct 2007 08:10:36 -0500</pubDate>
        </item>
    </channel>
</rss>
