Skip to content

wasm: sanitize title contents - #331

Open
mcginty wants to merge 1 commit into
PolyMeilex:masterfrom
mcginty:wasm-innerhtml-fix
Open

wasm: sanitize title contents#331
mcginty wants to merge 1 commit into
PolyMeilex:masterfrom
mcginty:wasm-innerhtml-fix

Conversation

@mcginty

@mcginty mcginty commented Aug 28, 2026

Copy link
Copy Markdown

If users of the crate set titles with any kind of untrusted input like a tag, filename, or whatever, arbitrary HTML can be inserted.

Reproduction

Modify https://github.com/PolyMeilex/rfd/blob/master/examples/web-trunk/src/main.rs#L17 to contain:

-        let task = rfd::AsyncFileDialog::new().pick_file();
+        let task = rfd::AsyncFileDialog::new()
+            .set_title(r#"<img src=x onerror="alert('HACK THE PLANET')">"#)
+            .pick_file();

then run trunk serve and click the rfd button.

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