Top
Best
New

Posted by aray07 3 hours ago

SAML: A Fractal of Bad Design(blog.trailofbits.com)
97 points | 47 comments
bawolff 31 minutes ago|
My favourite SAML horror story, is that it used to be, that by default the main c implementation of xmlsig would not just check the sig with the public key specified but would also:

- check it against an hmac using a password specified in the attacker controlled document.

- check the signature using web pki (so the attacker could sign the saml document with their TLS key for their own personal domain and it would always be considered valid)

I honestly dont know how sites with saml arent getting hacked all the time. The only thing worse than the absolute terrible standards are the absolute terrible implementations.

stouset 21 minutes ago|
I saw multiple implementations that looked for a signature, verified it, then just trusted the document as a whole rather than only the part that was signed. So as long as you had any signed SAML doc, you could provide an attention of your choosing and just bundle the signed one somewhere arbitrary inside of it.
tptacek 17 minutes ago||
It really probably is the worst security specification ever written.
jmbwell 1 hour ago||
It’s such a product of “Ooh! Markup languages! What can we use a markup language to solve!” When authentication is just not a document or data stream that needs marked-up.

The article rightly connects this to XML, which was indeed the hammer to everything’s nail at the time

I think we aren’t done with this problem yet, though. OIDC makes a lot of assumptions in service to Google and others. And tailscale as mentioned, despite “holding the line,” already reveals the cracks when things like GitHub accounts have to be treated differently from others.

What we are missing is a provider-independent way to do this. I should be able to create an account and log in just about anywhere using a backend I control. It can be done, but not with what we have today

matrss 2 minutes ago||
> I should be able to create an account and log in just about anywhere using a backend I control. It can be done, but not with what we have today

IndieAuth exists, it's just not widely supported.

blm126 30 minutes ago|||
OpenID Connect actually has all the machinery needed to support federated login as part of its dynamic discovery and dynamic registration specifications. The issue is that absolutely no one uses them or implements them.

Smaller tech companies don't want federated login to happen. They are, as a rule, far to happy to rely on the SSO tax to up-sell enterprise customers. The major authentication companies don't want federated login to happy because it invites more competitors and threatens their absurd margins.

Until someone manages to solve the business side, no amount of improved technology will change a thing. I'm pretty sure the few small interoperability gaps OpenID Connect has could be corrected in a matter of months if the stakeholders actually cared.

martijnvds 1 hour ago||
That's what the original OpenID (from back in the LiveJournal days) was supposed to be right?

"Host your own identity"

arpinum 1 hour ago||
SAML is even worse than the article describes, problems like needing to check what the signature actually signs. But I'm optimistic about the future, instead of relying on libraries that do a lot, such as general xml parsing, we can support a subset of SAML and only the dialects of the top ~10 providers. Extreme niche providers can be added ad-hoc and only if the deal size makes it worthwhile.
jagged-chisel 52 minutes ago|
> … needing to check what the signature actually signs.

I mean … how else would you check a signature? You have to have the data to validate the signature.

bawolff 37 minutes ago|||
Normally you sign the whole dicument.

In SAML you sign a (potentially attacker controlled) subset after normalization. So a lot of saml bugs come down to the attacker adding things that aren't covered by the signature. Sometimes this means appending or prepending stuff, but my favourite is adding comments which can alter the interpretation of the xml document (as it splits text nodes) but doesn't alter the signature.

owenmarshall 35 minutes ago||
And this doesn't even get into "which normalization approach!" or "what gets signed (or not)!"

It's an absolute dumpster fire.

arpinum 33 minutes ago|||
In a JWT this is simple, the signature checks the entire sig and data sections. In XML signatures it checks whatever it says it checks, a list of URIs, which may also be transformed.

So it is possible to have an XML signature that points to an element that does not include some important piece of data.

bawolff 29 minutes ago||
Or maybe it does include the important info at sign time, but the attacker adds additional info that confuses the program parsing the document.
sandeepkd 1 hour ago||
May be I am in a minority here, but there are areas where SAML sort of shines

1. For OIDC/OAuth2 the request has to originate from Service provider, most Enterprise IDP's rely on SAML for Single Sign on cause of its ability to do IDP initiated flows

2. The security for SAML is baked into the payload itself, provides safety against MITM attacks, even though the HTTPS provides similar guarantees in theory, the reality is that your SSL offloading happens elsewhere, not on your application server

The OP provided a list of vulnerabilities discovered in SAML, IMO this kind of comparison if flawed if you do not present the same for OIDC/OAuth2.

At the end of the day, these are tools and effectiveness of a tool is a lot dependent on ones skillset to understand and use the tool.

