File tree Expand file tree Collapse file tree
python/ql/src/experimental/semmle/python/security Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -289,3 +289,34 @@ class UserInputInComparisonConfig extends TaintTracking2::Configuration {
289289 )
290290 }
291291}
292+
293+ private class CompareSink extends DataFlow:: Node {
294+ CompareSink ( ) {
295+ exists ( Compare compare |
296+ (
297+ compare .getOp ( 0 ) instanceof Eq or
298+ compare .getOp ( 0 ) instanceof NotEq or
299+ compare .getOp ( 0 ) instanceof In
300+ ) and
301+ (
302+ compare .getLeft ( ) = this .asExpr ( ) and
303+ not compare .getComparator ( 0 ) .( StrConst ) .getText ( ) = "bearer"
304+ or
305+ compare .getComparator ( 0 ) = this .asExpr ( ) and
306+ not compare .getLeft ( ) .( StrConst ) .getText ( ) = "bearer"
307+ )
308+ ) or
309+ exists ( Compare compare |
310+ (
311+ compare .getOp ( 0 ) instanceof IsNot
312+ ) and
313+ (
314+ compare .getLeft ( ) = this .asExpr ( ) and
315+ not compare .getComparator ( 0 ) instanceof None
316+ or
317+ compare .getComparator ( 0 ) = this .asExpr ( ) and
318+ not compare .getLeft ( ) instanceof None
319+ )
320+ )
321+ }
322+ }
You can’t perform that action at this time.
0 commit comments