Java: Deprecate RemoteUserInput.

This commit is contained in:
Anders Schack-Mulligen
2019-05-06 13:43:58 +02:00
parent 10a6362357
commit f367427fb8
16 changed files with 21 additions and 17 deletions

View File

@@ -20,7 +20,7 @@ import DataFlow::PathGraph
class TaintedPathConfig extends TaintTracking::Configuration {
TaintedPathConfig() { this = "TaintedPathConfig" }
override predicate isSource(DataFlow::Node source) { source instanceof RemoteUserInput }
override predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource }
override predicate isSink(DataFlow::Node sink) {
exists(Expr e | e = sink.asExpr() | e = any(PathCreation p).getInput() and not guarded(e))

View File

@@ -6,7 +6,7 @@ private class RemoteUserInputToArgumentToExecFlowConfig extends TaintTracking::C
this = "ExecCommon::RemoteUserInputToArgumentToExecFlowConfig"
}
override predicate isSource(DataFlow::Node src) { src instanceof RemoteUserInput }
override predicate isSource(DataFlow::Node src) { src instanceof RemoteFlowSource }
override predicate isSink(DataFlow::Node sink) { sink.asExpr() instanceof ArgumentToExec }

View File

@@ -18,7 +18,7 @@ import DataFlow2::PathGraph
class XSSConfig extends TaintTracking::Configuration2 {
XSSConfig() { this = "XSSConfig" }
override predicate isSource(DataFlow::Node source) { source instanceof RemoteUserInput }
override predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource }
override predicate isSink(DataFlow::Node sink) { sink instanceof XssSink }

View File

@@ -49,7 +49,7 @@ class PersistenceQueryInjectionSink extends QueryInjectionSink {
private class QueryInjectionFlowConfig extends TaintTracking::Configuration {
QueryInjectionFlowConfig() { this = "SqlInjectionLib::QueryInjectionFlowConfig" }
override predicate isSource(DataFlow::Node src) { src instanceof RemoteUserInput }
override predicate isSource(DataFlow::Node src) { src instanceof RemoteFlowSource }
override predicate isSink(DataFlow::Node sink) { sink instanceof QueryInjectionSink }

View File

@@ -18,7 +18,7 @@ class ResponseSplittingConfig extends TaintTracking::Configuration {
ResponseSplittingConfig() { this = "ResponseSplittingConfig" }
override predicate isSource(DataFlow::Node source) {
source instanceof RemoteUserInput and
source instanceof RemoteFlowSource and
not source instanceof WhitelistedSource
}

View File

@@ -30,7 +30,7 @@ class HeaderSplittingSink extends DataFlow::ExprNode {
}
}
class WhitelistedSource extends RemoteUserInput {
class WhitelistedSource extends DataFlow::ExprNode {
WhitelistedSource() {
this.asExpr().(MethodAccess).getMethod() instanceof HttpServletRequestGetHeaderMethod or
this.asExpr().(MethodAccess).getMethod() instanceof CookieGetNameMethod

View File

@@ -17,7 +17,7 @@ import DataFlow::PathGraph
class Conf extends TaintTracking::Configuration {
Conf() { this = "RemoteUserInputTocanThrowOutOfBoundsDueToEmptyArrayConfig" }
override predicate isSource(DataFlow::Node source) { source instanceof RemoteUserInput }
override predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource }
override predicate isSink(DataFlow::Node sink) {
any(CheckableArrayAccess caa).canThrowOutOfBoundsDueToEmptyArray(sink.asExpr(), _)

View File

@@ -17,7 +17,7 @@ import DataFlow::PathGraph
class Conf extends TaintTracking::Configuration {
Conf() { this = "RemoteUserInputTocanThrowOutOfBoundsDueToEmptyArrayConfig" }
override predicate isSource(DataFlow::Node source) { source instanceof RemoteUserInput }
override predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource }
override predicate isSink(DataFlow::Node sink) {
any(CheckableArrayAccess caa).canThrowOutOfBounds(sink.asExpr())

View File

@@ -17,7 +17,7 @@ import DataFlow::PathGraph
class ExternallyControlledFormatStringConfig extends TaintTracking::Configuration {
ExternallyControlledFormatStringConfig() { this = "ExternallyControlledFormatStringConfig" }
override predicate isSource(DataFlow::Node source) { source instanceof RemoteUserInput }
override predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource }
override predicate isSink(DataFlow::Node sink) {
sink.asExpr() = any(StringFormat formatCall).getFormatArgument()

View File

@@ -32,7 +32,7 @@ predicate sink(ArithExpr exp, VarAccess tainted, string effect) {
class RemoteUserInputConfig extends TaintTracking::Configuration {
RemoteUserInputConfig() { this = "ArithmeticTainted.ql:RemoteUserInputConfig" }
override predicate isSource(DataFlow::Node source) { source instanceof RemoteUserInput }
override predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource }
override predicate isSink(DataFlow::Node sink) { sink(_, sink.asExpr(), _) }

View File

@@ -18,7 +18,7 @@ import DataFlow::PathGraph
class UnsafeDeserializationConfig extends TaintTracking::Configuration {
UnsafeDeserializationConfig() { this = "UnsafeDeserializationConfig" }
override predicate isSource(DataFlow::Node source) { source instanceof RemoteUserInput }
override predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource }
override predicate isSink(DataFlow::Node sink) { sink instanceof UnsafeDeserializationSink }
}

View File

@@ -18,7 +18,7 @@ import DataFlow::PathGraph
class UrlRedirectConfig extends TaintTracking::Configuration {
UrlRedirectConfig() { this = "UrlRedirectConfig" }
override predicate isSource(DataFlow::Node source) { source instanceof RemoteUserInput }
override predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource }
override predicate isSink(DataFlow::Node sink) { sink instanceof UrlRedirectSink }
}

View File

@@ -40,7 +40,7 @@ class UnsafeXxeSink extends DataFlow::ExprNode {
class XxeConfig extends TaintTracking::Configuration {
XxeConfig() { this = "XXE.ql::XxeConfig" }
override predicate isSource(DataFlow::Node src) { src instanceof RemoteUserInput }
override predicate isSource(DataFlow::Node src) { src instanceof RemoteFlowSource }
override predicate isSink(DataFlow::Node sink) { sink instanceof UnsafeXxeSink }
}

View File

@@ -19,7 +19,7 @@ import DataFlow::PathGraph
private class NumericCastFlowConfig extends TaintTracking::Configuration {
NumericCastFlowConfig() { this = "NumericCastTainted::RemoteUserInputToNumericNarrowingCastExpr" }
override predicate isSource(DataFlow::Node src) { src instanceof RemoteUserInput }
override predicate isSource(DataFlow::Node src) { src instanceof RemoteFlowSource }
override predicate isSink(DataFlow::Node sink) {
sink.asExpr() = any(NumericNarrowingCastExpr cast).getExpr()

View File

@@ -143,8 +143,12 @@ private class ThriftIfaceParameterSource extends RemoteFlowSource {
/** Class for `tainted` user input. */
abstract class UserInput extends DataFlow::Node { }
/** Input that may be controlled by a remote user. */
class RemoteUserInput extends UserInput {
/**
* DEPRECATED: Use `RemoteFlowSource` instead.
*
* Input that may be controlled by a remote user.
*/
deprecated class RemoteUserInput extends UserInput {
RemoteUserInput() { this instanceof RemoteFlowSource }
/**