Use Assertion IDs to prevent SAML replay attacks
See original GitHub issueFrom the https://docs.oasis-open.org/security/saml/v2.0/saml-profiles-2.0-os.pdf,
"The service provider MUST ensure that bearer assertions are not replayed, by maintaining the set of used ID values for the length of time for which the assertion would be considered valid based on the NotOnOrAfter attribute in the ".
Currently, there’s no way to configure and use this form of defense. It would be nice if the library could handle the assertion ID validation too as part of authentication.
Note: By setting the “allow_unsolicited” config to False
, it sort of prevents the replay attacks. But it would take out the IdP initiated logins altogether.
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (8 by maintainers)
Top Results From Across the Web
The Dangers of SAML Replay Attacks - IDM 360
If the hacker steals the assertion and replays it, there is a 50% or greater chance the assertion will be replayed to Server2....
Read more >Use Assertion IDs to prevent SAML replay attacks #250 - GitHub
"The service provider MUST ensure that bearer assertions are not replayed, by maintaining the set of used ID values for the length of...
Read more >SAML Assertion Replay attacks - ComponentSpace
Hi, we are using High level SAML API provided by component space ... store the assertionIDs to prevent replay attacks, what is the...
Read more >How to prevent replay attack in IDP initiated SSO using SAML2
The SP should keep a list of IDs of accepted assertions, for the lifetime of the assertion to prevent Replay. And re the...
Read more >SAML Bad Practices: Insecure Message ID Implementation
To prevent replay attacks, the SAML standard has multiple optional provisions. One of the provisions is to use a unique ID in each...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey @peppelinux I’m planning to open a PR soon, could you reopen this issue and assign it to me?
if allow_unsolicited is set to True we have a correct behaviour, standing on how pysaml2 implemented SAML2-core. I agree that djangosaml2 could enforce this aspect, with a local storage with expirable (60mins) entities that woould simply have session_id, but, sincerely, if I don’tfind a motivated contributor to pursue this goal, I would honestly not include this in the roadmap, because I firmly believe that with rare exceptions the allow_unsolicited and IdPInitiated login features shouldn’t be enabled in a production environment.
See Redis TTL and take your time for a PR, when you’ll start ask me to reopen this Issue and stay sure that I’ll review and merge your contribution asap