Skip to content

test(ui): check a signed SAML redirect request by its query signature - #7562

Merged
gustavosbarreto merged 1 commit into
masterfrom
fix/e2e-saml-redirect-signature
Oct 16, 2026
Merged

gustavosbarreto merged 1 commit into
masterfrom
fix/e2e-saml-redirect-signature

Conversation

@gustavosbarreto

@gustavosbarreto gustavosbarreto commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

The enterprise e2e fails on every run since shellhub-io/cloud#2667 merged: saml.spec.ts "ShellHub signs its authentication requests when asked to" stops with expected a signed SAML request.

cloud#2667 fixed how ShellHub signs a request sent over the HTTP-Redirect binding. The request no longer carries an XML signature: SigAlg and Signature in the query sign SAMLRequest, RelayState and SigAlg as sent, which is what the binding requires (saml-bindings-2.0, 3.4.4.1). The spec still looked for the XML signature the old code embedded.

The spec now:

  • asserts the binding: the request went to the redirect endpoint, so a switch to POST fails instead of changing what is checked;
  • verifies the query signature against the SP certificate, over the values still encoded as they came in the URL, rebuilt in the binding's order. Decoding them first would hide an escaping mismatch between what was signed and what was sent;
  • accepts only RSA-SHA256, the one algorithm the SP signs with.

The master runs since then went red on this test only (38938597194 and 38938705956). The run on 72502e7 shows green because its e2e job was skipped, not because the test passed.

@gustavosbarreto
gustavosbarreto requested a review from a team as a code owner October 16, 2026 17:49
@github-actions

This comment has been minimized.

Comment thread ui/apps/console/e2e/saml.spec.ts Outdated
@gustavosbarreto
gustavosbarreto force-pushed the fix/e2e-saml-redirect-signature branch from 296b63a to e3b7c9c Compare October 16, 2026 17:57
@gustavosbarreto

Copy link
Copy Markdown
Member Author

/review

@github-actions

This comment has been minimized.

Comment thread ui/apps/console/e2e/saml.spec.ts Outdated
Comment thread ui/apps/console/e2e/saml.spec.ts Outdated
@gustavosbarreto
gustavosbarreto force-pushed the fix/e2e-saml-redirect-signature branch from e3b7c9c to f494080 Compare October 16, 2026 18:03
@gustavosbarreto

Copy link
Copy Markdown
Member Author

/review

@github-actions

This comment has been minimized.

shellhub-io/cloud#2667 moved the signature of an HTTP-Redirect AuthnRequest from inside the XML
to the query string, as the binding requires (saml-bindings-2.0, 3.4.4.1): the request carries no
XML signature, and SigAlg and Signature sign SAMLRequest, RelayState and SigAlg as sent. The spec
that turns request signing on still looked for an XML signature and has failed on every run since.

The spec now asserts the request went to the redirect endpoint and verifies its query signature
against the SP certificate, over the values still encoded as they came in the URL, rebuilt in the
binding's order; decoding them first would hide an escaping mismatch between what was signed and
what was sent. Only RSA-SHA256 is accepted, the one algorithm the SP signs with, so a change to
the algorithm fails the spec instead of passing it.
@gustavosbarreto

Copy link
Copy Markdown
Member Author

/review

@gustavosbarreto
gustavosbarreto force-pushed the fix/e2e-saml-redirect-signature branch from f494080 to 03e5287 Compare October 16, 2026 18:09
@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Claude finished @gustavosbarreto's task in 1m 32s —— View job


Code Review Complete

Reviewed 2 files on two axes: Standards (repo rules, language conventions, tests, code smells) and Correctness (security and runtime defects). No new issues found. The code looks good as-is.

The Spec axis did not run: this PR closes no issue and its commit has no Fixes:/Closes:/Refs: trailer.

@gustavosbarreto
gustavosbarreto enabled auto-merge (rebase) October 16, 2026 18:12
@gustavosbarreto
gustavosbarreto merged commit 86a7ea0 into master Oct 16, 2026
11 checks passed
@gustavosbarreto
gustavosbarreto deleted the fix/e2e-saml-redirect-signature branch October 16, 2026 18:20
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.

1 participant