-
Notifications
You must be signed in to change notification settings - Fork 3
Ensure sanitizeContent attribute is respected #257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mbaluda
wants to merge
15
commits into
main
Choose a base branch
from
mbaluda/sanitize-content
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
d52a0c7
Ensure sanitizeContent attribute is respected
mbaluda 1ec8bfa
Ensure sanitizeContent attribute is respected
mbaluda 0a7b668
Add more tests
mbaluda 6a00000
Exclude sanitized HTML views from XSS sinks
mbaluda 807ea34
Fix ql-4-ql alerts
mbaluda 02c4537
Fix workflow
mbaluda 235c441
Update expected file
mbaluda f108236
fix README
mbaluda ee49547
Address review comments
mbaluda 9b50447
Fix conflict
mbaluda ddf7a6e
Merge branch 'main' into mbaluda/sanitize-content
mbaluda 1a2c5cc
update expected sile
mbaluda 0929f6e
fix expected file
mbaluda 6baa2d7
Merge branch 'main' into mbaluda/sanitize-content
mbaluda 744bf21
Update javascript/frameworks/ui5/lib/advanced_security/javascript/fra…
mbaluda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
1 change: 1 addition & 0 deletions
1
javascript/frameworks/ui5/test/queries/UI5Xss/xss-html-control sanitized/UI5Xss.qlref
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| UI5Xss/UI5Xss.ql | ||
12 changes: 12 additions & 0 deletions
12
javascript/frameworks/ui5/test/queries/UI5Xss/xss-html-control sanitized/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
javascript/frameworks/ui5/test/queries/UI5Xss/xss-html-control sanitized/package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "name": "sap-ui5-xss", | ||
| "version": "1.0.0", | ||
| "main": "index.js" | ||
| } |
7 changes: 7 additions & 0 deletions
7
javascript/frameworks/ui5/test/queries/UI5Xss/xss-html-control sanitized/ui5.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| specVersion: '3.0' | ||
| metadata: | ||
| name: sap-ui5-xss | ||
| type: application | ||
| framework: | ||
| name: SAPUI5 | ||
| version: "1.115.0" |
15 changes: 15 additions & 0 deletions
15
...ks/ui5/test/queries/UI5Xss/xss-html-control sanitized/webapp/controller/app.controller.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| sap.ui.define([ | ||
| "sap/ui/core/mvc/Controller", | ||
| "sap/ui/model/json/JSONModel" | ||
| ], function (Controller, JSONModel) { | ||
| "use strict" | ||
| return Controller.extend("codeql-sap-js.controller.app", { | ||
| onInit: function () { | ||
| var oData = { | ||
| input: null | ||
| }; | ||
| var oModel = new JSONModel(oData); | ||
| this.getView().setModel(oModel); | ||
| } | ||
| }); | ||
| }) |
21 changes: 21 additions & 0 deletions
21
javascript/frameworks/ui5/test/queries/UI5Xss/xss-html-control sanitized/webapp/index.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
|
|
||
| <head> | ||
|
|
||
| <meta charset="utf-8"> | ||
| <title>SAPUI5 XSS</title> | ||
| <script src="https://sdk.openui5.org/resources/sap-ui-core.js" | ||
| data-sap-ui-libs="sap.m" | ||
| data-sap-ui-onInit="module:codeql-sap-js/index" | ||
| data-sap-ui-resourceroots='{ | ||
| "codeql-sap-js": "./" | ||
| }'> | ||
| </script> | ||
| </head> | ||
|
|
||
| <body class="sapUiBody" id="content"> | ||
|
|
||
| </body> | ||
|
|
||
| </html> |
11 changes: 11 additions & 0 deletions
11
javascript/frameworks/ui5/test/queries/UI5Xss/xss-html-control sanitized/webapp/index.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| sap.ui.define([ | ||
| "sap/ui/core/mvc/XMLView" | ||
| ], function (XMLView) { | ||
| "use strict"; | ||
| XMLView.create({ | ||
| viewName: "codeql-sap-js.view.app" | ||
| }).then(function (oView) { | ||
| oView.placeAt("content"); | ||
| }); | ||
|
|
||
| }); |
5 changes: 5 additions & 0 deletions
5
...script/frameworks/ui5/test/queries/UI5Xss/xss-html-control sanitized/webapp/manifest.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "sap.app": { | ||
| "id": "sap-ui5-xss" | ||
| } | ||
| } |
9 changes: 9 additions & 0 deletions
9
...pt/frameworks/ui5/test/queries/UI5Xss/xss-html-control sanitized/webapp/view/app.view.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <mvc:View controllerName="codeql-sap-js.controller.app" | ||
| xmlns="sap.m" | ||
| xmlns:core="sap.ui.core" | ||
| xmlns:mvc="sap.ui.core.mvc"> | ||
| <Input placeholder="Enter Payload" | ||
| description="Try: <img src=x onerror=alert("XSS")>" | ||
| value="{/input}" /> <!--User input source sap.m.Input.value --> | ||
| <core:HTML content="{/input}" sanitizeContent="true" /> <!-- sanitized XSS sink sap.ui.core.HTML.content --> | ||
| </mvc:View> |
24 changes: 24 additions & 0 deletions
24
.../frameworks/ui5/test/queries/UI5Xss/xss-html-control-df sanitized-disable/UI5Xss.expected
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| nodes | ||
| | webapp/controller/app.controller.js:9:17:9:27 | input: null | | ||
| | webapp/controller/app.controller.js:10:17:10:28 | output: null | | ||
| | webapp/controller/app.controller.js:12:26:12:45 | new JSONModel(oData) | | ||
| | webapp/controller/app.controller.js:15:17:15:21 | input | | ||
| | webapp/controller/app.controller.js:15:25:15:52 | oModel. ... input') | | ||
| | webapp/controller/app.controller.js:16:43:16:47 | input | | ||
| | webapp/view/app.view.xml:5:5:7:28 | value={/input} | | ||
| | webapp/view/app.view.xml:8:5:8:37 | content={/output} | | ||
| edges | ||
| | webapp/controller/app.controller.js:9:17:9:27 | input: null | webapp/controller/app.controller.js:15:25:15:52 | oModel. ... input') | | ||
| | webapp/controller/app.controller.js:9:17:9:27 | input: null | webapp/view/app.view.xml:5:5:7:28 | value={/input} | | ||
| | webapp/controller/app.controller.js:10:17:10:28 | output: null | webapp/view/app.view.xml:8:5:8:37 | content={/output} | | ||
| | webapp/controller/app.controller.js:12:26:12:45 | new JSONModel(oData) | webapp/controller/app.controller.js:15:25:15:52 | oModel. ... input') | | ||
| | webapp/controller/app.controller.js:12:26:12:45 | new JSONModel(oData) | webapp/view/app.view.xml:8:5:8:37 | content={/output} | | ||
| | webapp/controller/app.controller.js:15:17:15:21 | input | webapp/controller/app.controller.js:16:43:16:47 | input | | ||
| | webapp/controller/app.controller.js:15:25:15:52 | oModel. ... input') | webapp/controller/app.controller.js:15:17:15:21 | input | | ||
| | webapp/controller/app.controller.js:16:43:16:47 | input | webapp/controller/app.controller.js:10:17:10:28 | output: null | | ||
| | webapp/controller/app.controller.js:16:43:16:47 | input | webapp/controller/app.controller.js:12:26:12:45 | new JSONModel(oData) | | ||
| | webapp/view/app.view.xml:5:5:7:28 | value={/input} | webapp/controller/app.controller.js:9:17:9:27 | input: null | | ||
| | webapp/view/app.view.xml:5:5:7:28 | value={/input} | webapp/controller/app.controller.js:12:26:12:45 | new JSONModel(oData) | | ||
| | webapp/view/app.view.xml:8:5:8:37 | content={/output} | webapp/controller/app.controller.js:10:17:10:28 | output: null | | ||
| #select | ||
| | webapp/view/app.view.xml:8:5:8:37 | content={/output} | webapp/view/app.view.xml:5:5:7:28 | value={/input} | webapp/view/app.view.xml:8:5:8:37 | content={/output} | XSS vulnerability due to $@. | webapp/view/app.view.xml:5:5:7:28 | value={/input} | user-provided value | |
1 change: 1 addition & 0 deletions
1
...ipt/frameworks/ui5/test/queries/UI5Xss/xss-html-control-df sanitized-disable/UI5Xss.qlref
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| UI5Xss/UI5Xss.ql | ||
|
||
12 changes: 12 additions & 0 deletions
12
...rameworks/ui5/test/queries/UI5Xss/xss-html-control-df sanitized-disable/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
...ipt/frameworks/ui5/test/queries/UI5Xss/xss-html-control-df sanitized-disable/package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "name": "sap-ui5-xss", | ||
| "version": "1.0.0", | ||
| "main": "index.js" | ||
| } |
7 changes: 7 additions & 0 deletions
7
javascript/frameworks/ui5/test/queries/UI5Xss/xss-html-control-df sanitized-disable/ui5.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| specVersion: '3.0' | ||
| metadata: | ||
| name: sap-ui5-xss | ||
| type: application | ||
| framework: | ||
| name: SAPUI5 | ||
| version: "1.115.0" |
25 changes: 25 additions & 0 deletions
25
.../queries/UI5Xss/xss-html-control-df sanitized-disable/webapp/controller/app.controller.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| sap.ui.define([ | ||
| "sap/ui/core/mvc/Controller", | ||
| "sap/ui/model/json/JSONModel" | ||
| ], function (Controller, JSONModel) { | ||
| "use strict"; | ||
| return Controller.extend("codeql-sap-js.controller.app", { | ||
| onInit: function () { | ||
| var oData = { | ||
| input: null, | ||
| output: null, | ||
| }; | ||
| var oModel = new JSONModel(oData); | ||
| this.getView().setModel(oModel); | ||
|
|
||
| // enable sanitization programmatically | ||
| this.getView().setProperty("sanitizeContent", false); | ||
| this.getView().byId("htmlControl").setProperty("sanitizeContent", false); | ||
| this.getView().byId("htmlControl").sanitizeContent = false; | ||
|
|
||
| var input = oModel.getProperty('/input'); | ||
| oModel.setProperty('/output', input); | ||
| } | ||
| }); | ||
| } | ||
| ); |
21 changes: 21 additions & 0 deletions
21
...rameworks/ui5/test/queries/UI5Xss/xss-html-control-df sanitized-disable/webapp/index.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
|
|
||
| <head> | ||
|
|
||
| <meta charset="utf-8"> | ||
| <title>SAPUI5 XSS</title> | ||
| <script src="https://sdk.openui5.org/resources/sap-ui-core.js" | ||
| data-sap-ui-libs="sap.m" | ||
| data-sap-ui-onInit="module:codeql-sap-js/index" | ||
| data-sap-ui-resourceroots='{ | ||
| "codeql-sap-js": "./" | ||
| }'> | ||
| </script> | ||
| </head> | ||
|
|
||
| <body class="sapUiBody" id="content"> | ||
|
|
||
| </body> | ||
|
|
||
| </html> |
11 changes: 11 additions & 0 deletions
11
.../frameworks/ui5/test/queries/UI5Xss/xss-html-control-df sanitized-disable/webapp/index.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| sap.ui.define([ | ||
| "sap/ui/core/mvc/XMLView" | ||
| ], function (XMLView) { | ||
| "use strict"; | ||
| XMLView.create({ | ||
| viewName: "codeql-sap-js.view.app" | ||
| }).then(function (oView) { | ||
| oView.placeAt("content"); | ||
| }); | ||
|
|
||
| }); |
5 changes: 5 additions & 0 deletions
5
...eworks/ui5/test/queries/UI5Xss/xss-html-control-df sanitized-disable/webapp/manifest.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "sap.app": { | ||
| "id": "sap-ui5-xss" | ||
| } | ||
| } |
9 changes: 9 additions & 0 deletions
9
...ks/ui5/test/queries/UI5Xss/xss-html-control-df sanitized-disable/webapp/view/app.view.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <mvc:View controllerName="codeql-sap-js.controller.app" | ||
| xmlns="sap.m" | ||
| xmlns:core="sap.ui.core" | ||
| xmlns:mvc="sap.ui.core.mvc"> | ||
| <Input placeholder="Enter Payload" | ||
| description="Try: <img src=x onerror=alert("XSS")>" | ||
| value="{/input}" /> <!--User input source sap.m.Input.value --> | ||
| <core:HTML id="htmlControl" content="{/output}" sanitizeContent="true" /> <!--XSS sink sap.ui.core.HTML.content --> | ||
| </mvc:View> |
24 changes: 24 additions & 0 deletions
24
javascript/frameworks/ui5/test/queries/UI5Xss/xss-html-control-df sanitized/UI5Xss.expected
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| nodes | ||
| | webapp/controller/app.controller.js:9:17:9:27 | input: null | | ||
| | webapp/controller/app.controller.js:10:17:10:28 | output: null | | ||
| | webapp/controller/app.controller.js:12:26:12:45 | new JSONModel(oData) | | ||
| | webapp/controller/app.controller.js:15:17:15:21 | input | | ||
| | webapp/controller/app.controller.js:15:25:15:52 | oModel. ... input') | | ||
| | webapp/controller/app.controller.js:16:43:16:47 | input | | ||
| | webapp/view/app.view.xml:5:5:7:28 | value={/input} | | ||
| | webapp/view/app.view.xml:8:5:8:37 | content={/output} | | ||
| edges | ||
| | webapp/controller/app.controller.js:9:17:9:27 | input: null | webapp/controller/app.controller.js:15:25:15:52 | oModel. ... input') | | ||
| | webapp/controller/app.controller.js:9:17:9:27 | input: null | webapp/view/app.view.xml:5:5:7:28 | value={/input} | | ||
| | webapp/controller/app.controller.js:10:17:10:28 | output: null | webapp/view/app.view.xml:8:5:8:37 | content={/output} | | ||
| | webapp/controller/app.controller.js:12:26:12:45 | new JSONModel(oData) | webapp/controller/app.controller.js:15:25:15:52 | oModel. ... input') | | ||
| | webapp/controller/app.controller.js:12:26:12:45 | new JSONModel(oData) | webapp/view/app.view.xml:8:5:8:37 | content={/output} | | ||
| | webapp/controller/app.controller.js:15:17:15:21 | input | webapp/controller/app.controller.js:16:43:16:47 | input | | ||
| | webapp/controller/app.controller.js:15:25:15:52 | oModel. ... input') | webapp/controller/app.controller.js:15:17:15:21 | input | | ||
| | webapp/controller/app.controller.js:16:43:16:47 | input | webapp/controller/app.controller.js:10:17:10:28 | output: null | | ||
| | webapp/controller/app.controller.js:16:43:16:47 | input | webapp/controller/app.controller.js:12:26:12:45 | new JSONModel(oData) | | ||
| | webapp/view/app.view.xml:5:5:7:28 | value={/input} | webapp/controller/app.controller.js:9:17:9:27 | input: null | | ||
| | webapp/view/app.view.xml:5:5:7:28 | value={/input} | webapp/controller/app.controller.js:12:26:12:45 | new JSONModel(oData) | | ||
| | webapp/view/app.view.xml:8:5:8:37 | content={/output} | webapp/controller/app.controller.js:10:17:10:28 | output: null | | ||
| #select | ||
| | webapp/view/app.view.xml:8:5:8:37 | content={/output} | webapp/view/app.view.xml:5:5:7:28 | value={/input} | webapp/view/app.view.xml:8:5:8:37 | content={/output} | XSS vulnerability due to $@. | webapp/view/app.view.xml:5:5:7:28 | value={/input} | user-provided value | |
1 change: 1 addition & 0 deletions
1
javascript/frameworks/ui5/test/queries/UI5Xss/xss-html-control-df sanitized/UI5Xss.qlref
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| UI5Xss/UI5Xss.ql | ||
|
||
12 changes: 12 additions & 0 deletions
12
...script/frameworks/ui5/test/queries/UI5Xss/xss-html-control-df sanitized/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
javascript/frameworks/ui5/test/queries/UI5Xss/xss-html-control-df sanitized/package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "name": "sap-ui5-xss", | ||
| "version": "1.0.0", | ||
| "main": "index.js" | ||
| } |
7 changes: 7 additions & 0 deletions
7
javascript/frameworks/ui5/test/queries/UI5Xss/xss-html-control-df sanitized/ui5.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| specVersion: '3.0' | ||
| metadata: | ||
| name: sap-ui5-xss | ||
| type: application | ||
| framework: | ||
| name: SAPUI5 | ||
| version: "1.115.0" |
25 changes: 25 additions & 0 deletions
25
...ui5/test/queries/UI5Xss/xss-html-control-df sanitized/webapp/controller/app.controller.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| sap.ui.define([ | ||
| "sap/ui/core/mvc/Controller", | ||
| "sap/ui/model/json/JSONModel" | ||
| ], function (Controller, JSONModel) { | ||
| "use strict"; | ||
| return Controller.extend("codeql-sap-js.controller.app", { | ||
| onInit: function () { | ||
| var oData = { | ||
| input: null, | ||
| output: null, | ||
| }; | ||
| var oModel = new JSONModel(oData); | ||
| this.getView().setModel(oModel); | ||
|
|
||
| // enable sanitization programmatically | ||
| //this.getView().setProperty("sanitizeContent", true); | ||
| this.getView().byId("htmlControl").setProperty("sanitizeContent", true); | ||
| this.getView().byId("htmlControl").sanitizeContent = true; | ||
|
|
||
| var input = oModel.getProperty('/input'); | ||
| oModel.setProperty('/output', input); | ||
| } | ||
| }); | ||
| } | ||
| ); |
21 changes: 21 additions & 0 deletions
21
...script/frameworks/ui5/test/queries/UI5Xss/xss-html-control-df sanitized/webapp/index.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
|
|
||
| <head> | ||
|
|
||
| <meta charset="utf-8"> | ||
| <title>SAPUI5 XSS</title> | ||
| <script src="https://sdk.openui5.org/resources/sap-ui-core.js" | ||
| data-sap-ui-libs="sap.m" | ||
| data-sap-ui-onInit="module:codeql-sap-js/index" | ||
| data-sap-ui-resourceroots='{ | ||
| "codeql-sap-js": "./" | ||
| }'> | ||
| </script> | ||
| </head> | ||
|
|
||
| <body class="sapUiBody" id="content"> | ||
|
|
||
| </body> | ||
|
|
||
| </html> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.