Skip to content

[codex] cap SAML SLO message inflation - #184

Merged
salasebas merged 1 commit into
mainfrom
codex/saml-slo-size-limit
Jul 1, 2026
Merged

[codex] cap SAML SLO message inflation#184
salasebas merged 1 commit into
mainfrom
codex/saml-slo-size-limit

Conversation

@salasebas

Copy link
Copy Markdown
Owner

Summary

  • Add a configurable SAML SLO logout message size limit.
  • Bound both encoded SLO payloads and inflated Redirect binding XML before parsing or signature verification.
  • Return 413 SAML_LOGOUT_MESSAGE_TOO_LARGE for oversized LogoutRequest/LogoutResponse messages.
  • Add regression coverage for compact DEFLATE payloads that expand past the configured cap.

Root Cause

SAML SLO Redirect binding messages were decoded and inflated from attacker-controlled SAMLRequest/SAMLResponse values before any effective size limit or signature enforcement. A small compressed payload could expand into a much larger XML document and consume CPU/memory before rejection.

Validation

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

Notes

This branch is based on origin/main so it does not include the local AGENTS.md commit/change.

@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
rustauth-docs-site Building Building Preview, Comment Jul 1, 2026 6:26am

@salasebas
salasebas marked this pull request as ready for review July 1, 2026 06:30
@salasebas
salasebas merged commit f89e4b5 into main Jul 1, 2026
22 of 23 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 1, 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: a58bc2f2d2

ℹ️ 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 836 to +837
let compact = encoded.split_whitespace().collect::<String>();
reject_oversized_base64(&compact, max_message_size)?;

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 Bound the raw SAML payload before compaction

In deployments relying on max_logout_message_size as the SLO input cap, this guard runs only after encoded.split_whitespace().collect::<String>(), so an oversized SAMLRequest/SAMLResponse is fully scanned and copied before being rejected; if the excess is mostly whitespace, the compacted value can also remain below the cap and bypass this encoded-length check entirely. Check the raw length first or compact with a bounded accumulator so the new limit actually bounds attacker-controlled request work.

Useful? React with 👍 / 👎.

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