mirror of
https://github.com/zulip/zulip.git
synced 2025-11-21 15:09:34 +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
b21117954d
commit
c9796ba7f7
@@ -1,3 +1,4 @@
|
||||
const util = require("./util");
|
||||
const render_settings_deactivation_stream_modal = require("../templates/settings/deactivation_stream_modal.hbs");
|
||||
const render_stream_member_list_entry = require('../templates/stream_member_list_entry.hbs');
|
||||
const render_subscription_settings = require('../templates/subscription_settings.hbs');
|
||||
@@ -111,7 +112,9 @@ exports.update_stream_name = function (sub, new_name) {
|
||||
exports.update_stream_description = function (sub) {
|
||||
const stream_settings = exports.settings_for_sub(sub);
|
||||
stream_settings.find('input.description').val(sub.description);
|
||||
stream_settings.find('.stream-description-editable').html(sub.rendered_description);
|
||||
stream_settings.find('.stream-description-editable').html(
|
||||
util.clean_user_content_links(sub.rendered_description)
|
||||
);
|
||||
};
|
||||
|
||||
exports.invite_user_to_stream = function (user_email, sub, success, failure) {
|
||||
@@ -458,7 +461,9 @@ exports.change_stream_description = function (e) {
|
||||
$(".stream_change_property_info"));
|
||||
},
|
||||
error: function (xhr) {
|
||||
sub_settings.find('.stream-description-editable').html(sub.rendered_description);
|
||||
sub_settings.find('.stream-description-editable').html(
|
||||
util.clean_user_content_links(sub.rendered_description)
|
||||
);
|
||||
ui_report.error(i18n.t("Error"), xhr, $(".stream_change_property_info"));
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user