TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Sign in as anyone: Bypassing SAML SSO authentication with parser differentials

312 pointsby campuscodi2 months ago

18 comments

asmor2 months ago
GitHub&#x27;s SAML implementation is useless. The idea is that you can bring your own account into an enterprise, and that sort of works on the site itself, but it does not prevent apps where you log in with GitHub from reading your organization membership once you have authorized an app <i>on the organization level</i> (and if you didn&#x27;t, it hides the membership from oauth tokens, so it has this capability!).<p>A SAML session is only required if said app fetches data via a token obtained from that user - and in my glance around, this was almost never the case - SAST tools almost always use app instance tokens and are happy to show anyone with a GitHub account in your organization your code. Tailscale fixed this when I pointed it out, Sonarcloud told me to please don&#x27;t tell anyone and GitHub took a few weeks to say this is totally expected behavior - when no vendor I told did, and their docs contradicted them.<p>I swear, reporting security bugs is a thankless endeavor, even if you just randomly stumble over them. I couldn&#x27;t imagine doing this as a job.
评论 #43375506 未加载
评论 #43375938 未加载
评论 #43375206 未加载
评论 #43375716 未加载
评论 #43377358 未加载
评论 #43377351 未加载
Diggsey2 months ago
I recently had to implement SAML and this headline does not surprise me in the slightest.<p>The SAML spec itself is fairly reasonable, but is built upon XML signatures (and in turn, XML canonicalization) which are truly insane standards, if they can even be called such.<p>Only a committee could produce such a twisted and depraved specification, no single mind would be capable of holding and combining such contradictory ideas.<p>It would be <i>so</i> simple to just transmit signatures out-of-band and SAML would be a pleasure to implement.
评论 #43375038 未加载
评论 #43375229 未加载
评论 #43375725 未加载
tptacek2 months ago
SAML (more broadly XML-DSIG) is literally the worst security protocol in common use. I think you should generally be taking whatever hits you need to take to transition from it to OAuth. Certainly, I would refuse to bring a new product to market that relied on it. It&#x27;s incredibly dangerous. Unless there&#x27;s some breakthrough in practical formal verification, I can&#x27;t imagine that this will be the last or the worst DSIG vulnerability.
评论 #43375862 未加载
评论 #43375239 未加载
评论 #43376397 未加载
评论 #43376552 未加载
kayodelycaon2 months ago
Ugh. No one should use REXML unless they have no other choice. It will happily parse invalid xml, which causes an infinite number of problems downstream.<p>It’s quite literally parsing xml using regular expressions. It’s an excellent case study for why you shouldn’t do that.<p>Projects didn’t start using Nokogiri for performance. They used it because it’s correct.
评论 #43375770 未加载
评论 #43375337 未加载
GauntletWizard2 months ago
Saml is insecure by design. Others have said it better before me, such as <a href="https:&#x2F;&#x2F;joonas.fi&#x2F;2021&#x2F;08&#x2F;saml-is-insecure-by-design&#x2F;" rel="nofollow">https:&#x2F;&#x2F;joonas.fi&#x2F;2021&#x2F;08&#x2F;saml-is-insecure-by-design&#x2F;</a>, but the quote I got from an old thread here was &quot;Sign Bytes, not meanings&quot;.<p>Parser differentials are expected and even necessary. What you intend to get from a signed response is very meaningful. A dilemma in modern TLS is that sometimes you want to trust one internal CA; That&#x27;s the easy path. Sometimes you want to accept a certificate from a partner&#x27;s CA, and you&#x27;ve got multiple partners - and you can no longer examine just the end certificate, but the root of that chain is equally important in your decisions.<p>This is also why I recommend whenever possible against AWS Sig algorithms; V4 is theoretically secure, but they screwed it up twice - SigV1 and SigV3 were insecure by design, and yet somehow made it past design review and into the public.
noleary2 months ago
This is a great write-up.<p>He&#x27;s mentioned in the article, but a major shout-out is warranted for ahacker1. He&#x27;s doing really sophisticated and valuable work to secure SAML implementations. We at SSOReady are really appreciative of his work.<p>Earlier this week, WorkOS put together a nice write-up on their own collaboration with ahacker1: <a href="https:&#x2F;&#x2F;workos.com&#x2F;blog&#x2F;samlstorm" rel="nofollow">https:&#x2F;&#x2F;workos.com&#x2F;blog&#x2F;samlstorm</a>
derektank2 months ago
&gt;We discovered an exploitable instance of this vulnerability in GitLab, and have notified their security team<p>GitLab has released a fix on their end for anyone else wondering<p><a href="https:&#x2F;&#x2F;about.gitlab.com&#x2F;releases&#x2F;2025&#x2F;03&#x2F;12&#x2F;patch-release-gitlab-17-9-2-released&#x2F;" rel="nofollow">https:&#x2F;&#x2F;about.gitlab.com&#x2F;releases&#x2F;2025&#x2F;03&#x2F;12&#x2F;patch-release-g...</a>
RainyDayTmrw2 months ago
Related: Latacora&#x27;s (2019) article, How (not) to sign a JSON object[1].<p>In short, nesting trees and signing them is difficult and prone to pitfalls. It&#x27;s easier if the envelope holds the message as a raw string, and the signing is performed on the raw string.<p>[1]: <a href="https:&#x2F;&#x2F;www.latacora.com&#x2F;blog&#x2F;2019&#x2F;07&#x2F;24&#x2F;how-not-to&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.latacora.com&#x2F;blog&#x2F;2019&#x2F;07&#x2F;24&#x2F;how-not-to&#x2F;</a>
wcoenen2 months ago
Isn&#x27;t the simpler conclusion here that one should look for the signature where it is supposed to be? Instead of using an excessively general XPath like &quot;&#x2F;&#x2F;ds:Signature&quot; that might find any signature in any unexpected location...
评论 #43375746 未加载
评论 #43375138 未加载
bawolff2 months ago
Its kind of annoying to explain the vulnerability in a blog post and then omit the parser differential in question.<p>It is like writing the introduction to a story and omitting the climax.
评论 #43375217 未加载
评论 #43378312 未加载
robmccoll2 months ago
Don&#x27;t use SAML, mostly because it uses XMLDSig. Don&#x27;t use XMLDSig because it&#x27;s hard to get usefully right and easy to get dangerously wrong.
kinow2 months ago
BlueSky post with a video showing the vulnerability:<a href="https:&#x2F;&#x2F;bsky.app&#x2F;profile&#x2F;ulldma.bsky.social&#x2F;post&#x2F;3lkbi6rasl22a" rel="nofollow">https:&#x2F;&#x2F;bsky.app&#x2F;profile&#x2F;ulldma.bsky.social&#x2F;post&#x2F;3lkbi6rasl2...</a>
fsfsd435352 months ago
Interesting vulnerability! It&#x27;s a classic example of how seemingly small differences in implementation (REXML vs Nokogiri) can lead to significant security holes. Kudos to Peter Stöckli and ahacker1 for finding it!<p>I wonder how many other libraries are vulnerable to similar parser differential attacks. It&#x27;s a good reminder to be extremely careful when dealing with XML and SAML, which are complex beasts at the best of times. As asmor pointed out, Github&#x27;s SAML implementation has other issues too. It seems like SAML is just inherently difficult to get right.<p>Also, to the person who suggested not mixing personal and professional stuff in the same Github account: wise words! I&#x27;ve seen that cause headaches more than once.
oefrha2 months ago
I’m aware of the reputation of XML signatures, but it’s the first time I read about technical details, and they make my head spin.<p>Q: Is there any non-legacy reason to use SAML instead of libsodium’s public key authenticated encryption (crypto_box)?<p>Another Q: Is there any non-theoretical risk of parser differential when using libsodium’s cyrpto_box on one end and Golang’s x&#x2F;crypto&#x2F;nacl&#x2F;box on the other end?
评论 #43378382 未加载
layer82 months ago
This is an example of a parser mismatch vulnerability.<p>Related submission a year ago: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=38743029">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=38743029</a>
malkia2 months ago
Maybe asking stupid question, but would older versions of puppet be affected (like 6?). Also is there a site to check deps down to what maybe affected?
评论 #43375766 未加载
oncallthrow2 months ago
XML is to authentication bypasses what C is to buffer overflow attacks
评论 #43375202 未加载
评论 #43375808 未加载
评论 #43374813 未加载
评论 #43374583 未加载
dudeinjapan2 months ago
I&#x27;m working on refactoring RubySaml right now so that it uses pure Nokogiri XML parser, which would have avoided at least one of these CVEs. It&#x27;s really a mess because the current way things work RubySaml is subclassing REXML::Document, which you can&#x27;t do in Nokogiri, and in the process I have found 15 year old bugs in JRuby Nokogiri, which the maintainer @flavorjones was very responsive and merged my patch. Anyway, fun times.