File tree Expand file tree Collapse file tree
javascript/ql/test/library-tests/TaintTracking Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,7 +73,8 @@ typeInferenceMismatch
7373| nested-props.js:43:13:43:20 | source() | nested-props.js:44:10:44:18 | id(obj).x |
7474| nested-props.js:67:31:67:38 | source() | nested-props.js:68:10:68:10 | x |
7575| nested-props.js:77:36:77:43 | source() | nested-props.js:78:10:78:10 | x |
76- | object-bypass-sanitizer.js:13:13:13:20 | source() | object-bypass-sanitizer.js:6:14:6:18 | x.foo |
76+ | object-bypass-sanitizer.js:23:13:23:20 | source() | object-bypass-sanitizer.js:12:14:12:18 | x.foo |
77+ | object-bypass-sanitizer.js:23:13:23:20 | source() | object-bypass-sanitizer.js:17:10:17:28 | sanitizer_id(x).foo |
7778| partialCalls.js:4:17:4:24 | source() | partialCalls.js:17:14:17:14 | x |
7879| partialCalls.js:4:17:4:24 | source() | partialCalls.js:20:14:20:14 | y |
7980| partialCalls.js:4:17:4:24 | source() | partialCalls.js:30:14:30:20 | x.value |
Original file line number Diff line number Diff line change @@ -33,6 +33,10 @@ class BasicConfig extends TaintTracking::Configuration {
3333 node instanceof UntaintableNode
3434 }
3535
36+ override predicate isSanitizer ( DataFlow:: Node node ) {
37+ node .( DataFlow:: InvokeNode ) .getCalleeName ( ) .matches ( "sanitizer_%" )
38+ }
39+
3640 override predicate isSanitizerGuard ( TaintTracking:: SanitizerGuardNode node ) {
3741 node instanceof BasicSanitizerGuard
3842 }
Original file line number Diff line number Diff line change 4747| nested-props.js:35:13:35:20 | source() | nested-props.js:36:10:36:20 | doLoad(obj) |
4848| nested-props.js:43:13:43:20 | source() | nested-props.js:44:10:44:18 | id(obj).x |
4949| nested-props.js:67:31:67:38 | source() | nested-props.js:68:10:68:10 | x |
50+ | object-bypass-sanitizer.js:21:7:21:14 | source() | object-bypass-sanitizer.js:15:10:15:24 | sanitizer_id(x) |
51+ | object-bypass-sanitizer.js:23:13:23:20 | source() | object-bypass-sanitizer.js:16:10:16:28 | sanitizer_id(x.foo) |
52+ | object-bypass-sanitizer.js:23:13:23:20 | source() | object-bypass-sanitizer.js:17:10:17:28 | sanitizer_id(x).foo |
5053| partialCalls.js:4:17:4:24 | source() | partialCalls.js:17:14:17:14 | x |
5154| partialCalls.js:4:17:4:24 | source() | partialCalls.js:20:14:20:14 | y |
5255| partialCalls.js:4:17:4:24 | source() | partialCalls.js:30:14:30:20 | x.value |
Original file line number Diff line number Diff line change 11import * as dummy from 'dummy' ;
22
3+ function sanitizer_id ( x ) {
4+ if ( really_complicated_reason ( x ) )
5+ return x ;
6+ return null ;
7+ }
8+
39function f ( x ) {
410 if ( isSafe ( x ) ) {
511 sink ( x ) ;
612 sink ( x . foo ) ; // NOT OK
713 }
14+
15+ sink ( sanitizer_id ( x ) ) ; // OK
16+ sink ( sanitizer_id ( x . foo ) ) ; // OK
17+ sink ( sanitizer_id ( x ) . foo ) ; // NOT OK
818}
919
1020function g ( ) {
You can’t perform that action at this time.
0 commit comments