Skip to content

Display SP service name on the authentication page - #273

Open
kayjoosten wants to merge 10 commits into
mainfrom
feature/issue-258-expose-service-name
Open

kayjoosten wants to merge 10 commits into
mainfrom
feature/issue-258-expose-service-name

Conversation

@kayjoosten

Copy link
Copy Markdown
Contributor

Summary

  • Bump stepup-gssp-bundle/stepup-saml-bundle to the feature branches that preserve and expose the mdui:UIInfo SAML extension
  • Add ServiceNameResolver/ServiceNameFormatter to resolve a locale-matched, sanitized service name and render it on the authentication page when present
  • Clean up stale composer audit ignore entries for simplesamlphp/saml2 advisories that are already fixed in our resolved version

Test plan

  • Unit tests for ServiceNameResolver and ServiceNameFormatter
  • Integration test rendering the real Twig template with and without a service name
  • composer check passes (lint, phpcs, phpstan, phpmd, unit tests, doctrine schema)
  • Manually verified end-to-end against devconf with a fake USB CDP virtual authenticator (Playwright), screenshots of both states

Gateway forwards the SP's display name in an mdui:UIInfo SAML
extension on the AuthnRequest, but Webauthn's authentication page
never surfaced it. Users had no way to confirm which service they
were stepping up for.

Bump stepup-gssp-bundle and stepup-saml-bundle to the feature
branches that preserve and expose the mdui:UIInfo chunk
(AuthenticationService::getMdui()). Add ServiceNameResolver to pick
the best-matching DisplayName for the current locale (exact match,
then en, then first available) and ServiceNameFormatter to sanitize
it (strip control chars, collapse whitespace, truncate at 40 chars
with an ellipsis), mirroring the logic already shipped in
Stepup-gssp-example. Wire the resolved name into
AuthenticationController and render it conditionally in
authentication.html.twig, with translations for en/nl.

When no mdui extension is present the page renders exactly as
before, so this is a purely additive, backwards-compatible change.
Covered by unit tests for the resolver/formatter and an integration
test rendering the real Twig template with and without a service
name. Manually verified end-to-end against devconf with a fake USB
CDP virtual authenticator (Playwright), screenshots taken of both
states.
PKSA-rxdv-j1j4-96fj and PKSA-1983-c8jn-trgm targeted simplesamlphp/saml2
versions below 4.16.16 and 4.6.14 respectively. The resolved version here
is 4.19.x, well past both fixes, so composer audit no longer flags them
and the ignore entries were dead weight - noise that wrongly implies the
vulnerabilities are still present and mitigated by us. Kept the two
entries that still apply (PKSA-1fc7, PKSA-yk3g), which have no upstream
fix and are documented as mitigated/unreachable.
Both remaining ignored advisories (PKSA-1fc7 XPath DoS, PKSA-yk3g
HTTP-Artifact TLS confusion) claimed no patched simplesamlphp/saml2
release existed. That's no longer true: comparing the v4.19.2..v4.19.3
tags shows both fixes were backported and released, and our resolved
version is 4.19.3.

The audit.ignore config key only affects a dev manually running
composer audit locally - CI's daily-security-check.yml uses
symfonycorp/security-checker-action, a separate tool that doesn't
read this config at all, so removing it doesn't change CI behaviour.
Composer's own advisory feed still reports a coarse affected-version
range that hasn't caught up with the precise per-branch patch, so
`composer audit` may show these two as findings again until that
feed updates - that's noise in the advisory database, not a real gap.
@kayjoosten
kayjoosten requested a review from johanib July 10, 2026 09:38
Moved into surfnet/stepup-gssp-bundle to avoid duplicating the same
locale-matching/sanitization logic across every GSSP app (Tiqr, Webauthn,
gssp-example).

@johanib johanib left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes good 👍 , but cannot merge yet.
Maybe double check translation strings with Pieter if they did not originate from ticket / spec.

Comment thread composer.json Outdated
},
"audit": {
"ignore": {
"PKSA-1fc7-xrz7-vw78": "GHSA-5cjr-mxj5-wmrx: DoS via XPath Transform in ds:Signature processing (transitive via surfnet/stepup-saml-bundle -> simplesamlphp/saml2). No patched simplesamlphp/saml2 4.x release exists or is planned. Mitigated in surfnet/stepup-saml-bundle by Surfnet\\SamlBundle\\Signing\\SignatureTransformGuard, called from PostBinding::processResponse() before every signature verification. See Stepup-saml-bundle PR #137.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Update minimal versions so these ignores are no longer needed? (if possible)

Comment thread composer.json Outdated
"surfnet/stepup-gssp-bundle": "^6.0",
"surfnet/stepup-saml-bundle": "^7.0",
"surfnet/stepup-gssp-bundle": "dev-feature/issue-48-preserve-mdui-uiinfo as 6.0.99",
"surfnet/stepup-saml-bundle": "dev-feature/issue-48-mdui-chunk as 7.0.99",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Need to adjust before merging.

composer.lock still resolved surfnet/stepup-gssp-bundle to a commit
before its truncation fix (40 chars total, not 41), since that
dependency's branch hadn't been pushed yet. Re-lock now that it has.

Also restore the "Adding a language" doc section describing how
ServiceNameResolver's locale matching works, updated to point at
surfnet/stepup-gssp-bundle (the resolver moved there, this repo no
longer has its own copy).
… betas

surfnet/stepup-gssp-bundle 6.1.0-beta1 (PR #49) and surfnet/stepup-saml-bundle
7.1.0-beta1 (PR #137) are now tagged, so this no longer needs to float on
dev-branch requirements (or the "as X.Y.99" version alias that pin required).

Verified: phpstan clean, unit-tests show the same 9 pre-existing
DB-connection errors as before this change (integration tests requiring the
docker mariadb host, unrelated to this bump; confirmed identical on
unmodified composer.lock too).
Registration silently hung in Firefox after touching the key, with
no client- or server-side error. The options sent to the browser
carried an empty user.displayName: the client never actually sends
that field, so the server fell back to "". Firefox rejects an empty
displayName; Chrome doesn't enforce it.

This app only has one static configured display name anyway, so use
that as the fallback instead of an empty string.
Both PKSA-1fc7-xrz7-vw78 and PKSA-yk3g-3g3t-ts6q were ignored assuming
no patched simplesamlphp/saml2 4.x release existed. simplesamlphp/saml2
is already locked at 4.19.3, which is the version that fixed
GHSA-5cjr-mxj5-wmrx, and composer audit reports no advisories at all
for the current lock file. Remove the now-dead ignore entries.
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