π‘οΈ Sentinel: [HIGH] Fix XSS vulnerabilities in state event previews#857
π‘οΈ Sentinel: [HIGH] Fix XSS vulnerabilities in state event previews#857kevinaboos wants to merge 2 commits intomainfrom
Conversation
Co-authored-by: kevinaboos <1139460+kevinaboos@users.noreply.github.com>
|
π 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 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>
π¨ 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_statewithhtmlize::escape_textwhen formatting as HTML. Used zero-allocationCow::Borrowedwhen escaping is not needed.β Verification: Ran
cargo checkandcargo test --libto ensure the program compiles cleanly and all unit tests pass without regressions.PR created automatically by Jules for task 1905180717600848654 started by @kevinaboos