From 82111163750930758e49ced905af2c3b8ad24be4 Mon Sep 17 00:00:00 2001 From: Jordan Wright Date: Wed, 25 May 2016 18:35:47 -0500 Subject: [PATCH] Fixing some minor xss issues - Fixes #272 --- static/js/app/templates.js | 10 +++++----- static/js/app/users.js | 36 ++++++++++++++++++------------------ 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/static/js/app/templates.js b/static/js/app/templates.js index 250873c8..aa8f1e7c 100644 --- a/static/js/app/templates.js +++ b/static/js/app/templates.js @@ -36,7 +36,7 @@ function save(idx) { // Add the attachments $.each($("#attachmentsTable").DataTable().rows().data(), function(i, target) { template.attachments.push({ - name: target[1], + name: unescapeHtml(target[1]), content: target[3], type: target[4], }) @@ -108,7 +108,7 @@ function attach(files) { // Add the record to the modal attachmentsTable.row.add([ '', - file.name, + escapeHtml(file.name), '', reader.result.split(",")[1], file.type || "application/octet-stream" @@ -157,7 +157,7 @@ function edit(idx) { // Add the record to the modal attachmentsTable.row.add([ '', - file.name, + escapeHtml(file.name), '', file.content, file.type || "application/octet-stream" @@ -212,7 +212,7 @@ function copy(idx) { // Add the record to the modal attachmentsTable.row.add([ '', - file.name, + escapeHtml(file.name), '', file.content, file.type || "application/octet-stream" @@ -279,7 +279,7 @@ function load() { templateTable.clear() $.each(templates, function(i, template) { templateTable.row.add([ - template.name, + escapeHtml(template.name), moment(template.modified_date).format('MMMM Do YYYY, h:mm:ss a'), "