@openui5/sap.ui.support 1.108.48 → 1.108.50

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/THIRDPARTY.txt CHANGED
@@ -292,7 +292,7 @@ License: MIT
292
292
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/MIT.txt
293
293
  Contained in: src/sap.ui.core/src/sap/ui/thirdparty/bignumber.js
294
294
 
295
- Component: lodash, version: 4.17.21
295
+ Component: lodash, version: 4.17.23
296
296
  Copyright: OpenJS Foundation and other contributors
297
297
  License: MIT
298
298
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/MIT.txt
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openui5/sap.ui.support",
3
- "version": "1.108.48",
3
+ "version": "1.108.50",
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.108.48",
18
- "@openui5/sap.ui.codeeditor": "1.108.48",
19
- "@openui5/sap.ui.core": "1.108.48",
20
- "@openui5/sap.ui.fl": "1.108.48",
21
- "@openui5/sap.ui.layout": "1.108.48"
17
+ "@openui5/sap.m": "1.108.50",
18
+ "@openui5/sap.ui.codeeditor": "1.108.50",
19
+ "@openui5/sap.ui.core": "1.108.50",
20
+ "@openui5/sap.ui.fl": "1.108.50",
21
+ "@openui5/sap.ui.layout": "1.108.50"
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.108.48</version>
9
+ <version>1.108.50</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.108.48
35
+ * @version 1.108.50
36
36
  * @public
37
37
  */
