@openui5/sap.ui.support 1.84.56 → 1.84.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.txt CHANGED
@@ -616,7 +616,7 @@ License: MIT License
616
616
  <year> = 2018
617
617
  <copyright holders> = Michael Mclaughlin
618
618
 
619
- Component: lodash 4.17.23
619
+ Component: lodash 4.18.1
620
620
  Licensor: JS Foundation and other contributors
621
621
  Website: https://github.com/lodash/lodash
622
622
  License: MIT License
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openui5/sap.ui.support",
3
- "version": "1.84.56",
3
+ "version": "1.84.57",
4
4
  "description": "OpenUI5 UI Library sap.ui.support",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -14,10 +14,10 @@
14
14
  "url": "https://github.com/SAP/openui5.git"
15
15
  },
16
16
  "dependencies": {
17
- "@openui5/sap.m": "1.84.56",
18
- "@openui5/sap.ui.codeeditor": "1.84.56",
19
- "@openui5/sap.ui.core": "1.84.56",
20
- "@openui5/sap.ui.fl": "1.84.56",
21
- "@openui5/sap.ui.layout": "1.84.56"
17
+ "@openui5/sap.m": "1.84.57",
18
+ "@openui5/sap.ui.codeeditor": "1.84.57",
19
+ "@openui5/sap.ui.core": "1.84.57",
20
+ "@openui5/sap.ui.fl": "1.84.57",
21
+ "@openui5/sap.ui.layout": "1.84.57"
22
22
  }
23
23
  }
@@ -6,7 +6,7 @@
6
6
  <copyright>OpenUI5
7
7
  * (c) Copyright 2009-2026 SAP SE or an SAP affiliate company.
8
8
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.</copyright>
9
- <version>1.84.56</version>
9
+ <version>1.84.57</version>
10
10
 
11
11
  <documentation>UI5 library: sap.ui.support</documentation>
12
12
 
