diff --git a/javascript/ql/src/semmle/javascript/GlobalAccessPaths.qll b/javascript/ql/src/semmle/javascript/GlobalAccessPaths.qll index a2fe1e0ec8e..24d70315bcd 100644 --- a/javascript/ql/src/semmle/javascript/GlobalAccessPaths.qll +++ b/javascript/ql/src/semmle/javascript/GlobalAccessPaths.qll @@ -154,9 +154,9 @@ module GlobalAccessPath { baseName = fromRhs(base) ) or - exists(AssignExpr assign | - node = assign.getRhs().flow() and - result = assign.getLhs().(GlobalVarAccess).getName() + exists(GlobalVariable var | + node = var.getAnAssignedExpr().flow() and + result = var.getName() ) or exists(FunctionDeclStmt fun | @@ -168,6 +168,16 @@ module GlobalAccessPath { node = DataFlow::valueNode(cls) and result = cls.getIdentifier().(GlobalVarDecl).getName() ) + or + exists(EnumDeclaration decl | + node = DataFlow::valueNode(decl) and + result = decl.getIdentifier().(GlobalVarDecl).getName() + ) + or + exists(NamespaceDeclaration decl | + node = DataFlow::valueNode(decl) and + result = decl.getId().(GlobalVarDecl).getName() + ) } /**