oxidecomputer / oxidecomputer/omicron

Prevent SAML replay attacks by tracking used assertion IDs.

Open
#7,820 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

authn security
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
ID values for the length of time for which the assertion would be considered valid based on the
NotOnOrAfter attribute 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)

https://cheatsheetseries.owasp.org/cheatsheets/SAML_Security_Cheat_Sheet.html#unsolicited-response-ie-idp-initiated-sso-considerations-for-service-providers

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.

https://github.com/OWASP/ASVS/blob/master/5.0/en/0x11-V2-Authentication.md#v211-authentication-with-an-identity-provider

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.