GeezerVison is showing github.com — Dataflow: Add empty provenance column to PathGraph. · github/codeql@b7d4a69
File treeExpand file treeCollapse file tree Open diff view settings cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal lib/semmle/code/csharp/security/dataflow src/experimental/Security Features/backdoor test/library-tests/cil/dataflow
java/ql/src/Security/CWE/CWE-200 shared/dataflow/codeql/dataflow
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/ProductFlow.qll +8-8Lines changed: 8 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -507,13 +507,13 @@ module ProductFlow { | 507 | 507 | private predicate pathSuccPlus(TNodePair n1, TNodePair n2) = fastTC(pathSucc/2)(n1, n2) | 508 | 508 |
| 509 | 509 | private predicate localPathStep1(Flow1::PathNode pred, Flow1::PathNode succ) { | 510 | | - Flow1::PathGraph::edges(pred, succ) and | | 510 | + Flow1::PathGraph::edges(pred, succ, _, _) and | 511 | 511 | pragma[only_bind_out](pred.getNode().getEnclosingCallable()) = | 512 | 512 | pragma[only_bind_out](succ.getNode().getEnclosingCallable()) | 513 | 513 | } | 514 | 514 |
| 515 | 515 | private predicate localPathStep2(Flow2::PathNode pred, Flow2::PathNode succ) { | 516 | | - Flow2::PathGraph::edges(pred, succ) and | | 516 | + Flow2::PathGraph::edges(pred, succ, _, _) and | 517 | 517 | pragma[only_bind_out](pred.getNode().getEnclosingCallable()) = | 518 | 518 | pragma[only_bind_out](succ.getNode().getEnclosingCallable()) | 519 | 519 | } | @@ -530,7 +530,7 @@ module ProductFlow { | 530 | 530 | TJump() | 531 | 531 |
| 532 | 532 | private predicate intoImpl1(Flow1::PathNode pred1, Flow1::PathNode succ1, DataFlowCall call) { | 533 | | - Flow1::PathGraph::edges(pred1, succ1) and | | 533 | + Flow1::PathGraph::edges(pred1, succ1, _, _) and | 534 | 534 | pred1.getNode().(ArgumentNode).getCall() = call and | 535 | 535 | succ1.getNode() instanceof ParameterNode | 536 | 536 | } | @@ -543,7 +543,7 @@ module ProductFlow { | 543 | 543 | } | 544 | 544 |
| 545 | 545 | private predicate outImpl1(Flow1::PathNode pred1, Flow1::PathNode succ1, DataFlowCall call) { | 546 | | - Flow1::PathGraph::edges(pred1, succ1) and | | 546 | + Flow1::PathGraph::edges(pred1, succ1, _, _) and | 547 | 547 | exists(ReturnKindExt returnKind | | 548 | 548 | succ1.getNode() = returnKind.getAnOutNode(call) and | 549 | 549 | pred1.getNode().(ReturnNodeExt).getKind() = returnKind | @@ -558,7 +558,7 @@ module ProductFlow { | 558 | 558 | } | 559 | 559 |
| 560 | 560 | private predicate intoImpl2(Flow2::PathNode pred2, Flow2::PathNode succ2, DataFlowCall call) { | 561 | | - Flow2::PathGraph::edges(pred2, succ2) and | | 561 | + Flow2::PathGraph::edges(pred2, succ2, _, _) and | 562 | 562 | pred2.getNode().(ArgumentNode).getCall() = call and | 563 | 563 | succ2.getNode() instanceof ParameterNode | 564 | 564 | } | @@ -571,7 +571,7 @@ module ProductFlow { | 571 | 571 | } | 572 | 572 |
| 573 | 573 | private predicate outImpl2(Flow2::PathNode pred2, Flow2::PathNode succ2, DataFlowCall call) { | 574 | | - Flow2::PathGraph::edges(pred2, succ2) and | | 574 | + Flow2::PathGraph::edges(pred2, succ2, _, _) and | 575 | 575 | exists(ReturnKindExt returnKind | | 576 | 576 | succ2.getNode() = returnKind.getAnOutNode(call) and | 577 | 577 | pred2.getNode().(ReturnNodeExt).getKind() = returnKind | @@ -590,7 +590,7 @@ module ProductFlow { | 590 | 590 | Declaration predDecl, Declaration succDecl, Flow1::PathNode pred1, Flow1::PathNode succ1, | 591 | 591 | TKind kind | 592 | 592 | ) { | 593 | | - Flow1::PathGraph::edges(pred1, succ1) and | | 593 | + Flow1::PathGraph::edges(pred1, succ1, _, _) and | 594 | 594 | predDecl != succDecl and | 595 | 595 | pred1.getNode().getEnclosingCallable() = predDecl and | 596 | 596 | succ1.getNode().getEnclosingCallable() = succDecl and | @@ -610,7 +610,7 @@ module ProductFlow { | 610 | 610 | Declaration predDecl, Declaration succDecl, Flow2::PathNode pred2, Flow2::PathNode succ2, | 611 | 611 | TKind kind | 612 | 612 | ) { | 613 | | - Flow2::PathGraph::edges(pred2, succ2) and | | 613 | + Flow2::PathGraph::edges(pred2, succ2, _, _) and | 614 | 614 | predDecl != succDecl and | 615 | 615 | pred2.getNode().getEnclosingCallable() = predDecl and | 616 | 616 | succ2.getNode().getEnclosingCallable() = succDecl and | |
Collapse file Copy file name to clipboardExpand all lines: csharp/ql/lib/semmle/code/csharp/security/dataflow/XSSQuery.qll +7-3Lines changed: 7 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -42,14 +42,18 @@ predicate xssFlow(XssNode source, XssNode sink, string message) { | 42 | 42 | */ | 43 | 43 | module PathGraph { | 44 | 44 | /** Holds if `(pred,succ)` is an edge in the graph of data flow path explanations. */ | 45 | | - query predicate edges(XssNode pred, XssNode succ) { | 46 | | - exists(XssTracking::PathNode a, XssTracking::PathNode b | XssTracking::PathGraph::edges(a, b) | | | 45 | + query predicate edges(XssNode pred, XssNode succ, string key, string val) { | | 46 | + exists(XssTracking::PathNode a, XssTracking::PathNode b | | | 47 | + XssTracking::PathGraph::edges(a, b, key, val) | | 48 | + | | 47 | 49 | pred.asDataFlowNode() = a and | 48 | 50 | succ.asDataFlowNode() = b | 49 | 51 | ) | 50 | 52 | or | 51 | 53 | xssFlow(pred, succ, _) and | 52 | | - pred instanceof XssAspNode | | 54 | + pred instanceof XssAspNode and | | 55 | + key = "provenance" and | | 56 | + val = "" | 53 | 57 | } | 54 | 58 |
| 55 | 59 | /** Holds if `n` is a node in the graph of data flow path explanations. */ | |
Collapse file Copy file name to clipboardExpand all lines: csharp/ql/src/experimental/Security Features/backdoor/PotentialTimeBomb.ql +8-4Lines changed: 8 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 13 | 13 | import csharp | 14 | 14 | import Flow::PathGraph | 15 | 15 |
| 16 | | -query predicate edges(Flow::PathNode a, Flow::PathNode b) { | 17 | | - Flow::PathGraph::edges(a, b) | | 16 | +query predicate edges(Flow::PathNode a, Flow::PathNode b, string key, string val) { | | 17 | + Flow::PathGraph::edges(a, b, key, val) | 18 | 18 | or | 19 | 19 | FlowsFromGetLastWriteTimeConfigToTimeSpanArithmeticCallableConfig::isSink(a.getNode()) and | 20 | | - FlowsFromTimeSpanArithmeticToTimeComparisonCallableConfig::isSource(b.getNode()) | | 20 | + FlowsFromTimeSpanArithmeticToTimeComparisonCallableConfig::isSource(b.getNode()) and | | 21 | + key = "provenance" and | | 22 | + val = "" | 21 | 23 | or | 22 | 24 | FlowsFromTimeSpanArithmeticToTimeComparisonCallableConfig::isSink(a.getNode()) and | 23 | | - FlowsFromTimeComparisonCallableToSelectionStatementConditionConfig::isSource(b.getNode()) | | 25 | + FlowsFromTimeComparisonCallableToSelectionStatementConditionConfig::isSource(b.getNode()) and | | 26 | + key = "provenance" and | | 27 | + val = "" | 24 | 28 | } | 25 | 29 |
| 26 | 30 | /** | |
Collapse file Copy file name to clipboardExpand all lines: csharp/ql/test/library-tests/cil/dataflow/DataFlow.ql +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -13,8 +13,8 @@ private predicate relevantPathNode(Flow::PathNode n) { | 13 | 13 | ) | 14 | 14 | } | 15 | 15 |
| 16 | | -query predicate edges(Flow::PathNode a, Flow::PathNode b) { | 17 | | - Flow::PathGraph::edges(a, b) and | | 16 | +query predicate edges(Flow::PathNode a, Flow::PathNode b, string key, string val) { | | 17 | + Flow::PathGraph::edges(a, b, key, val) and | 18 | 18 | relevantPathNode(a) and | 19 | 19 | relevantPathNode(b) | 20 | 20 | } | |
Collapse file Copy file name to clipboardExpand all lines: java/ql/src/Security/CWE/CWE-200/TempDirLocalInformationDisclosure.ql +5-1Lines changed: 5 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -25,7 +25,11 @@ import semmle.code.java.security.TempDirLocalInformationDisclosureQuery | 25 | 25 | * resulting in a zero-length paths. | 26 | 26 | */ | 27 | 27 | module InsecureMethodPathGraph implements DataFlow::PathGraphSig<MethodCallInsecureFileCreation> { | 28 | | - predicate edges(MethodCallInsecureFileCreation n1, MethodCallInsecureFileCreation n2) { none() } | | 28 | + predicate edges( | | 29 | + MethodCallInsecureFileCreation n1, MethodCallInsecureFileCreation n2, string key, string value | | 30 | + ) { | | 31 | + none() | | 32 | + } | 29 | 33 |
| 30 | 34 | predicate nodes(MethodCallInsecureFileCreation n, string key, string val) { | 31 | 35 | key = "semmle.label" and val = n.toString() | |
Collapse file Copy file name to clipboardExpand all lines: shared/dataflow/codeql/dataflow/DataFlow.qll +7-5Lines changed: 7 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -584,7 +584,7 @@ module DataFlowMake<InputSig Lang> { | 584 | 584 |
| 585 | 585 | signature module PathGraphSig<PathNodeSig PathNode> { | 586 | 586 | /** Holds if `(a,b)` is an edge in the graph of data flow path explanations. */ | 587 | | - predicate edges(PathNode a, PathNode b); | | 587 | + predicate edges(PathNode a, PathNode b, string key, string val); | 588 | 588 |
| 589 | 589 | /** Holds if `n` is a node in the graph of data flow path explanations. */ | 590 | 590 | predicate nodes(PathNode n, string key, string val); | @@ -648,9 +648,9 @@ module DataFlowMake<InputSig Lang> { | 648 | 648 | */ | 649 | 649 | module PathGraph implements PathGraphSig<PathNode> { | 650 | 650 | /** Holds if `(a,b)` is an edge in the graph of data flow path explanations. */ | 651 | | - query predicate edges(PathNode a, PathNode b) { | 652 | | - Graph1::edges(a.asPathNode1(), b.asPathNode1()) or | 653 | | - Graph2::edges(a.asPathNode2(), b.asPathNode2()) | | 651 | + query predicate edges(PathNode a, PathNode b, string key, string val) { | | 652 | + Graph1::edges(a.asPathNode1(), b.asPathNode1(), key, val) or | | 653 | + Graph2::edges(a.asPathNode2(), b.asPathNode2(), key, val) | 654 | 654 | } | 655 | 655 |
| 656 | 656 | /** Holds if `n` is a node in the graph of data flow path explanations. */ | @@ -719,7 +719,9 @@ module DataFlowMake<InputSig Lang> { | 719 | 719 | */ | 720 | 720 | module PathGraph implements PathGraphSig<PathNode> { | 721 | 721 | /** Holds if `(a,b)` is an edge in the graph of data flow path explanations. */ | 722 | | - query predicate edges(PathNode a, PathNode b) { Merged::PathGraph::edges(a, b) } | | 722 | + query predicate edges(PathNode a, PathNode b, string key, string val) { | | 723 | + Merged::PathGraph::edges(a, b, key, val) | | 724 | + } | 723 | 725 |
| 724 | 726 | /** Holds if `n` is a node in the graph of data flow path explanations. */ | 725 | 727 | query predicate nodes(PathNode n, string key, string val) { | |
Collapse file Copy file name to clipboardExpand all lines: shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll +5-1Lines changed: 5 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -3724,7 +3724,11 @@ module MakeImpl<InputSig Lang> { | 3724 | 3724 | */ | 3725 | 3725 | module PathGraph implements PathGraphSig<PathNode> { | 3726 | 3726 | /** Holds if `(a,b)` is an edge in the graph of data flow path explanations. */ | 3727 | | - query predicate edges(PathNode a, PathNode b) { a.getASuccessor() = b } | | 3727 | + query predicate edges(PathNode a, PathNode b, string key, string val) { | | 3728 | + a.getASuccessor() = b and | | 3729 | + key = "provenance" and | | 3730 | + val = "" | | 3731 | + } | 3728 | 3732 |
| 3729 | 3733 | /** Holds if `n` is a node in the graph of data flow path explanations. */ | 3730 | 3734 | query predicate nodes(PathNode n, string key, string val) { | |
|