Skip to content

Commit 1ddb097

Browse files
committed
Fix utils unit test for previous rm of taint step as class
1 parent 73a9c5b commit 1ddb097

File tree

4 files changed

+1
-22
lines changed

4 files changed

+1
-22
lines changed

javascript/frameworks/cap/lib/advanced_security/javascript/frameworks/cap/CAPPathInjectionQuery.qll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ abstract class UtilsControlledPathSink extends UtilsSink {
2323
override string sinkType() { result = "unrestricted file operations" }
2424
}
2525

26-
abstract class UtilsExtraFlow extends DataFlow::Node { }
27-
2826
/**
2927
* This represents the data in calls as follows:
3028
* ```javascript

javascript/frameworks/cap/test/models/cds/utils/utils.expected

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
| utils.js:5:21:5:30 | "%E0%A4%A" | "%E0%A4%A": additional flow step |
2-
| utils.js:7:31:7:40 | "%E0%A4%A" | "%E0%A4%A": additional flow step |
3-
| utils.js:9:18:9:27 | "%E0%A4%A" | "%E0%A4%A": additional flow step |
4-
| utils.js:13:17:13:21 | 'app' | 'app': additional flow step |
5-
| utils.js:15:19:15:32 | 'package.json' | 'package.json': additional flow step |
61
| utils.js:17:22:17:35 | 'package.json' | 'package.json': controlled path sink |
72
| utils.js:19:26:19:39 | 'package.json' | 'package.json': controlled path sink |
83
| utils.js:21:20:21:33 | 'package.json' | 'package.json': controlled path sink |

javascript/frameworks/cap/test/models/cds/utils/utils.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11
const cds = require("@sap/cds");
22

3-
const { decodeURI, decodeURIComponent, local, exists, isdir, isfile, read, readdir, append, write, copy, stat, find, mkdirp, rmdir, rimraf, rm } = cds.utils
4-
5-
let uri = decodeURI("%E0%A4%A") // taint step
6-
7-
let uri2 = decodeURIComponent("%E0%A4%A") // taint step
8-
9-
let uri3 = local("%E0%A4%A") // taint step
10-
11-
let uri4 = exists("%E0%A4%A") // NOT a taint step - returns a boolean
12-
13-
let dir = isdir('app') // taint step
14-
15-
let file = isfile('package.json') // taint step
3+
const { read, readdir, append, write, copy, stat, find, mkdirp, rmdir, rimraf, rm } = cds.utils
164

175
let pkg = await read('package.json') // sink
186

javascript/frameworks/cap/test/models/cds/utils/utils.ql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,4 @@ where
88
node.(UtilsAccessedPathSink).toString() = str and strfull = str + ": accessed path sink"
99
or
1010
node.(UtilsControlledDataSink).toString() = str and strfull = str + ": controlled data sink"
11-
or
12-
node.(UtilsExtraFlow).toString() = str and strfull = str + ": additional flow step"
1311
select node, strfull

0 commit comments

Comments
 (0)