Summary
A stored cross-site scripting (XSS) flaw in migration-planner-ui-app allows attackers to inject JavaScript via a crafted credentialUrl when registering a discovery agent.
If an organizational user later clicks the malicious link in the UI, the attacker's script runs in the victim's browser, enabling compromise of the Red Hat SSO session and potential cross-tenant data and API access.
Affected context
The vulnerability appears in the migration-planner-ui-app user interface where discovery agents and their credential URLs are displayed and interacted with.
It manifests when user-controlled fields associated with agent registration are rendered into the page without robust output encoding, and when link interactions can execute embedded JavaScript in the browser.
Risk is elevated in deployments integrated with Red Hat Single Sign-On and where users have access to multiple tenants or privileged API operations.
Exploit preconditions
- Attack surface: Web UI of migration-planner-ui-app, specifically views listing or managing discovery agents and their credential URLs.
- Required access: Ability to register or modify a discovery agent entry so as to control the credentialUrl value (e.g., attacker-controlled tenant, user, or compromised account).
- User interaction: An organizational user with a valid Red Hat SSO session must view and click the malicious link in the application UI.
- Why exploitation is possible: The application fails to properly sanitize and encode the credentialUrl value before rendering it in the DOM, allowing JavaScript execution when the URL is followed.
Why this happens
This issue is rooted in improper neutralization of user-controlled data before it is injected into an HTML context, aligning with CWE-79: Improper Neutralization of Input During Web Page Generation (XSS).
The credentialUrl field, supplied by an untrusted party during discovery agent registration, is later rendered into the UI in a way that can be interpreted as executable script by the browser.
Insufficient output encoding, lack of strict URL validation, and reliance on the browser's default behavior allow attacker-supplied JavaScript to run in the context of the victim's authenticated session.
Potential impact
- Theft or hijacking of the victim's Red Hat SSO session tokens or cookies.
- Unauthorized cross-tenant access to data visible to the compromised user.
- Execution of privileged API actions as the victim, including configuration changes or data exfiltration.
- Lateral movement by leveraging compromised accounts to enroll more malicious agents or trigger additional attacks.
- Persistent compromise of user workflows if malicious entries remain active in the system.
General mitigation guidance
Effective mitigation generally focuses on strong output encoding and strict handling of untrusted URLs rather than ad hoc filtering.
Recommended patterns include:
- Applying context-aware output encoding for all user-controlled fields before inserting them into HTML, attributes, or JavaScript blocks.
- Validating credentialUrl values against a strict allowlist of schemes and hostnames, and rejecting or neutralizing any unexpected patterns.
- Rendering user-controlled links as inert text or using safe link handling components that do not allow script execution (e.g., no
javascript:URLs, enforced HTTP/HTTPS). - Enforcing Content Security Policy (CSP) to limit inline script execution and reduce impact if an injection occurs.
- Applying least-privilege principles so that a single user's session has minimal cross-tenant reach where feasible.
How teams detect issues like this
Detection typically involves a combination of code-level and runtime analysis:
- Static analysis rules or linters that flag direct insertion of untrusted data into HTML or attribute contexts without encoding.
- Manual code reviews focused on UI templates, link generation logic, and URL-handling code paths for discovery agent configuration.
- Automated security testing (DAST) that attempts to inject script payloads into fields like credentialUrl and monitors for reflected or stored execution in the UI.
- Logging and monitoring of unusual credentialUrl patterns, such as non-HTTP/HTTPS schemes, and anomalous front-end errors or CSP violations.
- Integration of security scanners into CI/CD pipelines to enforce policies on URL validation and output encoding practices.

