@@ -338,7 +338,7 @@ module StdlibPrivate {
338338 * Modeling of path related functions in the `os` module.
339339 * Wrapped in QL module to make it easy to fold/unfold.
340340 */
341- private module OsFileSystemAccessModeling {
341+ module OsFileSystemAccessModeling {
342342 /**
343343 * A call to the `os.fsencode` function.
344344 *
@@ -395,7 +395,7 @@ module StdlibPrivate {
395395 *
396396 * See https://docs.python.org/3/library/os.html#os.open
397397 */
398- private class OsOpenCall extends FileSystemAccess:: Range , DataFlow:: CallCfgNode {
398+ class OsOpenCall extends FileSystemAccess:: Range , DataFlow:: CallCfgNode {
399399 OsOpenCall ( ) { this = os ( ) .getMember ( "open" ) .getACall ( ) }
400400
401401 override DataFlow:: Node getAPathArgument ( ) {
@@ -1501,7 +1501,12 @@ module StdlibPrivate {
15011501 private class OpenCall extends FileSystemAccess:: Range , Stdlib:: FileLikeObject:: InstanceSource ,
15021502 ThreatModelSource:: Range , DataFlow:: CallCfgNode
15031503 {
1504- OpenCall ( ) { this = getOpenFunctionRef ( ) .getACall ( ) }
1504+ OpenCall ( ) {
1505+ this = getOpenFunctionRef ( ) .getACall ( ) and
1506+ // when analyzing stdlib code for os.py we wrongly assume that `os.open` is an
1507+ // alias of the builtins `open` function
1508+ not this instanceof OsFileSystemAccessModeling:: OsOpenCall
1509+ }
15051510
15061511 override DataFlow:: Node getAPathArgument ( ) {
15071512 result in [ this .getArg ( 0 ) , this .getArgByName ( "file" ) ]
0 commit comments