mirror of
https://github.com/github/codeql.git
synced 2026-04-24 16:25:15 +02:00
JS: Add isTypeUsed to avoid overpruning
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
consistencyIssue
|
||||
| library-tests/frameworks/data/test.js:261 | expected an alert, but found none | NOT OK | |
|
||||
taintFlow
|
||||
| paramDecorator.ts:6:54:6:54 | x | paramDecorator.ts:7:10:7:10 | x |
|
||||
| test.js:5:30:5:37 | source() | test.js:5:8:5:38 | testlib ... urce()) |
|
||||
@@ -80,6 +79,7 @@ taintFlow
|
||||
| test.js:269:10:269:31 | this.ba ... ource() | test.js:269:10:269:31 | this.ba ... ource() |
|
||||
| test.js:272:6:272:40 | new MyS ... ource() | test.js:272:6:272:40 | new MyS ... ource() |
|
||||
| test.js:274:6:274:39 | testlib ... eName() | test.js:274:6:274:39 | testlib ... eName() |
|
||||
| test.js:277:8:277:31 | "danger ... .danger | test.js:277:8:277:31 | "danger ... .danger |
|
||||
isSink
|
||||
| test.js:54:18:54:25 | source() | test-sink |
|
||||
| test.js:55:22:55:29 | source() | test-sink |
|
||||
|
||||
@@ -11,6 +11,7 @@ extensions:
|
||||
- ['testlib', 'Member[ParamDecoratorSource].DecoratedParameter', 'test-source']
|
||||
- ['testlib', 'Member[getSource].ReturnValue', 'test-source']
|
||||
- ['(testlib)', 'Member[parenthesizedPackageName].ReturnValue', 'test-source']
|
||||
- ['danger-constant', 'Member[danger]', 'test-source']
|
||||
|
||||
- addsTo:
|
||||
pack: codeql/javascript-all
|
||||
|
||||
@@ -3,16 +3,14 @@ import testUtilities.ConsistencyChecking
|
||||
import semmle.javascript.frameworks.data.internal.ApiGraphModels as ApiGraphModels
|
||||
|
||||
class TypeModelFromCodeQL extends ModelInput::TypeModel {
|
||||
override predicate isTypeUsed(string type) { type = "danger-constant" }
|
||||
|
||||
override DataFlow::Node getASource(string type) {
|
||||
type = "danger-constant" and
|
||||
result.getStringValue() = "danger-constant"
|
||||
}
|
||||
}
|
||||
|
||||
class SourceFromDangerConstant extends ModelInput::SourceModelCsv {
|
||||
override predicate row(string row) { row = "danger-constant;Member[danger];test-source" }
|
||||
}
|
||||
|
||||
class BasicTaintTracking extends TaintTracking::Configuration {
|
||||
BasicTaintTracking() { this = "BasicTaintTracking" }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user