by mdavidn · 2y ago · 0 comments
Usually SAML happens because customers ask for it, OIDC isn't as widely implemented by IDPs as SAML is, so you end up implementing SAML and moving on with life.
We strongly recommend choosing OpenID Connect (OIDC) over SAML due to its modern, API-centric design and support for native mobile applications.
"Why is google asking me to grant access to my google drive for SAAS X, I just want to login to SAAS X via Google"
But to respond to your critic: It is good that apps let you know that you are IN FACT not merely logging into something, but grant that app access to your Google Drive. This is a very important information! Imagine your mom signs into ClashOfClangs (a malicious clone) and the IdP would in fact NOT tell your mom that the app will have access to all her files because it may be confusing
For what it's worth, it is certainly possible for SAML SPs to flag that certain attributes should/must be released to them via their metadata, but the actual release is at the whim of the IdP and its operators. It's also possible for a SAML IdP to expose that level of detail to its end users and allow them to agree/disagree to the attribute release, although I'd be surprised if that behaviour was particularly common in practice.
Unlike SAML's "take this assertion" IdP-initiated flow, OIDC went for a "start an authentication with this IdP, for this user, and send them back here". Much, much safer.
https://openid.net/specs/openid-connect-core-1_0.html#ThirdP...
https://www.identityserver.com/articles/the-dangers-of-saml-...
If I could avoid doing SAML (we have so far!), I would avoid doing so as long as I could.
https://ssoready.com/blog/engineering/xml-dsig-is-unfortunat...
Are any of the big IdP's (Microsoft, Google, Okta, etc.) still SAML-only?
If anyone is looking for SAML bindings and is using java and wants to avoid libxmlsec, my employer has an open source set of bindings for processing SAML requests: https://github.com/FusionAuth/fusionauth-samlv2
It does depend on Jakarta XML: https://jakarta.ee/specifications/xml-binding/
XMLDSig APIs are not well designed. They check whether signatures in a document are valid, but signatures are not required to cover the entire document. XMLDSig APIs do not make it easy to confirm that signatures cover a specific element of interest, like saml:Subject.
An adversary can stuff a valid assertion within a forged one, and many popular SAML implementations would accept the forged assertion. This is mostly fixed now, but it's still one of those things that I must validate for myself in all new SAML service providers that I can influence.
https://www.usenix.org/system/files/conference/usenixsecurit...
There's a wealth of issues, some generic and some specific to the (not so well thought out...) choices made by the SAML spec.
For starters, the XML signature spec requires canonicalization of the message (which is XML). But the message itself need not be the canonicalized message. So the SAML implementer, if they follow the spec, must process the untrusted input and canonicalize it prior to verifying the signature.
Add in that you can override just about every aspect of the signature algorithm, canonicalization details, and even what parts of the message are actually signed, and you get huge number of places where things can either go wrong or may be overlooked.
Then throw in "XML Encryption" (again with canonicalization) which could be done on the whole message or just the assertions.
Then throw in that you can sign the encrypted portion, or the unencrypted portion, or just the assertions, or encrypt the signatures, or ...
So in short, there's too many ways to do too many thing.
Which leads to a massive surface area of code if you actually follow the spec. Which leads to libraries that either do not follow the spec (e.g., ignoring encryption and just checking signatures in a known location), or think that they follow the spec but will happily ignore missing assertions or out of date certificates.
SAML sucks. But hey, it's still better than having your own passwords!
The XMLDSig stuff is definitely a mess though. There were definitely issues with comments in signed content allowing values to be truncated to the start of the comment, along with some similar weirdness with XML entities. And that's before any of your (entirely valid!) complaints...
Malleability sucks in this context.
Would this be useful to anyone?
Maybe clarify what you can do better or different or just how exactly you're doing it and let the audience decide.