@@ -218,33 +218,31 @@ predicate safeBounds(Expr cast, IntegralType toType) {
218218 safeLowerBound ( cast , toType ) and safeUpperBound ( cast , toType )
219219}
220220
221- /**
221+ /*
222222 * Taint tracking from user-controlled inputs to implicit conversions
223- * UNUSED: uncomment the code near "select" statement at the bottom to use
223+ * UNUSED: uncomment code below and the code near "select" statement at the bottom of the file
224224 */
225- module UnsafeUserInputConversionConfig implements DataFlow:: ConfigSig {
226- predicate isSource ( DataFlow:: Node source ) {
227- exists ( RemoteFlowSourceFunction remoteFlow |
228- remoteFlow = source .asExpr ( ) .( Call ) .getTarget ( ) and
229- remoteFlow .hasRemoteFlowSource ( _, _)
230- )
231- or
232- exists ( LocalFlowSourceFunction localFlow |
233- localFlow = source .asExpr ( ) .( Call ) .getTarget ( ) and
234- localFlow .hasLocalFlowSource ( _, _)
235- )
236- }
237-
238- predicate isSink ( DataFlow:: Node sink ) {
239- exists ( IntegralConversion cast |
240- cast .isImplicit ( ) and
241- cast .getExpr ( ) = sink .asExpr ( )
242- )
243- }
244- }
245-
246- module UnsafeUserInputConversionFlow = TaintTracking:: Global< UnsafeUserInputConversionConfig > ;
247225
226+ // module UnsafeUserInputConversionConfig implements DataFlow::ConfigSig {
227+ // predicate isSource(DataFlow::Node source) {
228+ // exists(RemoteFlowSourceFunction remoteFlow |
229+ // remoteFlow = source.asExpr().(Call).getTarget() and
230+ // remoteFlow.hasRemoteFlowSource(_, _)
231+ // )
232+ // or
233+ // exists(LocalFlowSourceFunction localFlow |
234+ // localFlow = source.asExpr().(Call).getTarget() and
235+ // localFlow.hasLocalFlowSource(_, _)
236+ // )
237+ // }
238+ // predicate isSink(DataFlow::Node sink) {
239+ // exists(IntegralConversion cast |
240+ // cast.isImplicit() and
241+ // cast.getExpr() = sink.asExpr()
242+ // )
243+ // }
244+ // }
245+ // module UnsafeUserInputConversionFlow = TaintTracking::Global<UnsafeUserInputConversionConfig>;
248246from
249247 IntegralConversion cast , IntegralType fromType , IntegralType toType , Expr castExpr ,
250248 string problemType
@@ -320,9 +318,9 @@ where
320318 or
321319 addressIsTaken ( cast .getEnclosingFunction ( ) )
322320 )
323- // Uncomment to report conversions with untrusted inputs only
321+ // UNUSED: Uncomment to report conversions with untrusted inputs only
324322// and exists(DataFlow::Node source, DataFlow::Node sink |
325- // cast.getExpr() = sink.asExpr() and
323+ // castExpr = sink.asExpr() and
326324// UnsafeUserInputConversionFlow::flow(source, sink)
327325// )
328326select cast , "Implicit cast from " + fromType + " to " + toType + " (" + problemType + ")"
0 commit comments