News for hackers. Stuff that matters.
Re:The Difficulties of SAML Single Logout by 35fbe7d3d5b9 on Tuesday March 16, 2021 @11:08PM (#26486058)
SLO is the nightmare nobody touches.

In practice, logout in a federated environment seems to be

* A user logs into apps A, B, C (...)

* While using app C, the user clicks logout. App C trashes their cookies

* With luck(!) the IdP provides a low friction logout endpoint – think "GET /logout?redir=http://foo.bar/logged-out".

The app redirs to that endpoint, the IdP trashes cookies and directs back to the apps "you have been logged out" page.

Apps A and B? Go with god, and good luck. Keep your sessions short.

Re:The Difficulties of SAML Single Logout by grinich on Wednesday March 17, 2021 @01:24AM (#26486889)
SLO is such an incredible pain in the ass. I'm the founder of WorkOS[0]and I have been struggling with how to address this problem for 2 years now. There's no elegant solution.

We've taken the approach of building a second API that integrates directly with the directory systems of record (Workday, Gusto, BambooHR, SCIM, etc.). These are often the actual "source of truth" and a more dependable source for the group membership changes that should trigger de-provisioning. But unfortunately even SCIM isn't well enough supported yet to be considered a base standard. (It's worse than SAML.)

Enterprise authentication and authorization is totally fvcked. Trying to fix it brick-by-brick.

[0] https://workos.com

Re:The Difficulties of SAML Single Logout by andrewstuart2 on Wednesday March 17, 2021 @01:28AM (#26486925)
I think it's a pain because it's one of those things you just can't guarantee. I can (try to) promise you as an IdP that website X can't just randomly ask for your information and be given it without your consent.

But once I've given that information away, it's irreversible. You can't unsend data. You can ask nicely for it to be deleted, or revoke future access, but unless you have a time machine, federated SLO for all parties in a session ought to just be considered an impossibility, and planned for accordingly with short sessions.

Re:The Difficulties of SAML Single Logout by londons_explore on Wednesday March 17, 2021 @01:37AM (#26486986)
> But once I've given that information away, it's irreversible.

In an enterprise environment all software has a basic level of trust of "this will try to do what it claims to do". That means the ID provider can directly ping the server of whatever service was issued the data or login cookies and say "this data should be deleted please".

Re:The Difficulties of SAML Single Logout by hunter2_ on Wednesday March 17, 2021 @10:13AM (#26491502)
If you administer every SP, it starts to become a possibility. But as TFA mentions right off the bat, that's atypical.

And even if you do exclusively use SPs that support SLO, is the user supposed to wait while the IdP does all of that outreach in order to know that it worked, or 97% worked because one timed out? That depends on whether the user should even care about the outcome -- if they should care, then do they get an email when it achieves 100% hours/days later when that down-at-time-of-SLO SP is back up? Should they report an incident if they never see a success report?

Re:The Difficulties of SAML Single Logout by 35fbe7d3d5b9 on Wednesday March 17, 2021 @11:03AM (#26492195)
> But as TFA mentions right off the bat, that's atypical.

So atypical that it borders on inconceivable. There's almost always an external party in there.

But if you somehow end up totally internal sure, try the back-channel binding. You get to toss SOAP messages around, and it might work. Of course now one of the invariants you built around no longer holds ("SAML works without having to let the IdP talk to the SPs" oh my sweet summer child...)

Just don't try SLO over the front channel, or else you'll have the joyous UX of a user clicking "log out" and all of a sudden they're bouncing logout messages back and forth between the IdP and two dozen internal applications. Hope the ninth app in line isn't down for maintenance or your <LogoutResponse> never makes it back to the IdP and the user wonders why they're staring at a server error page for an app they haven't used in hours and why half their environment is logged in and the other half isn't...

Re:The Difficulties of SAML Single Logout by abraae on Wednesday March 17, 2021 @02:51AM (#26487414)
Dealing with auth, including single lockout, is all much easier if you can put all your systems behind a single reverse proxy on a single domain.

(Certainly that's not always possible, but for many systems it is).

Re:The Difficulties of SAML Single Logout by 35fbe7d3d5b9 on Wednesday March 17, 2021 @11:06AM (#26492229)
There's a reason huge enterprises still pay big money for stuff like CA's Siteminder: it's way easier to bolt an agent along side your crappy internal app that thinks about this stuff for you.
Re:The Difficulties of SAML Single Logout by emmelaich on Wednesday March 17, 2021 @06:12AM (#26488905)
Like https://www.forgerock.com/ formerly known as OpenAM / OpenSSO.

It's not fun to administer.

Re:The Difficulties of SAML Single Logout by sunir on Thursday March 18, 2021 @08:53AM (#26502149)
All the SLO solutions struggle with the fact session IDs are disassociated with the IdP except by policy. Policy is insufficiently strong.

The session ID needs to be cryptographically associated with the IdP so if you blow away the IdP session unilaterally you cannot decrypt or access any SPs session.

For instance but probably not sufficient as a solution, you could imagine IdPs running a JavaScript inside the SPs client session that provides half of a key pair and the SP providing the other half that combined form the session ID. Then once SLO is initiated the IdP script no longer provides its key.

I have not deeply thought further about how to completely design a flow like this but I strongly believe this kind of cryptographic session ID is the likely idea that will lead to a solution.

Re:The Difficulties of SAML Single Logout by ec109685 on Wednesday March 17, 2021 @03:02AM (#26487470)
Yeah, it seems kind you want a refresh token that you periodically validate against the source of truth to handle these cases.
Re:The Difficulties of SAML Single Logout by hnick on Tuesday March 16, 2021 @11:23PM (#26486143)
I ran into a bug like this in Australia's MyGov system.

I would log in to the main page where we can view government services. Then I would click through to the ATO (our IRS) to see some statements or whatever. I would then close the window and log out in MyGov then log back in with my wife's account. Click through to the ATO would show my details instead of hers. IIRC logging out wouldn't work either since that would mess up the session, I'd have to come back later.

Couldn't find anywhere to report this so I ignored it. I think they fixed it now.

Re:The Difficulties of SAML Single Logout by mjthompson on Tuesday March 16, 2021 @11:38PM (#26486238)
Not the first time they've ignored issues in myGov. This guy tried endlessly to contact them about a XSS vulnerability to deaf ears:

https://www.smh.com.au/technology/revealed-serious-flaws-in-...

Re:The Difficulties of SAML Single Logout by jiggawatts on Wednesday March 17, 2021 @12:14AM (#26486458)
You've got understand that the orgs involved in myGov, such as Centrelink, Medicare, and the ATO are special bad. They're dysfunctional to a degree most people simply cannot believe.

I was at Centrelink's IT department for just a couple months, and that was the only time in my decades-long consulting career that I had seen an adult man cry. Not for personal reasons. Work-related reasons. Several men, on multiple occassions, for different reasons.

That place crushed their spirits, and the tears just had to come out...

Re:The Difficulties of SAML Single Logout by SilverRed on Wednesday March 17, 2021 @01:20AM (#26486860)
I have known a few people working in IT in government in Australia and it sounds like absolute hell. It takes a special kind of person to work in government. You either have to be extremely incompetent to the point you cant even tell that things around you are a disaster, or you have to not give a shit to the point where waiting a month for someone to press a button does not bother you and you are only focused on what you will be doing when you get home at the end of the day.

This one guy I knew told me that he had seen meetings dedicated to working out how they could spend money since they hadn't spent the whole budget yet. Services run over hundreds of servers when it could be done in one just to keep the whole team of system admins employed.

Government departments are filled with bloat to a level you wouldn't believe.

Re:The Difficulties of SAML Single Logout by Cederfjard on Wednesday March 17, 2021 @04:23AM (#26487918)
> meetings dedicated to working out how they could spend money since they hadn't spent the whole budget yet

I think this is fairly common in government outside of Australia as well. With the budget it’s use it or lose it, so you better find ways to spend it, or you’ll have less margin next year when you might actually need it.

Re:The Difficulties of SAML Single Logout by random5634 on Wednesday March 17, 2021 @09:49AM (#26491183)
I know about this - it’s actually worse and very serious if you underspend.

Almost all the higher ups are paid out of budgets based on how much you spend- so the supervising agency gets their 15 percent admin fee, your managers are part of the indirect cost pool etc.

If you spend 50% of budget it is game over upstairs. And you lose the money at year end, and future allocation is dropped. And all the budgets in long chain up get messed up. Almost nothing gets more attention and priority than this.

Re:The Difficulties of SAML Single Logout by mjthompson on Wednesday March 17, 2021 @12:19AM (#26486484)
I should have said that I don't blame any individual dev or sysadmin for failing to respond. It's a deeply entrenched organisational issue.

Imagine fixing an issue on a Model 204 mainframe, with a perpetually dwindling number of people you can rely on for help, knowing that if you don't fix it, people don't get their welfare cheque.

High stress, low reward. Unsung heroes in my books.

Re:The Difficulties of SAML Single Logout by jiggawatts on Wednesday March 17, 2021 @02:57AM (#26487446)
> people don't get their welfare cheque.

A "fun" anecdote I heard was that every 1 day of outage of Centrelink's mainframe would result in 5-7 children with broken bones.

You see, some alcoholic high-strung fathers in rural communities were spending their welfare cheques mostly at the local bottleshop. If the cheques stopped, their booze supply stopped, and their withdrawal symptoms would send them into mad rage. All too often, they'd take it out on their kids.

Apparently someone at Centrelink was tracking this kind of stuff by gathering paediatric admissions data from hospitals.

While I was there they had a 3-day outage that everyone just laughed off. You do the maths.

Re:The Difficulties of SAML Single Logout by mjthompson on Wednesday March 17, 2021 @09:34AM (#26490976)
Terrifying
Re:The Difficulties of SAML Single Logout by varikin on Tuesday March 16, 2021 @11:23PM (#26486142)
I had to implement a SP SAML logic at a previous job. The customer who wanted it just kept telling us to enable some apache mod and it works, except when you have a java fat jar without Apache, you have to add your own endpoints and we had to add integration for native clients.

I asked about implementing logout cause I saw it was a thing in the SAML docs. The customer didn't care so our app trashed it cookies as usual and didn't report it to the IdP. It just wasn't worth the time.

Re:The Difficulties of SAML Single Logout by jcims on Wednesday March 17, 2021 @12:58AM (#26486732)
Cookies need an alias mechanism. Combined with explicit cross-origin entitlement you could just keep a single cookie to satisfy all of those sessions.
Re:The Difficulties of SAML Single Logout by grinich on Wednesday March 17, 2021 @01:56AM (#26487085)
A merkle tree for cookie validation would be cool.
Re:The Difficulties of SAML Single Logout by mooreds on Tuesday March 16, 2021 @11:12PM (#26486083)
Doesn't it depend on who controls apps A and B? If they are COTS or created by different parties, then all best are off. But if all three apps are created by the same org, which can specify standards, doesn't one have some hope?
Re:The Difficulties of SAML Single Logout by emodendroket on Tuesday March 16, 2021 @11:41PM (#26486257)
The whole point of SAML is that you can manage your users for third-party applications in your normal user store instead of needing to provision accounts in multiple places.
Re:The Difficulties of SAML Single Logout by pionar on Tuesday March 16, 2021 @11:54PM (#26486345)
Somewhat, but it still requires a lot of storage of state and coordination between systems. This isn't SAML specific, it's a property of any federated login (SSO) protocol.
Re:The Difficulties of SAML Single Logout by yread on Wednesday March 17, 2021 @04:12AM (#26487860)
Apps A and B could just keep a list of expired cookies and the IdP could add to that list using a server-to-server call.
Re:The Difficulties of SAML Single Logout by bandie91 on Wednesday March 17, 2021 @04:40AM (#26488037)
the main idea of SAML is not to do direct server-to-server communication.
Re:The Difficulties of SAML Single Logout by kevincox on Wednesday March 17, 2021 @12:31PM (#26493452)
This is how it should work. But I don't think any popular system implements this.