File tree Expand file tree Collapse file tree
python/ql/src/experimental/Security/CWE-022bis Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,15 +53,24 @@ class UnsafeUnpackingConfig extends TaintTracking::Configuration {
5353 nodeTo = is .( CallCfgNode ) .getArg ( 0 )
5454 )
5555 or
56+ // Copying the response data to the archive
57+ exists ( Stdlib:: FileLikeObject:: InstanceSource is , Node f , MethodCallNode mc |
58+ is .flowsTo ( f ) and
59+ mc = API:: moduleImport ( "shutil" ) .getMember ( "copyfileobj" ) .getACall ( ) and
60+ f = mc .getArg ( 1 ) and
61+ nodeFrom = mc .getArg ( 0 ) and
62+ nodeTo = is .( CallCfgNode ) .getArg ( 0 )
63+ )
64+ or
5665 // Reading the response
5766 exists ( MethodCallNode mc |
5867 nodeFrom = mc .getObject ( ) and
5968 mc .getMethodName ( ) = "read" and
6069 mc .flowsTo ( nodeTo )
6170 )
6271 or
63- // Accessing the name
64- exists ( AttrRead ar | ar .accesses ( nodeFrom , "name" ) and nodeTo = ar )
72+ // Accessing the name or raw content
73+ exists ( AttrRead ar | ar .accesses ( nodeFrom , [ "name" , "raw" ] ) and nodeTo = ar )
6574 or
6675 // Considering the use of closing()
6776 exists ( API:: Node closing |
You can’t perform that action at this time.
0 commit comments