Skip to content

Commit 014f5dd

Browse files
committed
Add log-entry-flows-to-remote
1 parent 25138f3 commit 014f5dd

File tree

11 files changed

+111
-0
lines changed

11 files changed

+111
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
nodes
2+
edges
3+
#select
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
UI5LogInjection/UI5LogInjection.ql

javascript/frameworks/ui5/test/queries/UI5LogInjection/log-entry-flows-to-remote/package-lock.json

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "sap-ui5-xss",
3+
"version": "1.0.0",
4+
"main": "index.js"
5+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
specVersion: '3.0'
2+
metadata:
3+
name: sap-ui5-xss
4+
type: application
5+
framework:
6+
name: SAPUI5
7+
version: "1.115.0"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
sap.ui.define(
2+
["sap/ui/core/mvc/Controller", "sap/ui/model/json/JSONModel"],
3+
function (Controller, JSONModel) {
4+
"use strict";
5+
return Controller.extend("codeql-sap-js.controller.app", {
6+
onInit: function () {
7+
var oData = {
8+
input: null,
9+
output: null,
10+
};
11+
var oModel = new JSONModel(oData);
12+
this.getView().setModel(oModel);
13+
14+
var input = oModel.getProperty("/input");
15+
16+
jQuery.sap.log.debug(input); //log-injection sink
17+
},
18+
});
19+
},
20+
);
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
<html>
3+
4+
<head>
5+
6+
<meta charset="utf-8">
7+
<title>SAPUI5 XSS</title>
8+
<script src="https://sdk.openui5.org/resources/sap-ui-core.js"
9+
data-sap-ui-libs="sap.m"
10+
data-sap-ui-onInit="module:codeql-sap-js/index"
11+
data-sap-ui-resourceroots='{
12+
"codeql-sap-js": "./"
13+
}'>
14+
</script>
15+
</head>
16+
17+
<body class="sapUiBody" id="content">
18+
19+
</body>
20+
21+
</html>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
sap.ui.define([
2+
"sap/ui/core/mvc/XMLView"
3+
], function (XMLView) {
4+
"use strict";
5+
XMLView.create({
6+
viewName: "codeql-sap-js.view.app"
7+
}).then(function (oView) {
8+
oView.placeAt("content");
9+
});
10+
11+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"sap.app": {
3+
"id": "sap-ui5-xss"
4+
}
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
sap.ui.define(
2+
["sap/ui/base/Object", "sap/base/Log"],
3+
function (BaseObject, Log) {
4+
"use strict";
5+
return BaseObject.extend("codeql-sap-js.log.CustomLogListener", {
6+
constructor: function () {
7+
Log.addLogListener(this);
8+
},
9+
onLogEntry: function (oEvent) {
10+
const http = new XMLHttpRequest();
11+
const url = "https://some.remote.server/location";
12+
http.open("POST", url);
13+
http.send(oEvent.message);
14+
},
15+
});
16+
},
17+
);

0 commit comments

Comments
 (0)