pocksuppet 1 hour ago||
It's called design by committee. It's when you get everyone in a room and nobody can make a tradeoff because it would hurt someone else's pet use case, so you don't actually design anything at all, just build a framework within which a design can exist.

Anyone who has used Wireguard and OpenVPN will spot the difference. OpenVPN is the design-by-committee, Wireguard is the focused opinionated design by someone with a vision. OpenVPN does more things, but if your use case is one that suits Wireguard, Wireguard does it much better.

You also see it with OSI stack versus IP. OSI invented all these layers for proving identity, establishing circuits, sessions, different billing models, collect calls, quality of service, all that stuff. IP looked at that and said: fuck that noise - we send packets, if they don't arrive we send them again, job done. Nobody uses the OSI stack, even though IP fits the OSI model loosely enough that they still teach it, and X.509 got reused as boilerplate for WebPKI certificates.

XML vs JSON is another one. Granted marked-up text, which XML was actually designed for, is very ugly in JSON, but even in that use case, XML has way too much complexity.

If the IP, Wireguard or JSON people designed an SSO system you'd telnet or HTTP into the authenticating party, perform its login steps, get a token you could copy-paste into the relying party and it would check back with the authenticating party to see if the token is valid and the username of the person who signed in - done. And then someone would make a browser extension to automate the copy-paste part. Or maybe they'd embed it in an iframe. Instead we got whatever the hell this is.

Protocol complexity is where bugs hide, including vulnerabilities. It also creates incompatibility wherever two implementations implement it differently - and that's intentional in many cases. It's just bad. You have to be opinionated about what you design or you designed nothing at all. If it doesn't fit all use cases you can design something else to cover the rest.

bayindirh 1 hour ago|
Also, when you consider the age difference between the two, Wireguard is OpenVPN plus the learnt lessons.

We should remember that we learn by failing.

Edit: When I first read the comment, XML part was not there, but I don’t agree with the XML part of the comment, because JSON to XML is Python to C. While both can carry data, XML is designed to handle more than that. Especially validation and transformation parts. If you don’t need these, it’s an overkill, but if you use them, it’s a perfectly fine format. It’s even elegant and batteries included.

Also, you can parse it in an instant. I have designed XML based file formats which would fall apart in JSON and YAML.

The XML debates sounds to me like calling a space shuttle complex because one only needs to go to the mall downtown.

pocksuppet 1 hour ago||
Before OpenVPN there was IP-in-IP encapsulation, which is as simple as a VPN can get (no encryption, but that hadn't been invented yet). Wireguard is basically IP-in-UDP plus encryption. You know what else is basically IP-in-UDP plus encryption? IPsec, and it really sucks, for the same reasons OpenVPN does.
LoganDark 57 minutes ago||
By "encryption, but that hadn't been invented yet" you mean like, specifically encrypted network streams, right?
TZubiri 1 hour ago||
>It’s time to deprecate it and move on to modern alternatives like OpenID Connect (OIDC)

I'm almost convinced already, but I have the professional duty to at least read why

>SAML is an XML-based

Ok, I'm convinced

xyst 1 hour ago||
Waiting for the "OIDC: Time for Authentication to Take a Xanny" article
stuaxo 1 hour ago||
Implementing all the main authentication mechanisms is hell.

Oauth2 is utter utter shite as well.

skrtskrt 41 minutes ago||
OAuth2 is fine, I mean:

1. It's not an authentication protocol, but it was abused as one for until OpenID Connect came along

2. OpenID Connect is the compatible authN protocol, and it actually has a spec unlike OAuth2

Both of those are annoying because they are over-complicated for simple use cases and for a long time there were very few simple open-source providers that weren't hiding all the important stuff behind their enterprise/cloud versions.

Open source options like Zitadel are improving this space somewhat, though they are still sort of painfully complicated if you want to deploy something small and simple that you can understand. In order to be big business they have to support tons of 3rd-party provider plugins with all their out-of-spec wrinkles.

It would be nice to have something like Zitadel that is signficantly less concerned about all those third parties - like let me very easily just host username/password and passkey auth in a small package.

bawolff 28 minutes ago|||
OAuth2 is about a billion times better than SAML. At least you have a decent chance of doing it securely if you follow the spec vs about zero chance with saml.
7bit 1 hour ago||
Why are you using an authorization protocol for authentication? Try OIDC.
vips7L 40 minutes ago||
OIDC is a layer on top of OAuth...
cratermoon 1 hour ago||
The requirement for connected network topology is a non-starter for many SaaS products. I don't want my systems to be open to some backchannel communication from the SaaS providers service.
foltik 15 minutes ago|
That seems like a bit of an arbitrary line to draw, no? Would you say the same about webhooks?
More comments...