Summary
Rucio WebUI versions prior to 35.8.3, 38.5.4, and 39.3.1 contain a stored Cross-Site Scripting (XSS) vulnerability in the Custom Rules function, where attacker-controlled content is saved by the backend and later rendered without proper output encoding.
When a victim user views an affected page, the injected JavaScript executes in their browser within the WebUI context, which can enable session token theft or unauthorized actions on their behalf.
Affected context
The vulnerability occurs in the Rucio WebUI, specifically in the Custom Rules feature where user-supplied content is stored and later displayed in the interface.
It becomes relevant in deployments where:
- Users can create or edit Custom Rules with free-form or partially validated text fields
- The backend persists these values and serves them back to the WebUI
- The frontend renders this content in HTML without robust output encoding or context-aware escaping
Under these conditions, content submitted by one user can be rendered to other users with active Rucio WebUI sessions.
Exploit preconditions
- Attack surface: Rucio WebUI Custom Rules pages accessible over HTTP(S).
- Required access: Ability to create or modify Custom Rules (e.g., authenticated user with sufficient permissions, or any role allowed to manage rules).
- Trigger point: A victim user navigates to a page where the stored Custom Rule data is rendered (lists, detail views, or related UI components).
- Why exploitation is possible: The application stores attacker-controlled input and later injects it into HTML responses without appropriate context-aware output encoding, allowing browsers to interpret it as executable JavaScript.
Why this happens
The core issue is a failure to apply proper output encoding when rendering stored user-controlled data into HTML, a classic manifestation of CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting).
The backend persists Custom Rules data as-is, and the frontend injects these values into the DOM without HTML or JavaScript context escaping.
This insecure pattern allows markup or script-like content to break out of the intended display context and execute as active content in the browser.
CWE-1004 (Sensitive Cookie Without 'HttpOnly' Flag) is conceptually relevant because XSS significantly increases the risk of cookie and session token theft when HttpOnly is not enforced, but the primary bug class is stored XSS in the template rendering path.
Potential impact
- Execution of arbitrary JavaScript in the browser of any user viewing the affected WebUI pages
- Theft of session tokens or other web storage-based authentication artifacts, especially if cookies lack the HttpOnly attribute
- Impersonation of victim users by performing actions in the WebUI on their behalf (e.g., modifying data management rules or policies within the user's privileges)
- Manipulation of the user interface to mislead users into performing unintended actions (UI redressing/phishing within the application)
- Lateral movement within the Rucio environment through abuse of higher-privileged user sessions
General mitigation guidance
Effective mitigation focuses on treating all stored and reflected content as untrusted and enforcing strict, context-aware encoding at render time.
Pattern-based mitigations include:
- Applying output encoding/escaping in templates for all user-controlled fields, ensuring HTML, attribute, URL, and JavaScript contexts each use appropriate encoders
- Adopting a templating system or frontend framework that auto-escapes values by default and discourages raw HTML injection
- Validating and normalizing Custom Rules input to restrict it to expected formats (e.g., plain text, constrained patterns) and rejecting or sanitizing disallowed constructs
- Implementing Content Security Policy (CSP) that disallows inline scripts and restricts script sources to reduce impact if XSS is introduced
- Ensuring cookies that carry session identifiers are flagged as HttpOnly and Secure, so they cannot be accessed via JavaScript and are protected over TLS
- Applying least-privilege principles for roles allowed to create or edit Custom Rules, limiting the blast radius if a compromised account injects malicious content
How teams detect issues like this
Detection generally combines static review of the codebase with targeted dynamic testing:
- Static analysis: Configure SAST rules to flag direct insertion of user-controlled variables into HTML templates, JavaScript strings, or DOM manipulation APIs without encoding.
- Template review: During code review, look for use of template constructs that bypass auto-escaping (e.g., "safe" or "raw" markers) in any field linked to Custom Rules or other user-provided content.
- Security testing: Use automated DAST tools or manual penetration testing to submit benign XSS probes in Custom Rules fields and verify whether they appear unencoded in the rendered WebUI.
- Policy enforcement: Integrate secure coding guidelines into CI pipelines, requiring reviewers to confirm that newly introduced UI fields either enforce strict validation or apply context-aware escaping.

