mirror of
https://github.com/zulip/zulip.git
synced 2025-10-28 18:43:52 +00:00
CVE-2020-9444: Prevent reverse tabnabbing attacks.
While we could fix this issue by changing the markdown processor, doing so is not a robust solution, because even a momentary bug in the markdown processor could allow cached messages that do not follow our security policy. This change ensures that even if our markdown processor has bugs that result in rendered content that does not properly follow our policy of using rel="noopener noreferrer" on links, we'll still do something reasonable. Co-authored-by: Tim Abbott <tabbott@zulipchat.com> Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
committed by
Tim Abbott
parent
e3a4aeeffa
commit
68cfcd6446
@@ -773,7 +773,7 @@ exports.render_and_show_preview = function (preview_spinner, preview_content_box
|
||||
rendered_preview_html = rendered_content;
|
||||
}
|
||||
|
||||
preview_content_box.html(rendered_preview_html);
|
||||
preview_content_box.html(util.clean_user_content_links(rendered_preview_html));
|
||||
if (page_params.emojiset === "text") {
|
||||
preview_content_box.find(".emoji").replaceWith(function () {
|
||||
const text = $(this).attr("title");
|
||||
|
||||
Reference in New Issue
Block a user