Skip to content

[codex] OPE-204 enforce SAML assertion signature policy - #200

Merged
salasebas merged 1 commit into
mainfrom
sebastiansala/ope-204-codex-security-23-saml-assertion-signature-policy-can-be
Jul 2, 2026
Merged

[codex] OPE-204 enforce SAML assertion signature policy#200
salasebas merged 1 commit into
mainfrom
sebastiansala/ope-204-codex-security-23-saml-assertion-signature-policy-can-be

Conversation

@salasebas

Copy link
Copy Markdown
Owner

Linear: OPE-204

Summary

This fixes the SAML assertion-signature policy check in the ACS validation path. When want_assertions_signed is enabled, a verified response-level signature no longer satisfies the assertion-signature requirement; the verified signature must be attached to the assertion.

Root Cause

The previous validation only checked whether any verified SAML signature existed. That allowed want_assertions_signed to be satisfied by a non-assertion signature, which weakened deployments that explicitly require assertion-level signatures.

Changes

  • Require VerifiedSamlSignature.element == SamlSignedElement::Assertion when want_assertions_signed is enabled.
  • Add focused regression coverage proving response signatures are rejected when assertion signatures are required and still accepted when they are not required.

Validation

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo nextest run -p rustauth-sso --all-features

@vercel

vercel Bot commented Jul 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
rustauth-docs-site Ignored Ignored Jul 2, 2026 8:11am

@salasebas
salasebas marked this pull request as ready for review July 2, 2026 08:16
@salasebas
salasebas merged commit 0f95405 into main Jul 2, 2026
23 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 2, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 63af9cf9e5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +884 to +888
&& !matches!(
verified_signature,
Some(VerifiedSamlSignature {
element: SamlSignedElement::Assertion
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use namespace-aware assertion-signature detection

For IdPs that emit a standards-valid assertion signature with a custom XMLDSig prefix such as <sig:Signature>, this check can reject valid logins even after signature verification succeeds. The parsed.signature.assertion flag that feeds VerifiedSamlSignature.element is prefix-sensitive in crates/rustauth-saml/src/saml/assertions.rs (assertion_signature_present only recognizes <ds:Signature> or unprefixed <Signature>), so the ACS fast path classifies those assertion signatures as Response and this new matches! returns SAML_ASSERTION_SIGNATURE_REQUIRED. Please make the element classification namespace-aware before enforcing the policy on it.

Useful? React with 👍 / 👎.

@github-actions github-actions Bot mentioned this pull request Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant