Skip to content

Commit de6959c

Browse files
committed
Refactor CWE-209/StackTraceExposure
1 parent 73a1753 commit de6959c

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

java/ql/src/Security/CWE/CWE-209/StackTraceExposure.ql

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -120,22 +120,20 @@ class GetMessageFlowSource extends MethodAccess {
120120
}
121121
}
122122

123-
class GetMessageFlowSourceToHttpResponseSinkFlowConfig extends TaintTracking::Configuration {
124-
GetMessageFlowSourceToHttpResponseSinkFlowConfig() {
125-
this = "StackTraceExposure::GetMessageFlowSourceToHttpResponseSinkFlowConfig"
126-
}
127-
128-
override predicate isSource(DataFlow::Node src) { src.asExpr() instanceof GetMessageFlowSource }
123+
private module GetMessageFlowSourceToHttpResponseSinkFlowConfig implements DataFlow::ConfigSig {
124+
predicate isSource(DataFlow::Node src) { src.asExpr() instanceof GetMessageFlowSource }
129125

130-
override predicate isSink(DataFlow::Node sink) { sink instanceof InformationLeakSink }
126+
predicate isSink(DataFlow::Node sink) { sink instanceof InformationLeakSink }
131127
}
132128

129+
module GetMessageFlowSourceToHttpResponseSinkFlow =
130+
TaintTracking::Make<GetMessageFlowSourceToHttpResponseSinkFlowConfig>;
131+
133132
/**
134133
* A call to `getMessage()` that then flows to a servlet response.
135134
*/
136135
predicate getMessageFlowsExternally(DataFlow::Node externalExpr, GetMessageFlowSource getMessage) {
137-
any(GetMessageFlowSourceToHttpResponseSinkFlowConfig conf)
138-
.hasFlow(DataFlow::exprNode(getMessage), externalExpr)
136+
GetMessageFlowSourceToHttpResponseSinkFlow::hasFlow(DataFlow::exprNode(getMessage), externalExpr)
139137
}
140138

141139
from Expr externalExpr, Expr errorInformation

0 commit comments

Comments
 (0)