chore: SSO/SAML hardening#1756
Conversation
There was a problem hiding this comment.
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/xmldomto^0.8.13via 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.
1fe8cb7 to
ec549fe
Compare
|
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.
|
No description provided.