[PR #6682] [MERGED] fix(saml): remove signature validation bypass #15068

Closed
opened 2026-04-13 09:48:35 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

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

Base: canaryHead: fix/signature-validation-enforcement


📝 Commits (6)

  • 637eee5 fix: remove regex fallback and catch error
  • ccc1796 fix: Removed code that patched SAML
  • b29ee61 fix: remove regex fallback in acsendpoint
  • 8052e7b feat: add test
  • 876cc9a make lint happy
  • f449e4b Merge branch 'canary' into fix/signature-validation-enforcement

📊 Changes

2 files changed (+166 additions, -69 deletions)

View changed files

📝 packages/sso/src/routes/sso.ts (+12 -69)
📝 packages/sso/src/saml.test.ts (+154 -0)

📄 Description

Summary by cubic

Enforces strict SAML signature validation by removing fallback parsing and response patching. Prevents unsigned or forged assertions from being accepted.

  • Bug Fixes
    • Removed regex-based NameID extraction and status “success” patching in callbackSSOSAML and ACS endpoints; rely solely on sp.parseLoginResponse.
    • Reject SAML responses without valid signatures; no decoding/heuristic fallbacks.
    • Added tests that ensure unsigned responses and invalid signatures return BAD_REQUEST.

Written for commit f449e4b3b0. 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/6682 **Author:** [@Paola3stefania](https://github.com/Paola3stefania) **Created:** 12/11/2025 **Status:** ✅ Merged **Merged:** 12/11/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `fix/signature-validation-enforcement` --- ### 📝 Commits (6) - [`637eee5`](https://github.com/better-auth/better-auth/commit/637eee5774ba07eb934c3f4291ce9d47f8291692) fix: remove regex fallback and catch error - [`ccc1796`](https://github.com/better-auth/better-auth/commit/ccc1796f31b5dac5de942a53dd6034ce53a33aa7) fix: Removed code that patched SAML - [`b29ee61`](https://github.com/better-auth/better-auth/commit/b29ee6130df85de4c273a06671ac874189f7009e) fix: remove regex fallback in acsendpoint - [`8052e7b`](https://github.com/better-auth/better-auth/commit/8052e7bf19028382a00f330057f8eee5c80f3741) feat: add test - [`876cc9a`](https://github.com/better-auth/better-auth/commit/876cc9aed03062d53e2c2bd1a82cfb7e24275a62) make lint happy - [`f449e4b`](https://github.com/better-auth/better-auth/commit/f449e4b3b0635e4d5161bf67a5c55a138360c6b9) Merge branch 'canary' into fix/signature-validation-enforcement ### 📊 Changes **2 files changed** (+166 additions, -69 deletions) <details> <summary>View changed files</summary> 📝 `packages/sso/src/routes/sso.ts` (+12 -69) 📝 `packages/sso/src/saml.test.ts` (+154 -0) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Enforces strict SAML signature validation by removing fallback parsing and response patching. Prevents unsigned or forged assertions from being accepted. - **Bug Fixes** - Removed regex-based NameID extraction and status “success” patching in callbackSSOSAML and ACS endpoints; rely solely on sp.parseLoginResponse. - Reject SAML responses without valid signatures; no decoding/heuristic fallbacks. - Added tests that ensure unsigned responses and invalid signatures return BAD_REQUEST. <sup>Written for commit f449e4b3b0635e4d5161bf67a5c55a138360c6b9. 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-13 09:48:35 -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#15068