38
38
  var RuleAnalyzer = {
@@ -35,7 +35,7 @@ sap.ui.define(["sap/ui/thirdparty/jquery",
35
35
  * @deprecated Since version 1.60.0. Please use sap/ui/support/RuleAnalyzer instead.
36
36
  * @alias jQuery.sap.support
37
37
  * @author SAP SE
38
- * @version 1.108.48
38
+ * @version 1.108.50
39
39
  * @public
40
40
  */
41
41
  jQuery.sap.support = {
@@ -23,7 +23,7 @@ sap.ui.define(["sap/ui/core/library"],
23
23
  * @namespace
24
24
  * @alias sap.ui.support
25
25
  * @author SAP SE
26
- * @version 1.108.48
26
+ * @version 1.108.50
27
27
  * @since 1.50
28
28
  * @public
29
29
  */
@@ -37,7 +37,7 @@ sap.ui.define(["sap/ui/core/library"],
37
37
  controls: [],
38
38
  elements: [],
39
39
  noLibraryCSS: true,
40
- version: "1.108.48",
40
+ version: "1.108.50",
41
41
  extensions: {
42
42
  //Configuration used for rule loading of Support Assistant
43
43
  "sap.ui.support": {
@@ -39,7 +39,7 @@ function (Log, Version, library, storage, constants) {
39
39
  * @name sap.ui.support.RuleSet
40
40
  * @memberof sap.ui.support
41
41
  * @author SAP SE
42
- * @version 1.108.48
42
+ * @version 1.108.50
43
43
  * @param {object} oSettings Name of the initiated
44
44
  * @returns {void}
45
45
  */
@@ -57,7 +57,7 @@ sap.ui.define([
57
57
  * @name sap.ui.support.Storage
58
58
  * @alias sap.ui.support.Storage
59
59
  * @author SAP SE.
60
- * @version 1.108.48
60
+ * @version 1.108.50
61
61
  * @private
62
62
  */
63
63
  return {
@@ -26,7 +26,7 @@ sap.ui.define([
26
26
  * @name sap.ui.support.WindowCommunicationBus
27
27
  * @memberof sap.ui.support
28
28
  * @author SAP SE
29
- * @version 1.108.48
29
+ * @version 1.108.50
30
30
  * @private
31
31
  */
32
32
  var WindowCommunicationBus = BaseObject.extend("sap.ui.support.supportRules.WindowCommunicationBus", {
@@ -142,38 +142,79 @@ sap.ui.define([
142
142
  };
143
143
 
144
144
  /**
145
- * validate messages published from external window to application window (i.e. from tool frame to opener window)
146
- * 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
147
164
  * @private
148
165
  * @method
149
166
  * @param {EventListener} eMessage Event fired by the channels attached to the WindowCommunicationBus
150
167
  * @returns {boolean} true if the message is valid
151
168
  */
152
169
  WindowCommunicationBus.prototype._validate = function (eMessage) {
170
+ // 1. Validate origin
171
+ // tool frame: validate against the configured opener origin
153
172
  if (isEmptyObject(this._frame)) {
154
- // there are no channels associated with this bus, or
155
- // when loaded in a tool frame, the CommumnicationBus class will always have an empty 'frame' object.
156
- // 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
+
157
179
  return true;
158
180
  }
159
181
 
160
- // when a message is sent from a tool frame to the application (opener) window,
161
- // the message should have the correct details, validating that it comes from a known tool frame
182
+ // application window: validate against the known tool frame origin
183
+ if (!WindowCommunicationBus._compareOrigins(eMessage.origin, this._frame.origin)) {
184
+ return false;
185
+ }
162
186
 
163
- // check if the frame ID (number represented as string) is the same
164
- var bMatchIdentifier = eMessage.data._frameIdentifier === this._frame.identifier;
187
+ // 2. Validate frame identifier
188
+ if (eMessage.data._frameIdentifier !== this._frame.identifier) {
189
+ return false;
190
+ }
165
191
 
166
- // check if the URL matches: 1. check if the domain name matches - should be case insensitive
167
- var oOriginRegExp = new RegExp("^" + this._frame.origin + "$", "i");
168
- var bMatchOrigin = oOriginRegExp.exec(eMessage.origin);
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
+ }
169
209
 
170
- // check if the URL matches: 2. check if the path to the iframe matches.
171
- // if the frame URL is relative to the parent window's URL, remove relative path segments
172
- var iFrameUrlQuery = this._frame.url.indexOf("?");
173
- var sFrameUrl = this._frame.url.substr(0, iFrameUrlQuery).replace(/\.\.\//g, "").replace(/\.\//g, "") + this._frame.url.substr(iFrameUrlQuery);
174
- var bMatchUrl = eMessage.data._origin.indexOf(sFrameUrl) > -1;
210
+ if (!oOriginUrl.pathname.endsWith(sFramePath)) {
211
+ return false;
212
+ }
213
+ } catch (e) {
214
+ return false;
215
+ }
175
216
 
176
- return bMatchIdentifier && bMatchOrigin && bMatchUrl;
217
+ return true;
177
218
  };
178
219
 
179
220
  WindowCommunicationBus.prototype._getFrameIdentifier = function () {
@@ -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.108.48
92
+ * @version 1.108.50
93
93
  * @private
94
94
  * @alias sap.ui.support.supportRules.ui.controllers.PresetsController
95
95
  */
@@ -1,4 +1,4 @@
1
- /* eslint-disable no-eval */
1
+ /* eslint-disable no-new-func */
2
2
 
3
3
  /*!
4
4
  * OpenUI5
@@ -11,9 +11,10 @@ sap.ui.define([], function () {
11
11
 
12
12
  var bIsEvalAllowed;
13
13
 
14
- // Checks if eval can be used in the current platform (based on CSP restrictions)
14
+ // Checks if the Function constructor can be used in the current platform (based on CSP restrictions)
15
15
  try {
16
- eval("");
16
+ // eslint-disable-next-line no-new
17
+ new Function("");
17
18
  bIsEvalAllowed = true;
18
19
  } catch (e) {
19
20
  bIsEvalAllowed = false;
@@ -34,11 +35,7 @@ sap.ui.define([], function () {
34
35
  * @throws Error why eval failed, for example invalid syntax
35
36
  */
36
37
  evalFunction: function (sFunction) {
37
- var fn;
38
-
39
- eval("fn = " + sFunction);
40
-
41
- return fn;
38
+ return new Function("return (" + sFunction + ")")();
42
39
  }
43
40
  };
44
- });
41
+ });