|
1 | 1 | /** Provides classes and predicates related to handling APIs for the VS Code extension. */ |
2 | 2 |
|
3 | 3 | private import java |
4 | | -private import semmle.code.java.dataflow.DataFlow |
5 | 4 | private import semmle.code.java.dataflow.ExternalFlow |
6 | | -private import semmle.code.java.dataflow.FlowSources |
7 | 5 | private import semmle.code.java.dataflow.FlowSummary |
8 | | -private import semmle.code.java.dataflow.internal.DataFlowPrivate |
9 | | -private import semmle.code.java.dataflow.internal.FlowSummaryImpl as FlowSummaryImpl |
10 | 6 | private import semmle.code.java.dataflow.TaintTracking |
11 | 7 | private import semmle.code.java.dataflow.internal.ModelExclusions |
12 | 8 |
|
@@ -58,37 +54,17 @@ class Endpoint extends Callable { |
58 | 54 | not exists(this.getJarVersion()) and result = "" |
59 | 55 | } |
60 | 56 |
|
61 | | - /** Gets a node that is an input to a call to this API. */ |
62 | | - private DataFlow::Node getAnInput() { |
63 | | - exists(Call call | call.getCallee().getSourceDeclaration() = this | |
64 | | - result.asExpr().(Argument).getCall() = call or |
65 | | - result.(ArgumentNode).getCall().asCall() = call |
66 | | - ) |
67 | | - } |
68 | | - |
69 | | - /** Gets a node that is an output from a call to this API. */ |
70 | | - private DataFlow::Node getAnOutput() { |
71 | | - exists(Call call | call.getCallee().getSourceDeclaration() = this | |
72 | | - result.asExpr() = call or |
73 | | - result.(DataFlow::PostUpdateNode).getPreUpdateNode().(ArgumentNode).getCall().asCall() = call |
74 | | - ) |
75 | | - } |
76 | | - |
77 | 57 | /** Holds if this API has a supported summary. */ |
78 | 58 | pragma[nomagic] |
79 | | - predicate hasSummary() { |
80 | | - this = any(SummarizedCallable sc).asCallable() or |
81 | | - TaintTracking::localAdditionalTaintStep(this.getAnInput(), _) |
82 | | - } |
| 59 | + predicate hasSummary() { this = any(SummarizedCallable sc).asCallable() } |
83 | 60 |
|
| 61 | + /** Holds if this API is a known source. */ |
84 | 62 | pragma[nomagic] |
85 | | - predicate isSource() { |
86 | | - this.getAnOutput() instanceof RemoteFlowSource or sourceNode(this.getAnOutput(), _) |
87 | | - } |
| 63 | + abstract predicate isSource(); |
88 | 64 |
|
89 | 65 | /** Holds if this API is a known sink. */ |
90 | 66 | pragma[nomagic] |
91 | | - predicate isSink() { sinkNode(this.getAnInput(), _) } |
| 67 | + abstract predicate isSink(); |
92 | 68 |
|
93 | 69 | /** Holds if this API is a known neutral. */ |
94 | 70 | pragma[nomagic] |
|
0 commit comments