Skip to content

chore: SSO/SAML hardening#1756

Open
paustint wants to merge 1 commit into
mainfrom
sec/saml-sso-hardening
Open

chore: SSO/SAML hardening#1756
paustint wants to merge 1 commit into
mainfrom
sec/saml-sso-hardening

Conversation

@paustint
Copy link
Copy Markdown
Contributor

@paustint paustint commented Jun 1, 2026

No description provided.

Copilot AI review requested due to automatic review settings June 1, 2026 14:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens the SSO/SAML authentication surface area by pinning a patched XML DOM dependency, tightening SAML assertion replay/age controls, and adding additional crypto input validation with corresponding tests.

Changes:

  • Force @xmldom/xmldom to ^0.8.13 via pnpm overrides to pick up security patches on the SAML validation dependency chain.
  • Add explicit malformed/truncated payload guarding in decryptSecret (AES-256-GCM) and test coverage for the clearer error.
  • Strengthen SAML response handling by bounding assertion age, extending consumed-assertion TTL, and enforcing mandatory assertion replay protection keyed from the verified assertion; add unit tests for first-use/replay/fail-closed behavior.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pnpm-workspace.yaml Adds an override to force a patched @xmldom/xmldom for SAML-related transitive deps.
pnpm-lock.yaml Updates lockfile overrides and resolved @xmldom/xmldom version to 0.8.13 across dependents.
libs/auth/server/src/lib/sso-crypto.util.ts Adds documentation on IV length choice and guards against undersized encrypted payloads before slicing.
libs/auth/server/src/lib/saml.service.ts Introduces max assertion age and mandatory replay detection derived from the verified assertion; adjusts consumed-assertion TTL.
libs/auth/server/src/lib/tests/sso-crypto.util.spec.ts Adds a test asserting the new clear “too short” error for undersized ciphertext payloads.
libs/auth/server/src/lib/tests/saml.service.spec.ts Adds tests for first-use acceptance, replay rejection, and fail-closed behavior when no assertion identifier can be derived.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread libs/auth/server/src/lib/saml.service.ts Outdated
@paustint paustint force-pushed the sec/saml-sso-hardening branch from 1fe8cb7 to ec549fe Compare June 1, 2026 22:44
@socket-security
Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn Critical
Critical CVE: When Vitest UI server is listening, arbitrary file can be read and executed

CVE: GHSA-5xrq-8626-4rwp When Vitest UI server is listening, arbitrary file can be read and executed (CRITICAL)

Affected versions: < 4.1.0

Patched version: 4.1.0

From: package.jsonnpm/vitest@4.0.9

ℹ Read more on: This package | This alert | What is a critical CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known critical CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/vitest@4.0.9. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm @react-email/ui is 91.0% likely obfuscated

Confidence: 0.91

Location: Package overview

From: package.jsonnpm/@react-email/ui@6.4.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@react-email/ui@6.4.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants