@@ -30,7 +30,7 @@ module TaintedPath {
3030 /**
3131 * A guard for uncontrolled data in path expression vulnerabilities.
3232 */
33- abstract class BarrierGuard extends DataFlow:: BarrierGuard { }
33+ abstract class SanitizerGuard extends DataFlow:: BarrierGuard { }
3434
3535 /**
3636 * A taint-tracking configuration for uncontrolled data in path expression vulnerabilities.
@@ -45,7 +45,7 @@ module TaintedPath {
4545 override predicate isSanitizer ( DataFlow:: Node node ) { node instanceof Sanitizer }
4646
4747 override predicate isSanitizerGuard ( DataFlow:: BarrierGuard guard ) {
48- guard instanceof BarrierGuard
48+ guard instanceof SanitizerGuard
4949 }
5050 }
5151
@@ -102,12 +102,16 @@ module TaintedPath {
102102 }
103103 }
104104
105+ class NullBarrierGuard extends DataFlow:: BarrierGuards:: ValueBarrierGuard {
106+ NullBarrierGuard ( ) { val instanceof DataFlow:: BarrierGuards:: NullValue }
107+ }
108+
105109 /**
106110 * A conditional involving the path, that is not considered to be a weak check.
107111 *
108112 * A weak check is one that is insufficient to prevent path tampering.
109113 */
110- class PathCheck extends BarrierGuard {
114+ class PathCheck extends SanitizerGuard {
111115 PathCheck ( ) {
112116 // None of these are sufficient to guarantee that a string is safe.
113117 not this .( MethodCall ) .getTarget ( ) = any ( Method m |
@@ -119,8 +123,7 @@ module TaintedPath {
119123 m = any ( SystemIODirectoryClass f ) .getAMethod ( "Exists" )
120124 ) and
121125 // Checking against `null` has no bearing on path traversal.
122- not this instanceof DataFlow:: BarrierGuards:: NullGuard and
123- not this instanceof DataFlow:: BarrierGuards:: AntiNullGuard
126+ not this instanceof NullBarrierGuard
124127 }
125128
126129 override predicate checks ( Expr e , AbstractValue v ) { this .controlsNode ( _, e , v ) }
0 commit comments