@@ -32,7 +32,7 @@ sap.ui.define([
32
32
  * @namespace
33
33
  * @alias sap.ui.support.RuleAnalyzer
34
34
  * @author SAP SE
35
- * @version 1.84.56
35
+ * @version 1.84.57
36
36
  * @public
37
37
  */
38
38
  var RuleAnalyzer = {
@@ -32,7 +32,7 @@ sap.ui.define(["sap/ui/support/supportRules/Main",
32
32
  * @deprecated Since version 1.60.0. Please use sap/ui/support/RuleAnalyzer instead.
33
33
  * @alias jQuery.sap.support
34
34
  * @author SAP SE
35
- * @version 1.84.56
35
+ * @version 1.84.57
36
36
  * @public
37
37
  */
38
38
  jQuery.sap.support = {
@@ -23,7 +23,7 @@ sap.ui.define(["sap/ui/core/library"],
23
23
  * @namespace
24
24
  * @name sap.ui.support
25
25
  * @author SAP SE
26
- * @version 1.84.56
26
+ * @version 1.84.57
27
27
  *
28
28
  * @public
29
29
  */
@@ -41,7 +41,7 @@ sap.ui.define(["sap/ui/core/library"],
41
41
  controls: [],
42
42
  elements: [],
43
43
  noLibraryCSS: true,
44
- version: "1.84.56",
44
+ version: "1.84.57",
45
45
  extensions: {
46
46
  //Configuration used for rule loading of Support Assistant
47
47
  "sap.ui.support": {
@@ -53,7 +53,7 @@ sap.ui.define(["sap/ui/core/library"],
53
53
  /**
54
54
  * Defines severity types.
55
55
  * @enum {string}
56
- * @since 1.84.56
56
+ * @since 1.84.57
57
57
  * @public
58
58
  */
59
59
  sap.ui.support.Severity = {
@@ -77,7 +77,7 @@ sap.ui.define(["sap/ui/core/library"],
77
77
  /**
78
78
  * Defines the Audiences.
79
79
  * @enum {string}
80
- * @since 1.84.56
80
+ * @since 1.84.57
81
81
  * @public
82
82
  */
83
83
  sap.ui.support.Audiences = {
@@ -101,7 +101,7 @@ sap.ui.define(["sap/ui/core/library"],
101
101
  /**
102
102
  * Issue Categories.
103
103
  * @enum {string}
104
- * @since 1.84.56
104
+ * @since 1.84.57
105
105
  * @public
106
106
  */
107
107
  sap.ui.support.Categories = {
@@ -170,7 +170,7 @@ sap.ui.define(["sap/ui/core/library"],
170
170
  /**
171
171
  * Analysis history formats.
172
172
  * @enum {string}
173
- * @since 1.84.56
173
+ * @since 1.84.57
174
174
  * @public
175
175
  */
176
176
  sap.ui.support.HistoryFormats = {
@@ -189,7 +189,7 @@ sap.ui.define(["sap/ui/core/library"],
189
189
  /**
190
190
  * Contains the available system presets.
191
191
  * @enum {object}
192
- * @since 1.84.56
192
+ * @since 1.84.57
193
193
  * @public
194
194
  */
195
195
  sap.ui.support.SystemPresets = {
@@ -30,11 +30,11 @@ sap.ui.define([],
30
30
  rule = serializedRule;
31
31
  }
32
32
 
33
- /* eslint-disable no-eval */
33
+ /* eslint-disable no-new-func */
34
34
  if (!stringifyCheck && rule.check !== undefined) {
35
- eval("rule.check = " + rule.check);
35
+ rule.check = new Function("return (" + rule.check + ")")();
36
36
  }
37
- /* eslint-enable no-eval */
37
+ /* eslint-enable no-new-func */
38
38
 
39
39
  return rule;
40
40
  }
@@ -38,7 +38,7 @@ function (jQuery, library, storage, constants) {
38
38
  * @name sap.ui.support.RuleSet
39
39
  * @memberof sap.ui.support
40
40
  * @author SAP SE
41
- * @version 1.84.56
41
+ * @version 1.84.57
42
42
  * @param {object} oSettings Name of the initiated
43
43
  * @returns {void}
44
44
  */
@@ -22,7 +22,7 @@ sap.ui.define([
22
22
  * @name sap.ui.support.Storage
23
23
  * @alias sap.ui.support.Storage
24
24
  * @author SAP SE.
25
- * @version 1.84.56
25
+ * @version 1.84.57
26
26
  *
27
27
  * @private
28
28
  *
@@ -3,6 +3,7 @@
3
3
  * (c) Copyright 2009-2026 SAP SE or an SAP affiliate company.
4
4
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
5
  */
6
+ /*global URL */
6
7
 
7
8
  /**
8
9
  * @typedef {object} EventListener
@@ -26,7 +27,7 @@ sap.ui.define([
26
27
  * @name sap.ui.support.WindowCommunicationBus
27
28
  * @memberof sap.ui.support
28
29
  * @author SAP SE
29
- * @version 1.84.56
30
+ * @version 1.84.57
30
31
  * @private
31
32
  */
32
33
  var WindowCommunicationBus = Object.extend("sap.ui.support.supportRules.WindowCommunicationBus", {
@@ -141,31 +142,79 @@ sap.ui.define([
141
142
  };
142
143
 
143
144
  /**
144
- * validate messages published from external window to application window (i.e. from tool frame to opener window)
145
- * no validation needed the other way (i.e. from opener window to tool frame)
145
+ * Compare the origins of two URLs. Returns false if either value is not a valid URL.
146
+ * @private
147
+ * @param {string} sOriginA First URL string
148
+ * @param {string} sOriginB Second URL string
149
+ * @returns {boolean} true if both URLs have the same origin
150
+ */
151
+ WindowCommunicationBus._compareOrigins = function (sOriginA, sOriginB) {
152
+ try {
153
+ return new URL(sOriginA).origin === new URL(sOriginB).origin;
154
+ } catch (e) {
155
+ return false;
156
+ }
157
+ };
158
+
159
+ /**
160
+ * Validate messages received from external windows.
161
+ * Both directions are validated:
162
+ * - Tool frame: validates origin of messages from opener window
163
+ * - Application window: validates origin, frame identifier, and URL path of messages from tool frame
146
164
  * @private
147
165
  * @method
148
166
  * @param {EventListener} eMessage Event fired by the channels attached to the WindowCommunicationBus
149
167
  * @returns {boolean} true if the message is valid
150
168
  */
151
169
  WindowCommunicationBus.prototype._validate = function (eMessage) {
170
+ // 1. Validate origin
171
+ // tool frame: validate against the configured opener origin
152
172
  if (jQuery.isEmptyObject(this._frame)) {
153
- // there are no channels associated with this bus, or
154
- // when loaded in a tool frame, the CommumnicationBus class will always have an empty 'frame' object.
155
- // in this case, a message is sent from the opener to the tool frame and no validation is necessary
173
+ var sExpectedOrigin = this._oConfig.getOrigin();
174
+
175
+ if (sExpectedOrigin) {
176
+ return WindowCommunicationBus._compareOrigins(eMessage.origin, sExpectedOrigin);
177
+ }
178
+
156
179
  return true;
157
180
  }
158
181
 
159
- // when a message is sent from a tool frame to the application (opener) window,
160
- // the message should have the correct details, validating that it comes from a known tool frame
161
- var bMatchOrigin = eMessage.origin === this._frame.origin;
162
- var bMatchIdentifier = eMessage.data._frameIdentifier === this._frame.identifier;
163
- // remove relative paths (if the frame src is relative to the parent)
164
- var iFrameUrlQuery = this._frame.url.indexOf("?");
165
- var sFrameUrl = this._frame.url.substr(0, iFrameUrlQuery).replace(/\.\.\//g, "") + this._frame.url.substr(iFrameUrlQuery);
166
- var bMatchUrl = eMessage.data._origin.indexOf(sFrameUrl) > -1;
182
+ // application window: validate against the known tool frame origin
183
+ if (!WindowCommunicationBus._compareOrigins(eMessage.origin, this._frame.origin)) {
184
+ return false;
185
+ }
186
+
187
+ // 2. Validate frame identifier
188
+ if (eMessage.data._frameIdentifier !== this._frame.identifier) {
189
+ return false;
190
+ }
191
+
192
+ // 3. Validate URL path
193
+ // Compare parsed pathnames to avoid substring-matching attacks.
194
+ // The frame URL may be absolute or relative — strip query string and relative segments
195
+ // to extract the path portion, then verify the message origin's pathname ends with it.
196
+ try {
197
+ var oOriginUrl = new URL(eMessage.data._origin);
198
+ var iFrameUrlQuery = this._frame.url.indexOf("?");
199
+ var sFrameUrlWithoutQuery = this._frame.url.substring(0, iFrameUrlQuery).replace(/\.\.\//g, "").replace(/\.\//g, "");
200
+
201
+ // extract just the pathname: parse as URL if absolute, otherwise use the cleaned string as-is
202
+ var sFramePath;
203
+ try {
204
+ sFramePath = new URL(sFrameUrlWithoutQuery).pathname;
205
+ } catch (e) {
206
+ // relative URL — use cleaned string directly as a path suffix
207
+ sFramePath = sFrameUrlWithoutQuery;
208
+ }
209
+
210
+ if (!oOriginUrl.pathname.endsWith(sFramePath)) {
211
+ return false;
212
+ }
213
+ } catch (e) {
214
+ return false;
215
+ }
167
216
 
168
- return bMatchOrigin && bMatchIdentifier && bMatchUrl;
217
+ return true;
169
218
  };
170
219
 
171
220
  WindowCommunicationBus.prototype._getFrameIdentifier = function () {
@@ -780,9 +780,9 @@ sap.ui.define([
780
780
 
781
781
  checkFunctionString: function (functionString) {
782
782
  try {
783
- /* eslint-disable no-eval */
784
- eval("var testAsignedVar = " + functionString);
785
- /* eslint-enable no-eval */
783
+ /* eslint-disable no-new-func */
784
+ new Function("return (" + functionString + ")");
785
+ /* eslint-enable no-new-func */
786
786
  } catch (err) {
787
787
  MessageToast.show("Your check function contains errors, and can't be evaluated:" + err);
788
788
  return false;
@@ -89,7 +89,7 @@ sap.ui.define([
89
89
  *
90
90
  * @extends sap.ui.support.supportRules.ui.controllers.BaseController
91
91
  * @author SAP SE
92
- * @version 1.84.56
92
+ * @version 1.84.57
93
93
  * @private
94
94
  * @alias sap.ui.support.supportRules.ui.controllers.PresetsController
95
95
  */