-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Throw if multiple XML roots detected #195
Conversation
Codecov Report
@@ Coverage Diff @@
## master #195 +/- ##
==========================================
+ Coverage 80.75% 80.85% +0.09%
==========================================
Files 11 11
Lines 816 820 +4
Branches 247 247
==========================================
+ Hits 659 663 +4
Misses 71 71
Partials 86 86
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
In addition to hardening |
I've made some changes to take into considerations @srd90's latest comments about how other parts of the code could use the same XML validation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that throwing if we detect multiple SAML roots is a stronger approach than our first attempt.
I saw that parseDomFromString
switched to an async method that returned a promise. I reviewed the docs to see if this was a public method and thus a breaking change, but it appears that it was not a public method and this not a breaking change.
I think this is the best place for you to make this specific change, and it looks correct to me at least reading the code. Thanks for doing this. The only thing which could be stronger would be to not even parse as far as the end of the AuthnResponse, and return an authentication error when the status is read (earlier than the end of the response) but I'm guessing this would be harder because the parse strategy would have to change (SAX interface vs DOM). I will try to look at whether that is even possible or a good idea. The other thing I'll note is that I submitted a similar comment to the security list for the |
|
Description
Based on the discussion at #191, it seems there is a better way to protect against XML files with multiple roots. This PR is to implement that.