File tree Expand file tree Collapse file tree
src/semmle/python/web/bottle Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,12 +3,12 @@ import semmle.python.web.Http
33import semmle.python.types.Extensions
44
55/** The bottle module */
6- ModuleObject theBottleModule ( ) {
7- result = ModuleObject :: named ( "bottle" )
6+ ModuleValue theBottleModule ( ) {
7+ result = Module :: named ( "bottle" )
88}
99
1010/** The bottle.Bottle class */
11- ClassObject theBottleClass ( ) {
11+ ClassValue theBottleClass ( ) {
1212 result = theBottleModule ( ) .attr ( "Bottle" )
1313}
1414
@@ -17,8 +17,8 @@ ClassObject theBottleClass() {
1717 */
1818predicate bottle_route ( CallNode route_call , ControlFlowNode route , Function func ) {
1919 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 ) )
2222 |
2323 ( name = "route" or name = httpVerbLower ( ) ) and
2424 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
88import semmle.python.security.strings.Basic
99import semmle.python.web.bottle.General
1010
11- FunctionObject bottle_redirect ( ) {
11+ FunctionValue bottle_redirect ( ) {
1212 result = theBottleModule ( ) .attr ( "redirect" )
1313}
1414
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import semmle.python.security.strings.Untrusted
66import semmle.python.web.Http
77import semmle.python.web.bottle.General
88
9- private Object theBottleRequestObject ( ) {
9+ private Value theBottleRequestObject ( ) {
1010 result = theBottleModule ( ) .attr ( "request" )
1111}
1212
@@ -32,7 +32,7 @@ class BottleRequestKind extends TaintKind {
3232private class RequestSource extends TaintSource {
3333
3434 RequestSource ( ) {
35- this .( ControlFlowNode ) .refersTo ( theBottleRequestObject ( ) )
35+ this .( ControlFlowNode ) .pointsTo ( theBottleRequestObject ( ) )
3636 }
3737
3838 override predicate isSourceOf ( TaintKind kind ) {
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ class BottleResponse extends TaintKind {
1818
1919}
2020
21- private Object theBottleResponseObject ( ) {
21+ private Value theBottleResponseObject ( ) {
2222 result = theBottleModule ( ) .attr ( "response" )
2323}
2424
@@ -27,7 +27,7 @@ class BottleResponseBodyAssignment extends HttpResponseTaintSink {
2727 BottleResponseBodyAssignment ( ) {
2828 exists ( DefinitionNode lhs |
2929 lhs .getValue ( ) = this and
30- lhs .( AttrNode ) .getObject ( "body" ) .refersTo ( theBottleResponseObject ( ) )
30+ lhs .( AttrNode ) .getObject ( "body" ) .pointsTo ( theBottleResponseObject ( ) )
3131 )
3232 }
3333
Original file line number Diff line number Diff line change 11| ../../../query-tests/Security/lib/bottle.py:64 | LocalRequest() | bottle.request |
2- | ../../../query-tests/Security/lib/bottle.py:64 | request | bottle.request |
32| test.py:3 | ImportMember | bottle.request |
4- | test.py:3 | request | bottle.request |
53| test.py:8 | name | externally controlled string |
64| test.py:12 | name | externally controlled string |
75| test.py:18 | request | bottle.request |
Original file line number Diff line number Diff line change 11| ../../../query-tests/Security/lib/bottle.py:64 | LocalRequest() | bottle.request |
2- | ../../../query-tests/Security/lib/bottle.py:64 | request | bottle.request |
32| ../../../query-tests/Security/lib/bottle.py:68 | url | externally controlled string |
43| test.py:3 | ImportMember | bottle.request |
5- | test.py:3 | request | bottle.request |
64| test.py:8 | name | externally controlled string |
75| test.py:9 | BinaryExpr | externally controlled string |
86| test.py:9 | name | externally controlled string |
Original file line number Diff line number Diff line change @@ -67,4 +67,3 @@ class LocalResponse(LocalProxy):
6767
6868def redirect (url , code = None ):
6969 pass
70-
You can’t perform that action at this time.
0 commit comments