@openui5/sap.ui.support 1.145.1 → 1.145.2
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/package.json +6 -6
- package/src/sap/ui/support/.library +1 -1
- package/src/sap/ui/support/RuleAnalyzer.js +1 -1
- package/src/sap/ui/support/jQuery.sap.support.js +1 -1
- package/src/sap/ui/support/library.js +2 -2
- package/src/sap/ui/support/supportRules/RuleSet.js +1 -1
- package/src/sap/ui/support/supportRules/Storage.js +1 -1
- package/src/sap/ui/support/supportRules/WindowCommunicationBus.js +60 -19
- package/src/sap/ui/support/supportRules/ui/controllers/PresetsController.js +1 -1
- package/src/sap/ui/support/supportRules/util/EvalUtils.js +7 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openui5/sap.ui.support",
|
|
3
|
-
"version": "1.145.
|
|
3
|
+
"version": "1.145.2",
|
|
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/UI5/openui5.git"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@openui5/sap.m": "1.145.
|
|
18
|
-
"@openui5/sap.ui.codeeditor": "1.145.
|
|
19
|
-
"@openui5/sap.ui.core": "1.145.
|
|
20
|
-
"@openui5/sap.ui.fl": "1.145.
|
|
21
|
-
"@openui5/sap.ui.layout": "1.145.
|
|
17
|
+
"@openui5/sap.m": "1.145.2",
|
|
18
|
+
"@openui5/sap.ui.codeeditor": "1.145.2",
|
|
19
|
+
"@openui5/sap.ui.core": "1.145.2",
|
|
20
|
+
"@openui5/sap.ui.fl": "1.145.2",
|
|
21
|
+
"@openui5/sap.ui.layout": "1.145.2"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<copyright>OpenUI5
|
|
7
7
|
* (c) Copyright 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.145.
|
|
9
|
+
<version>1.145.2</version>
|
|
10
10
|
|
|
11
11
|
<documentation>UI5 library: sap.ui.support</documentation>
|
|
12
12
|
|
|
@@ -23,7 +23,7 @@ sap.ui.define(["sap/ui/core/Lib", "sap/ui/base/DataType", "sap/ui/core/library"]
|
|
|
23
23
|
* @namespace
|
|
24
24
|
* @alias sap.ui.support
|
|
25
25
|
* @author SAP SE
|
|
26
|
-
* @version 1.145.
|
|
26
|
+
* @version 1.145.2
|
|
27
27
|
* @since 1.50
|
|
28
28
|
* @public
|
|
29
29
|
*/
|
|
@@ -38,7 +38,7 @@ sap.ui.define(["sap/ui/core/Lib", "sap/ui/base/DataType", "sap/ui/core/library"]
|
|
|
38
38
|
controls: [],
|
|
39
39
|
elements: [],
|
|
40
40
|
noLibraryCSS: true,
|
|
41
|
-
version: "1.145.
|
|
41
|
+
version: "1.145.2",
|
|
42
42
|
extensions: {
|
|
43
43
|
//Configuration used for rule loading of Support Assistant
|
|
44
44
|
"sap.ui.support": {
|
|
@@ -24,7 +24,7 @@ sap.ui.define([
|
|
|
24
24
|
* @class
|
|
25
25
|
* @alias sap.ui.support.WindowCommunicationBus
|
|
26
26
|
* @author SAP SE
|
|
27
|
-
* @version 1.145.
|
|
27
|
+
* @version 1.145.2
|
|
28
28
|
* @private
|
|
29
29
|
*/
|
|
30
30
|
var WindowCommunicationBus = BaseObject.extend("sap.ui.support.supportRules.WindowCommunicationBus", {
|
|
@@ -127,37 +127,78 @@ sap.ui.define([
|
|
|
127
127
|
};
|
|
128
128
|
|
|
129
129
|
/**
|
|
130
|
-
*
|
|
131
|
-
*
|
|
130
|
+
* Compare the origins of two URLs. Returns false if either value is not a valid URL.
|
|
131
|
+
* @private
|
|
132
|
+
* @param {string} sOriginA First URL string
|
|
133
|
+
* @param {string} sOriginB Second URL string
|
|
134
|
+
* @returns {boolean} true if both URLs have the same origin
|
|
135
|
+
*/
|
|
136
|
+
WindowCommunicationBus._compareOrigins = function (sOriginA, sOriginB) {
|
|
137
|
+
try {
|
|
138
|
+
return new URL(sOriginA).origin === new URL(sOriginB).origin;
|
|
139
|
+
} catch (e) {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Validate messages received from external windows.
|
|
146
|
+
* Both directions are validated:
|
|
147
|
+
* - Tool frame: validates origin of messages from opener window
|
|
148
|
+
* - Application window: validates origin, frame identifier, and URL path of messages from tool frame
|
|
132
149
|
* @private
|
|
133
150
|
* @param {EventListener} eMessage Event fired by the channels attached to the WindowCommunicationBus
|
|
134
151
|
* @returns {boolean} true if the message is valid
|
|
135
152
|
*/
|
|
136
153
|
WindowCommunicationBus.prototype._validate = function (eMessage) {
|
|
154
|
+
// 1. Validate origin
|
|
155
|
+
// tool frame: validate against the configured opener origin
|
|
137
156
|
if (isEmptyObject(this._frame)) {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
157
|
+
const sExpectedOrigin = this._oConfig.getOrigin();
|
|
158
|
+
|
|
159
|
+
if (sExpectedOrigin) {
|
|
160
|
+
return WindowCommunicationBus._compareOrigins(eMessage.origin, sExpectedOrigin);
|
|
161
|
+
}
|
|
162
|
+
|
|
141
163
|
return true;
|
|
142
164
|
}
|
|
143
165
|
|
|
144
|
-
//
|
|
145
|
-
|
|
166
|
+
// application window: validate against the known tool frame origin
|
|
167
|
+
if (!WindowCommunicationBus._compareOrigins(eMessage.origin, this._frame.origin)) {
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
146
170
|
|
|
147
|
-
//
|
|
148
|
-
|
|
171
|
+
// 2. Validate frame identifier
|
|
172
|
+
if (eMessage.data._frameIdentifier !== this._frame.identifier) {
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
149
175
|
|
|
150
|
-
//
|
|
151
|
-
|
|
152
|
-
|
|
176
|
+
// 3. Validate URL path
|
|
177
|
+
// Compare parsed pathnames to avoid substring-matching attacks.
|
|
178
|
+
// The frame URL may be absolute or relative — strip query string and relative segments
|
|
179
|
+
// to extract the path portion, then verify the message origin's pathname ends with it.
|
|
180
|
+
try {
|
|
181
|
+
const oOriginUrl = new URL(eMessage.data._origin);
|
|
182
|
+
const iFrameUrlQuery = this._frame.url.indexOf("?");
|
|
183
|
+
const sFrameUrlWithoutQuery = this._frame.url.substring(0, iFrameUrlQuery).replace(/\.\.\//g, "").replace(/\.\//g, "");
|
|
184
|
+
|
|
185
|
+
// extract just the pathname: parse as URL if absolute, otherwise use the cleaned string as-is
|
|
186
|
+
let sFramePath;
|
|
187
|
+
try {
|
|
188
|
+
sFramePath = new URL(sFrameUrlWithoutQuery).pathname;
|
|
189
|
+
} catch (e) {
|
|
190
|
+
// relative URL — use cleaned string directly as a path suffix
|
|
191
|
+
sFramePath = sFrameUrlWithoutQuery;
|
|
192
|
+
}
|
|
153
193
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
194
|
+
if (!oOriginUrl.pathname.endsWith(sFramePath)) {
|
|
195
|
+
return false;
|
|
196
|
+
}
|
|
197
|
+
} catch (e) {
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
159
200
|
|
|
160
|
-
return
|
|
201
|
+
return true;
|
|
161
202
|
};
|
|
162
203
|
|
|
163
204
|
WindowCommunicationBus.prototype._getFrameIdentifier = function () {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* eslint-disable no-
|
|
1
|
+
/* eslint-disable no-new-func */
|
|
2
2
|
|
|
3
3
|
/*!
|
|
4
4
|
* OpenUI5
|
|
@@ -9,11 +9,12 @@
|
|
|
9
9
|
sap.ui.define([], function () {
|
|
10
10
|
"use strict";
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
let bIsEvalAllowed;
|
|
13
13
|
|
|
14
|
-
// Checks if
|
|
14
|
+
// Checks if the Function constructor can be used in the current platform (based on CSP restrictions)
|
|
15
15
|
try {
|
|
16
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
eval("fn = " + sFunction);
|
|
40
|
-
|
|
41
|
-
return fn;
|
|
38
|
+
return new Function("return (" + sFunction + ")")();
|
|
42
39
|
}
|
|
43
40
|
};
|
|
44
|
-
});
|
|
41
|
+
});
|