oxidecomputer / oxidecomputer/omicron
Prevent SAML replay attacks by tracking used assertion IDs.
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 572
- Forks
- 97
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 96
Description
In order to prevent SAML replay attacks Omicron should track previously seen SAML assertion IDs and use them as nonces when performing SAML authentication. The SAML Profiles specification 2.0 states the following in section 4.1.4.5:
The service provider MUST ensure that bearer assertions are not replayed, by maintaining the set of used
IDvalues for the length of time for which the assertion would be considered valid based on the
NotOnOrAfterattribute in the<SubjectConfirmationData>.
Section 1.3.4 of SAML Core specification v2.0 states uniqueness requirements for ID types (used by assertions, requests, and responses), so they should indeed work for this purpose for well-behaved IdPs.
There's a control in NIST SP 800-53 that speaks to this requirement, which is included in all NIST security baselines:
Implement replay-resistant authentication mechanisms for access to [Selection (one or more): privileged accounts; non-privileged accounts].
https://csrc.nist.gov/projects/cprt/catalog#/cprt/framework/version/SP_800_53_5_1_1/home?element=IA-02#IA-02(08)
OWASP SAML Security Cheat Sheet:
Implement proper replay detection either at the response or assertion level. This will help counter the following attack: Replay (6.1.2)
OWASP ASVS 5.0 (not yet released)
Verify that SAML assertions are uniquely processed and used only once within the validity period to prevent replay attacks.
Examples
- I briefly looked for examples of specifically how others are solving this, I found this from an Okta help page:
While Okta does not support OneTimeUse, it does have a replay cache. This cache stores the assertion ID to prevent replay of assertions.
-- https://support.okta.com/help/s/article/okta-service-has-protection-against-replay-attacks?language=en_US
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the SAML authentication flow and the SAML Profiles 2.0 and Core 2.0 sections cited in the issue, along with the OWASP SAML Security Cheat Sheet. Define how assertion IDs are retained for each assertion's validity period and how reused IDs are rejected; done means a bearer assertion cannot be processed twice within its NotOnOrAfter window.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- authentication, security
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100