fix(awesomebar): sanitise text when searching in list views

`<img src=x onerror=alert('XSS')//` would work otherwise

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
Akhil Narang 2025-03-05 18:17:25 +05:30
parent fba36d57e5
commit 1d2a0a1269
No known key found for this signature in database
GPG key ID: 9DCC61E211BF645F

View file

@ -324,7 +324,10 @@ frappe.search.AwesomeBar = class AwesomeBar {
var options = {};
options[search_field] = ["like", "%" + txt + "%"];
this.options.push({
label: __("Find {0} in {1}", [txt.bold(), __(route[1]).bold()]),
label: __("Find {0} in {1}", [
frappe.utils.xss_sanitise(txt).bold(),
__(route[1]).bold(),
]),
value: __("Find {0} in {1}", [txt, __(route[1])]),
route_options: options,
onclick: function () {