Skip to content

Commit a12eca8

Browse files
committed
Replace DataFlow::PathGraph with UI5PathGraph
1 parent 2c7b6e3 commit a12eca8

File tree

2 files changed

+21
-20
lines changed

2 files changed

+21
-20
lines changed

javascript/frameworks/ui5/src/UI5LogInjection/UI5LogsToHttp.ql

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import javascript
1515
import advanced_security.javascript.frameworks.ui5.dataflow.DataFlow
1616
import semmle.javascript.frameworks.data.internal.ApiGraphModels
1717
import advanced_security.javascript.frameworks.ui5.UI5LogInjectionQuery
18+
import advanced_security.javascript.frameworks.ui5.dataflow.DataFlow::UI5PathGraph
1819

1920
class ClientRequestInjectionVector extends DataFlow::Node {
2021
ClientRequestInjectionVector() {
@@ -84,9 +85,9 @@ module UI5LogEntryToHttp implements DataFlow::ConfigSig {
8485
predicate isSink(DataFlow::Node node) { node instanceof ClientRequestInjectionVector }
8586
}
8687

87-
import DataFlow::PathGraph
88-
89-
from UI5LogEntryToHttp cfg, DataFlow::PathNode source, DataFlow::PathNode sink
90-
where cfg.hasFlowPath(source, sink)
91-
select sink, source, sink, "Outbound network request depends on $@ log data.", source,
88+
from UI5LogEntryToHttp cfg, UI5PathNode source, UI5PathNode sink, UI5PathNode primarySource
89+
where
90+
cfg.hasFlowPath(source.getPathNode(), sink.getPathNode()) and
91+
primarySource = source.getAPrimarySource()
92+
select sink, primarySource, sink, "Outbound network request depends on $@ log data.", primarySource,
9293
"user-provided"
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
WARNING: type 'LogInjectionConfiguration' has been deprecated and may be removed in future (UI5UnsafeLogAccess.ql:18,44-83)
22
nodes
3-
| webapp/controller/app.controller.js:8:11:8:21 | input: null |
4-
| webapp/controller/app.controller.js:14:13:14:48 | input |
5-
| webapp/controller/app.controller.js:14:21:14:48 | oModel. ... input") |
6-
| webapp/controller/app.controller.js:15:30:15:34 | input |
3+
| webapp/controller/app.controller.js:11:11:11:21 | input: null |
4+
| webapp/controller/app.controller.js:17:13:17:48 | input |
5+
| webapp/controller/app.controller.js:17:21:17:48 | oModel. ... input") |
6+
| webapp/controller/app.controller.js:18:30:18:34 | input |
77
| webapp/view/app.view.xml:5:5:7:28 | value={/input} |
88
| webapp/view/app.view.xml:8:5:8:37 | content={/output} |
99
edges
10-
| webapp/controller/app.controller.js:8:11:8:21 | input: null | webapp/controller/app.controller.js:14:21:14:48 | oModel. ... input") |
11-
| webapp/controller/app.controller.js:8:11:8:21 | input: null | webapp/view/app.view.xml:5:5:7:28 | value={/input} |
12-
| webapp/controller/app.controller.js:9:11:9:22 | output: null | webapp/view/app.view.xml:8:5:8:37 | content={/output} |
13-
| webapp/controller/app.controller.js:11:22:11:41 | new JSONModel(oData) | webapp/view/app.view.xml:8:5:8:37 | content={/output} |
14-
| webapp/controller/app.controller.js:14:13:14:48 | input | webapp/controller/app.controller.js:15:30:15:34 | input |
15-
| webapp/controller/app.controller.js:14:21:14:48 | oModel. ... input") | webapp/controller/app.controller.js:14:13:14:48 | input |
16-
| webapp/view/app.view.xml:5:5:7:28 | value={/input} | webapp/controller/app.controller.js:8:11:8:21 | input: null |
17-
| webapp/view/app.view.xml:5:5:7:28 | value={/input} | webapp/controller/app.controller.js:11:22:11:41 | new JSONModel(oData) |
18-
| webapp/view/app.view.xml:8:5:8:37 | content={/output} | webapp/controller/app.controller.js:9:11:9:22 | output: null |
10+
| webapp/controller/app.controller.js:11:11:11:21 | input: null | webapp/controller/app.controller.js:17:21:17:48 | oModel. ... input") |
11+
| webapp/controller/app.controller.js:11:11:11:21 | input: null | webapp/view/app.view.xml:5:5:7:28 | value={/input} |
12+
| webapp/controller/app.controller.js:12:11:12:22 | output: null | webapp/view/app.view.xml:8:5:8:37 | content={/output} |
13+
| webapp/controller/app.controller.js:14:22:14:41 | new JSONModel(oData) | webapp/view/app.view.xml:8:5:8:37 | content={/output} |
14+
| webapp/controller/app.controller.js:17:13:17:48 | input | webapp/controller/app.controller.js:18:30:18:34 | input |
15+
| webapp/controller/app.controller.js:17:21:17:48 | oModel. ... input") | webapp/controller/app.controller.js:17:13:17:48 | input |
16+
| webapp/view/app.view.xml:5:5:7:28 | value={/input} | webapp/controller/app.controller.js:11:11:11:21 | input: null |
17+
| webapp/view/app.view.xml:5:5:7:28 | value={/input} | webapp/controller/app.controller.js:14:22:14:41 | new JSONModel(oData) |
18+
| webapp/view/app.view.xml:8:5:8:37 | content={/output} | webapp/controller/app.controller.js:12:11:12:22 | output: null |
1919
#select
20-
| webapp/utils/CustomLogListener.js:9:29:9:34 | oEvent | webapp/view/app.view.xml:5:5:7:28 | value={/input} | webapp/controller/app.controller.js:15:30:15:34 | input | Accessed log entries depend on $@. | webapp/view/app.view.xml:5:5:7:28 | value={/input} | user-provided data |
21-
| webapp/utils/LogEntriesToHttp.js:7:23:7:41 | Log.getLogEntries() | webapp/view/app.view.xml:5:5:7:28 | value={/input} | webapp/controller/app.controller.js:15:30:15:34 | input | Accessed log entries depend on $@. | webapp/view/app.view.xml:5:5:7:28 | value={/input} | user-provided data |
20+
| webapp/utils/CustomLogListener.js:9:29:9:34 | oEvent | webapp/view/app.view.xml:5:5:7:28 | value={/input} | webapp/controller/app.controller.js:18:30:18:34 | input | Accessed log entries depend on $@. | webapp/view/app.view.xml:5:5:7:28 | value={/input} | user-provided data |
21+
| webapp/utils/LogEntriesToHttp.js:7:23:7:41 | Log.getLogEntries() | webapp/view/app.view.xml:5:5:7:28 | value={/input} | webapp/controller/app.controller.js:18:30:18:34 | input | Accessed log entries depend on $@. | webapp/view/app.view.xml:5:5:7:28 | value={/input} | user-provided data |

0 commit comments

Comments
 (0)