fix(login): strip URL lures from SSO_Message banner - #5681
Merged
norman-abramovitz merged 2 commits intoJul 22, 2026
Merged
Conversation
The /login SSO_Message query param is attacker-controllable and rendered in the login alert banner. Interpolation already escapes HTML, so this is not XSS, but the plain text can carry a URL that reads as a trusted Stratos instruction (social engineering) — e.g. /login?SSO_Message=SECURITY+BREACH...+visit+https://evil.com. Sanitize the value before display: replace URL-like tokens (schemes, www., bare domain.tld) with [link removed] and cap length. Legit messages ("You have been logged out", UAA errors) pass through unchanged. Refs cloudfoundry#5672
norman-abramovitz
approved these changes
Jul 22, 2026
norman-abramovitz
left a comment
Contributor
There was a problem hiding this comment.
LGTM - will look to improve later to see if we can keep some HTML formatting commands, but not now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
/login?SSO_Message=<text>is attacker-controllable and rendered in the loginalert banner (
login-page.component.html:125, via{{ }}). Interpolationalready HTML-escapes, so this is not XSS — but the plain text can carry a
URL that reads like a trusted Stratos instruction, enabling social engineering:
Fixes the low-severity injection reported in #5672.
Change
Sanitize
SSO_Messagebefore display: strip URL-like tokens (schemes,www.,bare
domain.tld[/path]) →[link removed], then cap length to keep it astatus line. The banner stays plain-text-plus-template-styling by design — no
switch to
[innerHTML], which would turn this into a real XSS surface.Legitimate messages are untouched: the backend only emits short status text
(
authuaa.go— "You have been logged out", raw UAA error strings), none ofwhich contain URLs.
Detection note
No new logging added: the crafted request is already captured operator-side in
the frontend (nginx) access log, whose default
combinedformat records thefull request line including the query string, shipped via
cf logs. Backendlogging would be redundant (jetstream's echo logger drops the query anyway) and
would reintroduce a log-injection concern.
Tests
login-page.component.spec.ts: strips scheme/www./bare-domain URLs, caps at256 chars, and passes legit messages through unchanged.
npx vitest run --project=core login-page.component→ green; lint clean.Closes #5672