|
| 1 | +From 769c032fd93d6f2c07599e096a736c5d09c041cf Mon Sep 17 00:00:00 2001 |
| 2 | +From: Klemen <16374228+KlemenDEV@users.noreply.github.com> |
| 3 | +Date: Tue, 1 Oct 2024 17:50:16 +0200 |
| 4 | +Subject: [PATCH] Fix CVE-2024-6485 (#2) by KlemenDEV |
| 5 | + |
| 6 | +* Fix CVE-2024-6485 |
| 7 | + |
| 8 | +* Inline |
| 9 | + |
| 10 | +* Remove comment |
| 11 | + |
| 12 | +Upstream Patch Reference: https://github.com/entreprise7pro/bootstrap/commit/769c032fd93d6f2c07599e096a736c5d09c041cf.patch |
| 13 | +--- |
| 14 | + src/ui/bower_components/bootstrap/js/button.js | 11 ++++++++++- |
| 15 | + src/ui/node_modules/bootstrap/js/button.js | 11 ++++++++++- |
| 16 | + src/ui/theming/bootstrap/js/button.js | 11 ++++++++++- |
| 17 | + 3 files changed, 30 insertions(+), 3 deletions(-) |
| 18 | + |
| 19 | +diff --git a/src/ui/bower_components/bootstrap/js/button.js b/src/ui/bower_components/bootstrap/js/button.js |
| 20 | +index 843b39c9..f84d4e2d 100644 |
| 21 | +--- a/src/ui/bower_components/bootstrap/js/button.js |
| 22 | ++++ b/src/ui/bower_components/bootstrap/js/button.js |
| 23 | +@@ -25,6 +25,15 @@ |
| 24 | + loadingText: 'loading...' |
| 25 | + } |
| 26 | + |
| 27 | ++ Button.prototype.sanitize = function (unsafeText) { |
| 28 | ++ return unsafeText |
| 29 | ++ .replace(/&/g, "&") |
| 30 | ++ .replace(/</g, "<") |
| 31 | ++ .replace(/>/g, ">") |
| 32 | ++ .replace(/"/g, """) |
| 33 | ++ .replace(/'/g, "'"); |
| 34 | ++ } |
| 35 | ++ |
| 36 | + Button.prototype.setState = function (state) { |
| 37 | + var d = 'disabled' |
| 38 | + var $el = this.$element |
| 39 | +@@ -37,7 +46,7 @@ |
| 40 | + |
| 41 | + // push to event loop to allow forms to submit |
| 42 | + setTimeout($.proxy(function () { |
| 43 | +- $el[val](data[state] == null ? this.options[state] : data[state]) |
| 44 | ++ $el[val](data[state] == null ? this.options[state] : this.sanitize(data[state])) |
| 45 | + |
| 46 | + if (state == 'loadingText') { |
| 47 | + this.isLoading = true |
| 48 | +diff --git a/src/ui/node_modules/bootstrap/js/button.js b/src/ui/node_modules/bootstrap/js/button.js |
| 49 | +index ff4af20e..1c9defa7 100644 |
| 50 | +--- a/src/ui/node_modules/bootstrap/js/button.js |
| 51 | ++++ b/src/ui/node_modules/bootstrap/js/button.js |
| 52 | +@@ -25,6 +25,15 @@ |
| 53 | + loadingText: 'loading...' |
| 54 | + } |
| 55 | + |
| 56 | ++ Button.prototype.sanitize = function (unsafeText) { |
| 57 | ++ return unsafeText |
| 58 | ++ .replace(/&/g, "&") |
| 59 | ++ .replace(/</g, "<") |
| 60 | ++ .replace(/>/g, ">") |
| 61 | ++ .replace(/"/g, """) |
| 62 | ++ .replace(/'/g, "'"); |
| 63 | ++ } |
| 64 | ++ |
| 65 | + Button.prototype.setState = function (state) { |
| 66 | + var d = 'disabled' |
| 67 | + var $el = this.$element |
| 68 | +@@ -37,7 +46,7 @@ |
| 69 | + |
| 70 | + // push to event loop to allow forms to submit |
| 71 | + setTimeout($.proxy(function () { |
| 72 | +- $el[val](data[state] == null ? this.options[state] : data[state]) |
| 73 | ++ $el[val](data[state] == null ? this.options[state] : this.sanitize(data[state])) |
| 74 | + |
| 75 | + if (state == 'loadingText') { |
| 76 | + this.isLoading = true |
| 77 | +diff --git a/src/ui/theming/bootstrap/js/button.js b/src/ui/theming/bootstrap/js/button.js |
| 78 | +index 8fdf9ddc..b9244470 100644 |
| 79 | +--- a/src/ui/theming/bootstrap/js/button.js |
| 80 | ++++ b/src/ui/theming/bootstrap/js/button.js |
| 81 | +@@ -25,6 +25,15 @@ |
| 82 | + loadingText: 'loading...' |
| 83 | + } |
| 84 | + |
| 85 | ++ Button.prototype.sanitize = function (unsafeText) { |
| 86 | ++ return unsafeText |
| 87 | ++ .replace(/&/g, "&") |
| 88 | ++ .replace(/</g, "<") |
| 89 | ++ .replace(/>/g, ">") |
| 90 | ++ .replace(/"/g, """) |
| 91 | ++ .replace(/'/g, "'"); |
| 92 | ++ } |
| 93 | ++ |
| 94 | + Button.prototype.setState = function (state) { |
| 95 | + var d = 'disabled' |
| 96 | + var $el = this.$element |
| 97 | +@@ -37,7 +46,7 @@ |
| 98 | + |
| 99 | + // push to event loop to allow forms to submit |
| 100 | + setTimeout($.proxy(function () { |
| 101 | +- $el[val](data[state] == null ? this.options[state] : data[state]) |
| 102 | ++ $el[val](data[state] == null ? this.options[state] : this.sanitize(data[state])) |
| 103 | + |
| 104 | + if (state == 'loadingText') { |
| 105 | + this.isLoading = true |
| 106 | +-- |
| 107 | +2.43.0 |
| 108 | + |
0 commit comments