File tree Expand file tree Collapse file tree 7 files changed +10
-15
lines changed
src/semmle/python/web/bottle Expand file tree Collapse file tree 7 files changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -3,12 +3,12 @@ import semmle.python.web.Http
3
3
import semmle.python.types.Extensions
4
4
5
5
/** The bottle module */
6
- ModuleObject theBottleModule ( ) {
7
- result = ModuleObject :: named ( "bottle" )
6
+ ModuleValue theBottleModule ( ) {
7
+ result = Module :: named ( "bottle" )
8
8
}
9
9
10
10
/** The bottle.Bottle class */
11
- ClassObject theBottleClass ( ) {
11
+ ClassValue theBottleClass ( ) {
12
12
result = theBottleModule ( ) .attr ( "Bottle" )
13
13
}
14
14
@@ -17,8 +17,8 @@ ClassObject theBottleClass() {
17
17
*/
18
18
predicate bottle_route ( CallNode route_call , ControlFlowNode route , Function func ) {
19
19
exists ( CallNode decorator_call , string name |
20
- route_call .getFunction ( ) .( AttrNode ) .getObject ( name ) .refersTo ( _ , theBottleClass ( ) , _ ) or
21
- route_call .getFunction ( ) .refersTo ( theBottleModule ( ) .attr ( name ) )
20
+ route_call .getFunction ( ) .( AttrNode ) .getObject ( name ) .pointsTo ( ) . getClass ( ) = theBottleClass ( ) or
21
+ route_call .getFunction ( ) .pointsTo ( theBottleModule ( ) .attr ( name ) )
22
22
|
23
23
( name = "route" or name = httpVerbLower ( ) ) and
24
24
decorator_call .getFunction ( ) = route_call and
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import semmle.python.security.TaintTracking
8
8
import semmle.python.security.strings.Basic
9
9
import semmle.python.web.bottle.General
10
10
11
- FunctionObject bottle_redirect ( ) {
11
+ FunctionValue bottle_redirect ( ) {
12
12
result = theBottleModule ( ) .attr ( "redirect" )
13
13
}
14
14
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import semmle.python.security.strings.Untrusted
6
6
import semmle.python.web.Http
7
7
import semmle.python.web.bottle.General
8
8
9
- private Object theBottleRequestObject ( ) {
9
+ private Value theBottleRequestObject ( ) {
10
10
result = theBottleModule ( ) .attr ( "request" )
11
11
}
12
12
@@ -32,7 +32,7 @@ class BottleRequestKind extends TaintKind {
32
32
private class RequestSource extends TaintSource {
33
33
34
34
RequestSource ( ) {
35
- this .( ControlFlowNode ) .refersTo ( theBottleRequestObject ( ) )
35
+ this .( ControlFlowNode ) .pointsTo ( theBottleRequestObject ( ) )
36
36
}
37
37
38
38
override predicate isSourceOf ( TaintKind kind ) {
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ class BottleResponse extends TaintKind {
18
18
19
19
}
20
20
21
- private Object theBottleResponseObject ( ) {
21
+ private Value theBottleResponseObject ( ) {
22
22
result = theBottleModule ( ) .attr ( "response" )
23
23
}
24
24
@@ -27,7 +27,7 @@ class BottleResponseBodyAssignment extends HttpResponseTaintSink {
27
27
BottleResponseBodyAssignment ( ) {
28
28
exists ( DefinitionNode lhs |
29
29
lhs .getValue ( ) = this and
30
- lhs .( AttrNode ) .getObject ( "body" ) .refersTo ( theBottleResponseObject ( ) )
30
+ lhs .( AttrNode ) .getObject ( "body" ) .pointsTo ( theBottleResponseObject ( ) )
31
31
)
32
32
}
33
33
Original file line number Diff line number Diff line change 1
1
| ../../../query-tests/Security/lib/bottle.py:64 | LocalRequest() | bottle.request |
2
- | ../../../query-tests/Security/lib/bottle.py:64 | request | bottle.request |
3
2
| test.py:3 | ImportMember | bottle.request |
4
- | test.py:3 | request | bottle.request |
5
3
| test.py:8 | name | externally controlled string |
6
4
| test.py:12 | name | externally controlled string |
7
5
| test.py:18 | request | bottle.request |
Original file line number Diff line number Diff line change 1
1
| ../../../query-tests/Security/lib/bottle.py:64 | LocalRequest() | bottle.request |
2
- | ../../../query-tests/Security/lib/bottle.py:64 | request | bottle.request |
3
2
| ../../../query-tests/Security/lib/bottle.py:68 | url | externally controlled string |
4
3
| test.py:3 | ImportMember | bottle.request |
5
- | test.py:3 | request | bottle.request |
6
4
| test.py:8 | name | externally controlled string |
7
5
| test.py:9 | BinaryExpr | externally controlled string |
8
6
| test.py:9 | name | externally controlled string |
Original file line number Diff line number Diff line change @@ -67,4 +67,3 @@ class LocalResponse(LocalProxy):
67
67
68
68
def redirect (url , code = None ):
69
69
pass
70
-
You can’t perform that action at this time.
0 commit comments