File tree Expand file tree Collapse file tree 2 files changed +6
-12
lines changed
test/query-tests/Security/CWE/CWE-807/semmle/TaintedCondition Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -19,16 +19,10 @@ import semmle.code.cpp.ir.dataflow.TaintTracking
1919import semmle.code.cpp.ir.IR
2020import Flow:: PathGraph
2121
22- Expr getExprWithoutNot ( Expr expr ) {
23- result = expr and not expr instanceof NotExpr
24- or
25- result = getExprWithoutNot ( expr .( NotExpr ) .getOperand ( ) ) and expr instanceof NotExpr
26- }
27-
2822predicate sensitiveCondition ( Expr condition , Expr raise ) {
2923 raisesPrivilege ( raise ) and
3024 exists ( IfStmt ifstmt |
31- getExprWithoutNot ( ifstmt .getCondition ( ) ) = condition and
25+ ifstmt .getCondition ( ) = condition and
3226 raise .getEnclosingStmt ( ) .getParentStmt * ( ) = ifstmt
3327 )
3428}
Original file line number Diff line number Diff line change 11edges
2- | test.cpp:20:29:20:47 | call to getenv | test.cpp:24:11 :24:16 | call to strcmp |
3- | test.cpp:20:29:20:47 | call to getenv indirection | test.cpp:24:11 :24:16 | call to strcmp |
2+ | test.cpp:20:29:20:47 | call to getenv | test.cpp:24:10 :24:35 | ! ... |
3+ | test.cpp:20:29:20:47 | call to getenv indirection | test.cpp:24:10 :24:35 | ! ... |
44nodes
55| test.cpp:20:29:20:47 | call to getenv | semmle.label | call to getenv |
66| test.cpp:20:29:20:47 | call to getenv indirection | semmle.label | call to getenv indirection |
7- | test.cpp:24:11 :24:16 | call to strcmp | semmle.label | call to strcmp |
7+ | test.cpp:24:10 :24:35 | ! ... | semmle.label | ! ... |
88subpaths
99#select
10- | test.cpp:24:11 :24:16 | call to strcmp | test.cpp:20:29:20:47 | call to getenv | test.cpp:24:11 :24:16 | call to strcmp | Reliance on $@ to raise privilege at $@. | test.cpp:20:29:20:47 | call to getenv | an environment variable | test.cpp:25:9:25:27 | ... = ... | ... = ... |
11- | test.cpp:24:11 :24:16 | call to strcmp | test.cpp:20:29:20:47 | call to getenv indirection | test.cpp:24:11 :24:16 | call to strcmp | Reliance on $@ to raise privilege at $@. | test.cpp:20:29:20:47 | call to getenv indirection | an environment variable | test.cpp:25:9:25:27 | ... = ... | ... = ... |
10+ | test.cpp:24:10 :24:35 | ! ... | test.cpp:20:29:20:47 | call to getenv | test.cpp:24:10 :24:35 | ! ... | Reliance on $@ to raise privilege at $@. | test.cpp:20:29:20:47 | call to getenv | an environment variable | test.cpp:25:9:25:27 | ... = ... | ... = ... |
11+ | test.cpp:24:10 :24:35 | ! ... | test.cpp:20:29:20:47 | call to getenv indirection | test.cpp:24:10 :24:35 | ! ... | Reliance on $@ to raise privilege at $@. | test.cpp:20:29:20:47 | call to getenv indirection | an environment variable | test.cpp:25:9:25:27 | ... = ... | ... = ... |
You can’t perform that action at this time.
0 commit comments