Repository navigation
fix: preserve encrypted response fallback with multiple certificates - #1150
deepakprabhakara merged 2 commits into
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Assert the specific rejection for a tampered Response and an untrusted certificate list, and cover a digest mismatch with multiple certificates directly in validateSignature. Write the check as `valid === undefined`. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EdsD5LceNhxMXQTQv7x1Dt
|
Thanks for the fix and the clear write-up, @srkirkland. The diagnosis is spot on: xml-crypto checks the reference digests before it looks at any key, so the multi-certificate path was throwing before the encrypted-XML fallback could run. I've pushed one small commit on top of yours rather than going back and forth on nits. It writes the check as valid === undefined, pins the expected error messages in the new tests, and adds a direct validateSignature test for a digest mismatch with multiple certificates. Your commit is untouched. Shout if you disagree with any of it, otherwise I'll get this merged once CI is green. |
Valid responses containing an encrypted Assertion inside a signed Response are rejected when
publicKeycontains multiple comma-separated certificates, including a duplicate of the same certificate. The same response succeeds with a single certificate. This affects identity providers publishing multiple signing certificates during rollover.Decryption changes the signed Response's digest, so validation must retry against the original encrypted XML. The multi-certificate path currently throws when
checkSignature()returnsfalse, preventing that existing fallback. Preserve the false result, matching the single-certificate path, while retaining the error when every certificate attempt throws. Successful validation still requires a verified signature over the original XML; signature and claim checks remain in place.The regression tests use existing synthetic fixtures and cover the active certificate first, active certificate last, and duplicate certificates. Each configuration must accept the valid response and reject tampering, an incorrect audience, and an incorrect request ID. A separate case rejects an entirely untrusted certificate list.
Validation: all three new acceptance cases fail on unmodified main and pass with the fix. All 1,718 tests pass on Node 24, along with lint, formatting, build, and type checks. An equivalent fix has also been validated in a downstream Jackson deployment with real federated sign-ins.
Summary by CodeRabbit