[PR #6785] [MERGED] feat(saml): validate SAML crypto algorithms during initial phase #32481

Closed
opened 2026-04-17 23:17:00 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6785
Author: @Paola3stefania
Created: 12/15/2025
Status: Merged
Merged: 12/15/2025
Merged by: @Bekacru

Base: canaryHead: feat/saml-config-algorithm-validation


📝 Commits (5)

📊 Changes

7 files changed (+547 additions, -1 deletions)

View changed files

📝 docs/content/docs/plugins/sso.mdx (+45 -0)
📝 packages/sso/src/index.ts (+9 -0)
📝 packages/sso/src/routes/sso.ts (+5 -1)
packages/sso/src/saml/algorithms.test.ts (+205 -0)
packages/sso/src/saml/algorithms.ts (+259 -0)
packages/sso/src/saml/index.ts (+9 -0)
📝 packages/sso/src/types.ts (+15 -0)

📄 Description

Summary by cubic

Adds SAML algorithm validation for responses to flag deprecated or weak crypto (SHA-1, RSA-1.5, 3DES). Defaults to warnings; you can reject or allow via config.

  • New Features
    • Validates signature and encryption algorithms in responses (supports EncryptedAssertion); optional allow-lists for signature, key, and data encryption.
    • Integrated in callbackSSOSAML and acsEndpoint; returns clear API errors (SAML_DEPRECATED_ALGORITHM, SAML_UNKNOWN_ALGORITHM, SAML_ALGORITHM_NOT_ALLOWED).
    • Exports algorithm constants and types; docs updated and unit tests added.

Written for commit ae19b98438. Summary will update automatically on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/6785 **Author:** [@Paola3stefania](https://github.com/Paola3stefania) **Created:** 12/15/2025 **Status:** ✅ Merged **Merged:** 12/15/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `feat/saml-config-algorithm-validation` --- ### 📝 Commits (5) - [`18c825d`](https://github.com/better-auth/better-auth/commit/18c825d5570701eb8491ad3bd07e1de1365eea83) feat: algs for saml - [`e8265c5`](https://github.com/better-auth/better-auth/commit/e8265c5c02d831d5b7756588f889ae37aa3f9145) feat: users opt in to deprec. unit test. clean code - [`53bcf6c`](https://github.com/better-auth/better-auth/commit/53bcf6c8536053b9c71d6556b5439e7175cd22e6) feat: integrate - [`6cba14e`](https://github.com/better-auth/better-auth/commit/6cba14e1989640a8fafcd6c0f88aa4326ecc2730) refactor - [`ae19b98`](https://github.com/better-auth/better-auth/commit/ae19b98438ff0f7f0270f50eaae60c24bdc87c72) fix: dont parse spell on xml ### 📊 Changes **7 files changed** (+547 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/sso.mdx` (+45 -0) 📝 `packages/sso/src/index.ts` (+9 -0) 📝 `packages/sso/src/routes/sso.ts` (+5 -1) ➕ `packages/sso/src/saml/algorithms.test.ts` (+205 -0) ➕ `packages/sso/src/saml/algorithms.ts` (+259 -0) ➕ `packages/sso/src/saml/index.ts` (+9 -0) 📝 `packages/sso/src/types.ts` (+15 -0) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Adds SAML algorithm validation for responses to flag deprecated or weak crypto (SHA-1, RSA-1.5, 3DES). Defaults to warnings; you can reject or allow via config. - **New Features** - Validates signature and encryption algorithms in responses (supports EncryptedAssertion); optional allow-lists for signature, key, and data encryption. - Integrated in callbackSSOSAML and acsEndpoint; returns clear API errors (SAML_DEPRECATED_ALGORITHM, SAML_UNKNOWN_ALGORITHM, SAML_ALGORITHM_NOT_ALLOWED). - Exports algorithm constants and types; docs updated and unit tests added. <sup>Written for commit ae19b98438ff0f7f0270f50eaae60c24bdc87c72. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-17 23:17:00 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#32481