diff --git a/ql/src/codeql_ruby/ApiGraphs.qll b/ql/src/codeql_ruby/ApiGraphs.qll index 034a1c71162..50f4a9c1b77 100644 --- a/ql/src/codeql_ruby/ApiGraphs.qll +++ b/ql/src/codeql_ruby/ApiGraphs.qll @@ -212,13 +212,15 @@ module API { Root root() { any() } /** - * Gets a node corresponding to an import of top-level module `m`. + * Gets a node corresponding to a top-level member `m` (typically a module). + * + * This is equivalent to `root().getAMember("m")`. * * Note: You should only use this predicate for top level modules or classes. If you want nodes corresponding to a nested module or class, * you should use `.getMember` on the parent module/class. For example, for nodes corresponding to the class `Gem::Version`, - * use `moduleImport("Gem").getMember("Version")`. + * use `getTopLevelMember("Gem").getMember("Version")`. */ - Node moduleImport(string m) { result = root().getMember(m) } + Node getTopLevelMember(string m) { result = root().getMember(m) } /** * Provides the actual implementation of API graphs, cached for performance. diff --git a/ql/src/queries/security/cwe-732/WeakFilePermissions.ql b/ql/src/queries/security/cwe-732/WeakFilePermissions.ql index fac0da0cbe3..4beb4452c00 100644 --- a/ql/src/queries/security/cwe-732/WeakFilePermissions.ql +++ b/ql/src/queries/security/cwe-732/WeakFilePermissions.ql @@ -49,7 +49,7 @@ class PermissionArgument extends DataFlow::Node { PermissionArgument() { exists(string methodName | - call = API::moduleImport(["File", "FileUtils"]).getAMethodCall(methodName) + call = API::getTopLevelMember(["File", "FileUtils"]).getAMethodCall(methodName) | methodName in ["chmod", "chmod_R", "lchmod"] and this = call.getArgument(0) or