Skip to content

πŸ›‘οΈ Sentinel: [HIGH] Fix XSS vulnerabilities in state event previews#857

Closed
kevinaboos wants to merge 2 commits intomainfrom
sentinel/xss-event-previews-1905180717600848654
Closed

πŸ›‘οΈ Sentinel: [HIGH] Fix XSS vulnerabilities in state event previews#857
kevinaboos wants to merge 2 commits intomainfrom
sentinel/xss-event-previews-1905180717600848654

Conversation

@kevinaboos
Copy link
Copy Markdown
Member

🚨 Severity: HIGH
πŸ’‘ Vulnerability: User-controlled fields within AnyOtherStateEventContentChange (such as room aliases, room versions, custom guest access and history visibility rules, and tombstone replacement URIs) were being concatenated directly into HTML previews without being sanitized. This could allow an attacker to inject arbitrary HTML into the preview rendering of timeline events if a malicious payload was set.
🎯 Impact: Exploitation could lead to Cross-Site Scripting (XSS) allowing a malicious actor to inject code or break the UI layout when viewing compromised state events.
πŸ”§ Fix: Wrapped the extraction logic for user-provided fields in text_preview_of_other_state with htmlize::escape_text when formatting as HTML. Used zero-allocation Cow::Borrowed when escaping is not needed.
βœ… Verification: Ran cargo check and cargo test --lib to ensure the program compiles cleanly and all unit tests pass without regressions.


PR created automatically by Jules for task 1905180717600848654 started by @kevinaboos

Co-authored-by: kevinaboos <1139460+kevinaboos@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

πŸ‘‹ Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a πŸ‘€ emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Co-authored-by: kevinaboos <1139460+kevinaboos@users.noreply.github.com>
@kevinaboos kevinaboos closed this May 6, 2026
@kevinaboos kevinaboos deleted the sentinel/xss-event-previews-1905180717600848654 branch May 6, 2026 12:31
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