π‘οΈ Sentinel: [HIGH] Fix XSS / HTML Injection in Media Filenames and Inviter Details#768
Conversation
Sanitizes filenames in file, video, and audio media types as well as display_name and user_id in invited room previews before passing them to the html rendering engine to prevent XSS vulnerabilities. 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. |
π¨ Severity: HIGH
π‘ Vulnerability: Unsanitized user inputs (filenames, user IDs, and display names) were being passed directly into
format!()macros and rendered dynamically as HTML via theshow_htmlfunction in Makepad widgets. This constitutes a Cross-Site Scripting (XSS) or HTML Injection vulnerability, where an attacker could provide malicious payloads in file names or their display name to inject arbitrary HTML into the UI context.π― Impact: If exploited, this could allow an attacker to disrupt the UI, mislead users, or potentially execute unintended operations in the context of the application by injecting elements such as
<script>or fake links.π§ Fix: Wrapped the relevant variables in
htmlize::escape_text(...)before inserting them into HTML-destined formatted strings. This ensures that any HTML entities (like<,>,&) are properly escaped and displayed as plain text instead of being executed by the HTML parser. The fix was applied across theroom_screen.rs(for file, audio, and video filenames) androoms_list_entry.rs(for inviter details).β Verification: Ran
cargo check,cargo clippy, and the test suite viacargo test --lib -- tests. All tests and checks passed. No layout regressions were introduced.PR created automatically by Jules for task 24851588514841085 started by @kevinaboos