From cc7a9ef97a78755ca81a77dd686ca7ab363c651f Mon Sep 17 00:00:00 2001 From: erik-krogh Date: Wed, 24 Aug 2022 12:59:07 +0200 Subject: [PATCH 1/4] rename more acronyms --- cpp/ql/lib/semmle/code/cpp/Class.qll | 5 +- cpp/ql/lib/semmle/code/cpp/PODType03.qll | 20 ++- .../semmle/code/cpp/commons/Dependency.qll | 10 +- cpp/ql/lib/semmle/code/cpp/commons/NULL.qll | 9 +- .../code/cpp/dataflow/internal/FlowVar.qll | 4 +- .../GlobalValueNumberingImpl.qll | 6 +- .../ClassesWithManyFields.ql | 10 +- cpp/ql/src/Best Practices/UseOfGoto.ql | 6 +- cpp/ql/src/Microsoft/CallWithNullSAL.ql | 2 +- cpp/ql/src/Microsoft/IgnoreReturnValueSAL.ql | 2 +- cpp/ql/src/Microsoft/InconsistentSAL.ql | 4 +- cpp/ql/src/Microsoft/SAL.qll | 93 ++++++---- .../ConditionallyUninitializedVariable.ql | 2 +- .../CWE/CWE-457/InitializationFunctions.qll | 6 +- cpp/ql/src/Security/CWE/CWE-611/XXE.ql | 6 +- .../AV Rule 2.ql | 6 +- cpp/ql/test/library-tests/pod/isPOD.ql | 2 +- cpp/ql/test/library-tests/pod/isPOD03.ql | 2 +- cpp/ql/test/library-tests/sal/sal.ql | 2 +- .../src/ModifiedFnvFunctionDetection.ql | 2 +- .../Cryptography/NonCryptographicHashes.qll | 7 +- .../security/dataflow/flowsinks/Remote.qll | 2 +- .../Security Features/InsufficientKeySize.ql | 8 +- .../raw/internal/InstructionTag.qll | 4 +- .../raw/internal/TranslatedExpr.qll | 14 +- go/ql/lib/semmle/go/Util.qll | 5 +- .../go/dataflow/GlobalValueNumbering.qll | 26 +-- go/ql/src/RedundantCode/DuplicateCondition.ql | 4 +- .../src/RedundantCode/DuplicateSwitchCase.ql | 4 +- .../CWE-020/IncompleteHostnameRegexp.ql | 2 +- .../Security/CWE-020/MissingRegexpAnchor.ql | 2 +- java/ql/lib/semmle/code/java/JMX.qll | 45 +++-- .../code/java/NumberFormatException.qll | 22 ++- .../semmle/code/java/dataflow/FlowSources.qll | 9 +- .../semmle/code/java/deadcode/DeadCode.qll | 4 +- .../semmle/code/java/deadcode/DeadField.qll | 14 +- .../semmle/code/java/deadcode/EntryPoints.qll | 15 +- .../code/java/deadcode/SpringEntryPoints.qll | 7 +- .../code/java/deadcode/WebEntryPoints.qll | 14 +- .../lib/semmle/code/java/frameworks/Camel.qll | 8 +- .../lib/semmle/code/java/frameworks/JAXB.qll | 14 +- .../semmle/code/java/frameworks/UnboundId.qll | 14 +- .../java/frameworks/camel/CamelJavaDSL.qll | 28 ++- .../security/CleartextStorageClassQuery.qll | 6 +- .../code/java/security/JndiInjection.qll | 6 +- .../code/java/security/LdapInjection.qll | 4 +- .../NumberFormatException.ql | 4 +- .../CWE/CWE-326/InsufficientKeySize.ql | 8 +- .../Security/CWE/CWE-755/NFEAndroidDoS.ql | 10 +- .../modelbuilding/DebugResultInclusion.ql | 8 +- .../extraction/ExtractEndpointData.qll | 40 +++-- .../extraction/ExtractEndpointMapping.ql | 16 +- .../endpoint_large_scale/EndpointFeatures.ql | 16 +- .../FilteredTruePositives.ql | 16 +- ...ql_endpoint_filter_ignores_modeled_apis.ql | 4 +- .../ql/lib/semmle/javascript/Actions.qll | 34 ++-- .../lib/semmle/javascript/GeneratedCode.qll | 2 +- .../semmle/javascript/JsonStringifiers.qll | 5 +- javascript/ql/lib/semmle/javascript/NPM.qll | 10 +- .../ql/lib/semmle/javascript/PrintAst.qll | 20 +-- .../ql/lib/semmle/javascript/Regexp.qll | 5 +- javascript/ql/lib/semmle/javascript/Stmt.qll | 7 +- javascript/ql/lib/semmle/javascript/YAML.qll | 168 ++++++++++++------ .../internal/InterProceduralTypeInference.qll | 4 +- .../internal/VariableTypeInference.qll | 4 +- .../javascript/dependencies/Dependencies.qll | 10 +- .../dependencies/FrameworkLibraries.qll | 4 +- .../semmle/javascript/frameworks/Electron.qll | 20 ++- .../javascript/frameworks/Emscripten.qll | 14 +- .../lib/semmle/javascript/frameworks/GWT.qll | 30 +++- .../javascript/frameworks/ServerLess.qll | 14 +- .../semmle/javascript/frameworks/Testing.qll | 7 +- .../semmle/javascript/frameworks/jQuery.qll | 8 +- .../lib/semmle/javascript/linters/ESLint.qll | 6 +- .../PasswordInConfigurationFileQuery.qll | 4 +- .../dataflow/XssThroughDomCustomizations.qll | 7 +- .../FunctionalityFromUntrustedSource.ql | 4 +- .../Security/CWE-094/UntrustedCheckout.ql | 6 +- .../ql/test/library-tests/YAML/tests.ql | 12 +- .../frameworks/GWT/GWTGeneratedTopLevel.ql | 2 +- .../library-tests/frameworks/GWT/GWTHeader.ql | 2 +- .../Validating RAML-based APIs/RAML.qll | 16 +- .../Validating RAML-based APIs/query1.ql | 2 +- .../Validating RAML-based APIs/query2.ql | 16 +- .../Validating RAML-based APIs/query3.ql | 10 +- .../Validating RAML-based APIs/query4.ql | 16 +- .../lib/semmle/python/frameworks/Stdlib.qll | 7 +- .../semmle/python/frameworks/Django.qll | 7 +- .../semmle/python/frameworks/LDAP.qll | 12 +- .../semmle/python/libraries/SmtpLib.qll | 14 +- .../dataflow/TestUtil/NormalDataflowTest.qll | 5 +- ql/ql/src/codeql_ql/ast/Ast.qll | 17 +- .../lib/codeql/ruby/frameworks/XmlParsing.qll | 4 +- 93 files changed, 693 insertions(+), 451 deletions(-) diff --git a/cpp/ql/lib/semmle/code/cpp/Class.qll b/cpp/ql/lib/semmle/code/cpp/Class.qll index a91cedb9a0bf..f139f67c70a7 100644 --- a/cpp/ql/lib/semmle/code/cpp/Class.qll +++ b/cpp/ql/lib/semmle/code/cpp/Class.qll @@ -404,7 +404,10 @@ class Class extends UserType { * compiled for. For this reason, the `is_pod_class` predicate is * generated by the extractor. */ - predicate isPOD() { is_pod_class(underlyingElement(this)) } + predicate isPod() { is_pod_class(underlyingElement(this)) } + + /** DEPRECATED: Alias for isPod */ + deprecated predicate isPOD() { this.isPod() } /** * Holds if this class, struct or union is a standard-layout class diff --git a/cpp/ql/lib/semmle/code/cpp/PODType03.qll b/cpp/ql/lib/semmle/code/cpp/PODType03.qll index 88c9a1203aac..4d6e52622132 100644 --- a/cpp/ql/lib/semmle/code/cpp/PODType03.qll +++ b/cpp/ql/lib/semmle/code/cpp/PODType03.qll @@ -79,17 +79,17 @@ predicate isAggregateType03(Type t) { * user-defined copy assignment operator and no user-defined destructor. * A POD class is a class that is either a POD-struct or a POD-union. */ -predicate isPODClass03(Class c) { +predicate isPodClass03(Class c) { isAggregateClass03(c) and not exists(Variable v | v.getDeclaringType() = c and not v.isStatic() | - not isPODType03(v.getType()) + not isPodType03(v.getType()) or exists(ArrayType at | at = v.getType() and - not isPODType03(at.getBaseType()) + not isPodType03(at.getBaseType()) ) or v.getType() instanceof ReferenceType @@ -104,6 +104,9 @@ predicate isPODClass03(Class c) { ) } +/** DEPRECATED: Alias for isPodClass03 */ +deprecated predicate isPODClass03 = isPodClass03/1; + /** * Holds if `t` is a POD type, according to the rules specified in * C++03 3.9(10): @@ -112,14 +115,17 @@ predicate isPODClass03(Class c) { * such types and cv-qualified versions of these types (3.9.3) are * collectively called POD types. */ -predicate isPODType03(Type t) { +predicate isPodType03(Type t) { exists(Type ut | ut = t.getUnderlyingType() | isScalarType03(ut) or - isPODClass03(ut) + isPodClass03(ut) or - exists(ArrayType at | at = ut and isPODType03(at.getBaseType())) + exists(ArrayType at | at = ut and isPodType03(at.getBaseType())) or - isPODType03(ut.(SpecifiedType).getUnspecifiedType()) + isPodType03(ut.(SpecifiedType).getUnspecifiedType()) ) } + +/** DEPRECATED: Alias for isPodType03 */ +deprecated predicate isPODType03 = isPodType03/1; diff --git a/cpp/ql/lib/semmle/code/cpp/commons/Dependency.qll b/cpp/ql/lib/semmle/code/cpp/commons/Dependency.qll index ec95b29177b9..e7169d6917f5 100644 --- a/cpp/ql/lib/semmle/code/cpp/commons/Dependency.qll +++ b/cpp/ql/lib/semmle/code/cpp/commons/Dependency.qll @@ -238,7 +238,7 @@ predicate dependsOnTransitive(DependsSource src, Element dest) { /** * A dependency that targets a TypeDeclarationEntry. */ -private predicate dependsOnTDE(Element src, Type t, TypeDeclarationEntry dest) { +private predicate dependsOnTde(Element src, Type t, TypeDeclarationEntry dest) { dependsOnTransitive(src, t) and getDeclarationEntries(t, dest) } @@ -247,8 +247,8 @@ private predicate dependsOnTDE(Element src, Type t, TypeDeclarationEntry dest) { * A dependency that targets a visible TypeDeclarationEntry. */ pragma[noopt] -private predicate dependsOnVisibleTDE(Element src, Type t, TypeDeclarationEntry dest) { - dependsOnTDE(src, t, dest) and +private predicate dependsOnVisibleTde(Element src, Type t, TypeDeclarationEntry dest) { + dependsOnTde(src, t, dest) and exists(File g | g = dest.getFile() | exists(File f | f = src.getFile() | f.getAnIncludedFile*() = g) ) @@ -260,8 +260,8 @@ private predicate dependsOnVisibleTDE(Element src, Type t, TypeDeclarationEntry private predicate dependsOnDeclarationEntry(Element src, DeclarationEntry dest) { exists(Type t | // dependency from a Type use -> unique visible TDE - dependsOnVisibleTDE(src, t, dest) and - strictcount(TypeDeclarationEntry alt | dependsOnVisibleTDE(src, t, alt)) = 1 + dependsOnVisibleTde(src, t, dest) and + strictcount(TypeDeclarationEntry alt | dependsOnVisibleTde(src, t, alt)) = 1 ) or exists(TypedefType mid | diff --git a/cpp/ql/lib/semmle/code/cpp/commons/NULL.qll b/cpp/ql/lib/semmle/code/cpp/commons/NULL.qll index fa6008f1379c..549815482456 100644 --- a/cpp/ql/lib/semmle/code/cpp/commons/NULL.qll +++ b/cpp/ql/lib/semmle/code/cpp/commons/NULL.qll @@ -1,11 +1,14 @@ import semmle.code.cpp.Macro /** A macro defining NULL. */ -class NULLMacro extends Macro { - NULLMacro() { this.getHead() = "NULL" } +class NullMacro extends Macro { + NullMacro() { this.getHead() = "NULL" } } +/** DEPRECATED: Alias for NullMacro */ +deprecated class NULLMacro = NullMacro; + /** A use of the NULL macro. */ class NULL extends Literal { - NULL() { exists(NULLMacro nm | this = nm.getAnInvocation().getAnExpandedElement()) } + NULL() { exists(NullMacro nm | this = nm.getAnInvocation().getAnExpandedElement()) } } diff --git a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/FlowVar.qll b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/FlowVar.qll index 34b2ef5aaf9a..ee76e9aa671b 100644 --- a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/FlowVar.qll +++ b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/FlowVar.qll @@ -474,7 +474,7 @@ module FlowVar_internal { } /** Type-specialized version of `getEnclosingElement`. */ - private ControlFlowNode getCFNParent(ControlFlowNode node) { result = node.getEnclosingElement() } + private ControlFlowNode getCfnParent(ControlFlowNode node) { result = node.getEnclosingElement() } /** * A for-loop or while-loop whose condition is always true upon entry but not @@ -526,7 +526,7 @@ module FlowVar_internal { } private predicate bbInLoopCondition(BasicBlock bb) { - getCFNParent*(bb.getANode()) = this.(Loop).getCondition() + getCfnParent*(bb.getANode()) = this.(Loop).getCondition() } private predicate bbInLoop(BasicBlock bb) { diff --git a/cpp/ql/lib/semmle/code/cpp/valuenumbering/GlobalValueNumberingImpl.qll b/cpp/ql/lib/semmle/code/cpp/valuenumbering/GlobalValueNumberingImpl.qll index d5e69d312548..7dd55dbfde31 100644 --- a/cpp/ql/lib/semmle/code/cpp/valuenumbering/GlobalValueNumberingImpl.qll +++ b/cpp/ql/lib/semmle/code/cpp/valuenumbering/GlobalValueNumberingImpl.qll @@ -165,7 +165,7 @@ private ControlFlowNode mostRecentSideEffect(ControlFlowNode node) { /** Used to represent the "global value number" of an expression. */ cached -private newtype GVNBase = +private newtype GvnBase = GVN_IntConst(int val, Type t) { mk_IntConst(val, t, _) } or GVN_FloatConst(float val, Type t) { mk_FloatConst(val, t, _) } or // If the local variable does not have a defining value, then @@ -221,8 +221,8 @@ private newtype GVNBase = * expression with this `GVN` and using its `toString` and `getLocation` * methods. */ -class GVN extends GVNBase { - GVN() { this instanceof GVNBase } +class GVN extends GvnBase { + GVN() { this instanceof GvnBase } /** Gets an expression that has this GVN. */ Expr getAnExpr() { this = globalValueNumber(result) } diff --git a/cpp/ql/src/Architecture/Refactoring Opportunities/ClassesWithManyFields.ql b/cpp/ql/src/Architecture/Refactoring Opportunities/ClassesWithManyFields.ql index a5f46595f6cd..e7d95091d3db 100644 --- a/cpp/ql/src/Architecture/Refactoring Opportunities/ClassesWithManyFields.ql +++ b/cpp/ql/src/Architecture/Refactoring Opportunities/ClassesWithManyFields.ql @@ -63,17 +63,17 @@ class VariableDeclarationLine extends TVariableDeclarationInfo { /** * Gets a `VariableDeclarationEntry` on this line. */ - VariableDeclarationEntry getAVDE() { vdeInfo(result, c, f, line) } + VariableDeclarationEntry getAVde() { vdeInfo(result, c, f, line) } /** * Gets the start column of the first `VariableDeclarationEntry` on this line. */ - int getStartColumn() { result = min(this.getAVDE().getLocation().getStartColumn()) } + int getStartColumn() { result = min(this.getAVde().getLocation().getStartColumn()) } /** * Gets the end column of the last `VariableDeclarationEntry` on this line. */ - int getEndColumn() { result = max(this.getAVDE().getLocation().getEndColumn()) } + int getEndColumn() { result = max(this.getAVde().getLocation().getEndColumn()) } /** * Gets the rank of this `VariableDeclarationLine` in its file and class @@ -134,13 +134,13 @@ class VariableDeclarationGroup extends VariableDeclarationLine { count(VariableDeclarationLine l | l = this.getProximateNext*() | - l.getAVDE().getVariable().getName() + l.getAVde().getVariable().getName() ) } override string toString() { this.getCount() = 1 and - result = "declaration of " + this.getAVDE().getVariable().getName() + result = "declaration of " + this.getAVde().getVariable().getName() or this.getCount() > 1 and result = "group of " + this.getCount() + " fields here" diff --git a/cpp/ql/src/Best Practices/UseOfGoto.ql b/cpp/ql/src/Best Practices/UseOfGoto.ql index a1dcddc0123f..26d72d69a0a2 100644 --- a/cpp/ql/src/Best Practices/UseOfGoto.ql +++ b/cpp/ql/src/Best Practices/UseOfGoto.ql @@ -16,7 +16,7 @@ import cpp class JumpTarget extends Stmt { JumpTarget() { exists(GotoStmt g | g.getTarget() = this) } - FunctionDeclarationEntry getFDE() { result.getBlock() = this.getParentStmt+() } + FunctionDeclarationEntry getFde() { result.getBlock() = this.getParentStmt+() } predicate isForward() { exists(GotoStmt g | g.getTarget() = this | @@ -33,8 +33,8 @@ class JumpTarget extends Stmt { from FunctionDeclarationEntry fde, int nforward, int nbackward where - nforward = strictcount(JumpTarget t | t.getFDE() = fde and t.isForward()) and - nbackward = strictcount(JumpTarget t | t.getFDE() = fde and t.isBackward()) and + nforward = strictcount(JumpTarget t | t.getFde() = fde and t.isForward()) and + nbackward = strictcount(JumpTarget t | t.getFde() = fde and t.isBackward()) and nforward != 1 and nbackward != 1 select fde, diff --git a/cpp/ql/src/Microsoft/CallWithNullSAL.ql b/cpp/ql/src/Microsoft/CallWithNullSAL.ql index d5c74547c3e9..dcf47fcbf5de 100644 --- a/cpp/ql/src/Microsoft/CallWithNullSAL.ql +++ b/cpp/ql/src/Microsoft/CallWithNullSAL.ql @@ -13,7 +13,7 @@ import SAL from Parameter p, Call c, Expr arg where - any(SALNotNull a).getDeclaration() = p and + any(SalNotNull a).getDeclaration() = p and c.getTarget() = p.getFunction() and arg = c.getArgument(p.getIndex()) and nullValue(arg) diff --git a/cpp/ql/src/Microsoft/IgnoreReturnValueSAL.ql b/cpp/ql/src/Microsoft/IgnoreReturnValueSAL.ql index bf52b2bb6153..8202b2d4b055 100644 --- a/cpp/ql/src/Microsoft/IgnoreReturnValueSAL.ql +++ b/cpp/ql/src/Microsoft/IgnoreReturnValueSAL.ql @@ -18,7 +18,7 @@ from Function f, FunctionCall call where call.getTarget() = f and call instanceof ExprInVoidContext and - any(SALCheckReturn a).getDeclaration() = f and + any(SalCheckReturn a).getDeclaration() = f and not getOptions().okToIgnoreReturnValue(call) select call, "Return value of $@ discarded although a SAL annotation " + "requires inspecting it.", f, f.getName() diff --git a/cpp/ql/src/Microsoft/InconsistentSAL.ql b/cpp/ql/src/Microsoft/InconsistentSAL.ql index e5965e62b493..fcda9e40f459 100644 --- a/cpp/ql/src/Microsoft/InconsistentSAL.ql +++ b/cpp/ql/src/Microsoft/InconsistentSAL.ql @@ -11,7 +11,7 @@ import SAL /** Holds if `e` has SAL annotation `name`. */ predicate hasAnnotation(DeclarationEntry e, string name) { - exists(SALAnnotation a | + exists(SalAnnotation a | a.getMacro().getName() = name and a.getDeclarationEntry() = e ) @@ -21,7 +21,7 @@ predicate hasAnnotation(DeclarationEntry e, string name) { predicate inheritsDeclAnnotations(DeclarationEntry e) { // Is directly annotated e.isDefinition() and - exists(SALAnnotation a | a.getMacro().getName() = "_Use_decl_annotations_" | + exists(SalAnnotation a | a.getMacro().getName() = "_Use_decl_annotations_" | a.getDeclarationEntry() = e ) or diff --git a/cpp/ql/src/Microsoft/SAL.qll b/cpp/ql/src/Microsoft/SAL.qll index 46fedbb5d80c..99102755b2dd 100644 --- a/cpp/ql/src/Microsoft/SAL.qll +++ b/cpp/ql/src/Microsoft/SAL.qll @@ -8,8 +8,8 @@ import cpp /** * A SAL macro defined in `sal.h` or a similar header file. */ -class SALMacro extends Macro { - SALMacro() { +class SalMacro extends Macro { + SalMacro() { this.getFile().getBaseName() = ["sal.h", "specstrings_strict.h", "specstrings.h", "w32p.h", "minwindef.h"] and ( @@ -22,15 +22,18 @@ class SALMacro extends Macro { } } +/** DEPRECATED: Alias for SalMacro */ +deprecated class SALMacro = SalMacro; + pragma[noinline] private predicate isTopLevelMacroAccess(MacroAccess ma) { not exists(ma.getParentInvocation()) } /** * An invocation of a SAL macro (excluding invocations inside other macros). */ -class SALAnnotation extends MacroInvocation { - SALAnnotation() { - this.getMacro() instanceof SALMacro and +class SalAnnotation extends MacroInvocation { + SalAnnotation() { + this.getMacro() instanceof SalMacro and isTopLevelMacroAccess(this) } @@ -47,23 +50,29 @@ class SALAnnotation extends MacroInvocation { } } +/** DEPRECATED: Alias for SalAnnotation */ +deprecated class SALAnnotation = SalAnnotation; + /** * A SAL macro indicating that the return value of a function should always be * checked. */ -class SALCheckReturn extends SALAnnotation { - SALCheckReturn() { - this.getMacro().(SALMacro).getName() = ["_Check_return_", "_Must_inspect_result_"] +class SalCheckReturn extends SalAnnotation { + SalCheckReturn() { + this.getMacro().(SalMacro).getName() = ["_Check_return_", "_Must_inspect_result_"] } } +/** DEPRECATED: Alias for SalCheckReturn */ +deprecated class SALCheckReturn = SalCheckReturn; + /** * A SAL macro indicating that a pointer variable or return value should not be * `NULL`. */ -class SALNotNull extends SALAnnotation { - SALNotNull() { - exists(SALMacro m | m = this.getMacro() | +class SalNotNull extends SalAnnotation { + SalNotNull() { + exists(SalMacro m | m = this.getMacro() | not m.getName().matches("%\\_opt\\_%") and ( m.getName().matches("_In%") or @@ -80,12 +89,15 @@ class SALNotNull extends SALAnnotation { } } +/** DEPRECATED: Alias for SalNotNull */ +deprecated class SALNotNull = SalNotNull; + /** * A SAL macro indicating that a value may be `NULL`. */ -class SALMaybeNull extends SALAnnotation { - SALMaybeNull() { - exists(SALMacro m | m = this.getMacro() | +class SalMaybeNull extends SalAnnotation { + SalMaybeNull() { + exists(SalMacro m | m = this.getMacro() | m.getName().matches("%\\_opt\\_%") or m.getName().matches("\\_Ret_maybenull\\_%") or m.getName() = "_Result_nullonfailure_" @@ -93,14 +105,17 @@ class SALMaybeNull extends SALAnnotation { } } +/** DEPRECATED: Alias for SalMaybeNull */ +deprecated class SALMaybeNull = SalMaybeNull; + /** * A parameter annotated by one or more SAL annotations. */ -class SALParameter extends Parameter { +class SalParameter extends Parameter { /** One of this parameter's annotations. */ - SALAnnotation a; + SalAnnotation a; - SALParameter() { annotatesAt(a, this.getADeclarationEntry(), _, _) } + SalParameter() { annotatesAt(a, this.getADeclarationEntry(), _, _) } predicate isIn() { a.getMacroName().toLowerCase().matches("%\\_in%") } @@ -109,14 +124,17 @@ class SALParameter extends Parameter { predicate isInOut() { a.getMacroName().toLowerCase().matches("%\\_inout%") } } +/** DEPRECATED: Alias for SalParameter */ +deprecated class SALParameter = SalParameter; + /////////////////////////////////////////////////////////////////////////////// // Implementation details /** * Holds if `a` annotates the declaration entry `d` and * its start position is the `idx`th position in `file` that holds a SAL element. */ -private predicate annotatesAt(SALAnnotation a, DeclarationEntry d, File file, int idx) { - annotatesAtPosition(a.(SALElement).getStartPosition(), d, file, idx) +private predicate annotatesAt(SalAnnotation a, DeclarationEntry d, File file, int idx) { + annotatesAtPosition(a.(SalElement).getStartPosition(), d, file, idx) } /** @@ -127,12 +145,12 @@ private predicate annotatesAt(SALAnnotation a, DeclarationEntry d, File file, in // For performance reasons, do not mention the annotation itself here, // but compute with positions instead. This performs better on databases // with many annotations at the same position. -private predicate annotatesAtPosition(SALPosition pos, DeclarationEntry d, File file, int idx) { +private predicate annotatesAtPosition(SalPosition pos, DeclarationEntry d, File file, int idx) { pos = salRelevantPositionAt(file, idx) and salAnnotationPos(pos) and ( // Base case: `pos` right before `d` - d.(SALElement).getStartPosition() = salRelevantPositionAt(file, idx + 1) + d.(SalElement).getStartPosition() = salRelevantPositionAt(file, idx + 1) or // Recursive case: `pos` right before some annotation on `d` annotatesAtPosition(_, d, file, idx + 1) @@ -143,10 +161,10 @@ private predicate annotatesAtPosition(SALPosition pos, DeclarationEntry d, File * A SAL element, that is, a SAL annotation or a declaration entry * that may have SAL annotations. */ -library class SALElement extends Element { - SALElement() { - containsSALAnnotation(this.(DeclarationEntry).getFile()) or - this instanceof SALAnnotation +library class SalElement extends Element { + SalElement() { + containsSalAnnotation(this.(DeclarationEntry).getFile()) or + this instanceof SalAnnotation } predicate hasStartPosition(File file, int line, int col) { @@ -173,25 +191,28 @@ library class SALElement extends Element { ) } - SALPosition getStartPosition() { + SalPosition getStartPosition() { exists(File file, int line, int col | this.hasStartPosition(file, line, col) and - result = MkSALPosition(file, line, col) + result = MkSalPosition(file, line, col) ) } } +/** DEPRECATED: Alias for SalElement */ +deprecated class SALElement = SalElement; + /** Holds if `file` contains a SAL annotation. */ pragma[noinline] -private predicate containsSALAnnotation(File file) { any(SALAnnotation a).getFile() = file } +private predicate containsSalAnnotation(File file) { any(SalAnnotation a).getFile() = file } /** * A source-file position of a `SALElement`. Unlike location, this denotes a * point in the file rather than a range. */ -private newtype SALPosition = - MkSALPosition(File file, int line, int col) { - exists(SALElement e | +private newtype SalPosition = + MkSalPosition(File file, int line, int col) { + exists(SalElement e | e.hasStartPosition(file, line, col) or e.hasEndPosition(file, line, col) @@ -200,18 +221,18 @@ private newtype SALPosition = /** Holds if `pos` is the start position of a SAL annotation. */ pragma[noinline] -private predicate salAnnotationPos(SALPosition pos) { - any(SALAnnotation a).(SALElement).getStartPosition() = pos +private predicate salAnnotationPos(SalPosition pos) { + any(SalAnnotation a).(SalElement).getStartPosition() = pos } /** * Gets the `idx`th position in `file` that holds a SAL element, * ordering positions lexicographically by their start line and start column. */ -private SALPosition salRelevantPositionAt(File file, int idx) { +private SalPosition salRelevantPositionAt(File file, int idx) { result = - rank[idx](SALPosition pos, int line, int col | - pos = MkSALPosition(file, line, col) + rank[idx](SalPosition pos, int line, int col | + pos = MkSalPosition(file, line, col) | pos order by line, col ) diff --git a/cpp/ql/src/Security/CWE/CWE-457/ConditionallyUninitializedVariable.ql b/cpp/ql/src/Security/CWE/CWE-457/ConditionallyUninitializedVariable.ql index 9a08bbd64a67..c062039d9301 100644 --- a/cpp/ql/src/Security/CWE/CWE-457/ConditionallyUninitializedVariable.ql +++ b/cpp/ql/src/Security/CWE/CWE-457/ConditionallyUninitializedVariable.ql @@ -24,7 +24,7 @@ where if e = DefinitionInSnapshot() then defined = "" else - if e = SuggestiveSALAnnotation() + if e = SuggestiveSalAnnotation() then defined = "externally defined (SAL) " else defined = "externally defined (CSV) " ) diff --git a/cpp/ql/src/Security/CWE/CWE-457/InitializationFunctions.qll b/cpp/ql/src/Security/CWE/CWE-457/InitializationFunctions.qll index 29f519163cce..a5def46dd608 100644 --- a/cpp/ql/src/Security/CWE/CWE-457/InitializationFunctions.qll +++ b/cpp/ql/src/Security/CWE/CWE-457/InitializationFunctions.qll @@ -149,7 +149,7 @@ newtype Evidence = * The function is externally defined, but the parameter has an `_out` SAL annotation which * suggests that it is initialized in the function. */ - SuggestiveSALAnnotation() or + SuggestiveSalAnnotation() or /** * We have been given a CSV file which indicates this parameter is conditionally initialized. */ @@ -198,8 +198,8 @@ class InitializationFunction extends Function { or // If we have no definition, we look at SAL annotations not this.hasDefinition() and - this.getParameter(i).(SALParameter).isOut() and - evidence = SuggestiveSALAnnotation() + this.getParameter(i).(SalParameter).isOut() and + evidence = SuggestiveSalAnnotation() or // We have some external information that this function conditionally initializes not this.hasDefinition() and diff --git a/cpp/ql/src/Security/CWE/CWE-611/XXE.ql b/cpp/ql/src/Security/CWE/CWE-611/XXE.ql index da17913dec56..abd1773afd88 100644 --- a/cpp/ql/src/Security/CWE/CWE-611/XXE.ql +++ b/cpp/ql/src/Security/CWE/CWE-611/XXE.ql @@ -19,8 +19,8 @@ import DataFlow::PathGraph /** * A configuration for tracking XML objects and their states. */ -class XXEConfiguration extends DataFlow::Configuration { - XXEConfiguration() { this = "XXEConfiguration" } +class XxeConfiguration extends DataFlow::Configuration { + XxeConfiguration() { this = "XXEConfiguration" } override predicate isSource(DataFlow::Node node, string flowstate) { any(XmlLibrary l).configurationSource(node, flowstate) @@ -45,7 +45,7 @@ class XXEConfiguration extends DataFlow::Configuration { } } -from XXEConfiguration conf, DataFlow::PathNode source, DataFlow::PathNode sink +from XxeConfiguration conf, DataFlow::PathNode source, DataFlow::PathNode sink where conf.hasFlowPath(source, sink) select sink, source, sink, "This $@ is not configured to prevent an XML external entity (XXE) attack.", source, "XML parser" diff --git a/cpp/ql/src/jsf/3.02 Code Size and Complexity/AV Rule 2.ql b/cpp/ql/src/jsf/3.02 Code Size and Complexity/AV Rule 2.ql index 0420b9c3984f..d3f7ac9adb7c 100644 --- a/cpp/ql/src/jsf/3.02 Code Size and Complexity/AV Rule 2.ql +++ b/cpp/ql/src/jsf/3.02 Code Size and Complexity/AV Rule 2.ql @@ -16,17 +16,17 @@ import cpp // pointers. This will obviously not catch code that uses inline assembly to achieve // self-modification, nor will it spot the use of OS mechanisms to write into process // memory (such as WriteProcessMemory under Windows). -predicate maybeSMCConversion(Type t1, Type t2) { +predicate maybeSmcConversion(Type t1, Type t2) { t1 instanceof FunctionPointerType and t2 instanceof PointerType and not t2 instanceof FunctionPointerType and not t2 instanceof VoidPointerType or - maybeSMCConversion(t2, t1) + maybeSmcConversion(t2, t1) } from Expr e where e.fromSource() and - maybeSMCConversion(e.getUnderlyingType(), e.getActualType()) + maybeSmcConversion(e.getUnderlyingType(), e.getActualType()) select e, "AV Rule 2: There shall not be any self-modifying code." diff --git a/cpp/ql/test/library-tests/pod/isPOD.ql b/cpp/ql/test/library-tests/pod/isPOD.ql index e7860247eb7b..77f7e1360196 100644 --- a/cpp/ql/test/library-tests/pod/isPOD.ql +++ b/cpp/ql/test/library-tests/pod/isPOD.ql @@ -1,5 +1,5 @@ import cpp from Class c, boolean ispod -where if c.isPOD() then ispod = true else ispod = false +where if c.isPod() then ispod = true else ispod = false select c, ispod diff --git a/cpp/ql/test/library-tests/pod/isPOD03.ql b/cpp/ql/test/library-tests/pod/isPOD03.ql index 42f6eed559f6..84f2433f8da3 100644 --- a/cpp/ql/test/library-tests/pod/isPOD03.ql +++ b/cpp/ql/test/library-tests/pod/isPOD03.ql @@ -1,5 +1,5 @@ import semmle.code.cpp.PODType03 from Class c, boolean ispod -where if isPODClass03(c) then ispod = true else ispod = false +where if isPodClass03(c) then ispod = true else ispod = false select c, ispod diff --git a/cpp/ql/test/library-tests/sal/sal.ql b/cpp/ql/test/library-tests/sal/sal.ql index eb4908bae9ea..52104793d3eb 100644 --- a/cpp/ql/test/library-tests/sal/sal.ql +++ b/cpp/ql/test/library-tests/sal/sal.ql @@ -1,4 +1,4 @@ import Microsoft.SAL -from SALAnnotation a +from SalAnnotation a select a, a.getDeclaration() diff --git a/csharp/ql/campaigns/Solorigate/src/ModifiedFnvFunctionDetection.ql b/csharp/ql/campaigns/Solorigate/src/ModifiedFnvFunctionDetection.ql index e9f81596e047..5e4a47f7ec0e 100644 --- a/csharp/ql/campaigns/Solorigate/src/ModifiedFnvFunctionDetection.ql +++ b/csharp/ql/campaigns/Solorigate/src/ModifiedFnvFunctionDetection.ql @@ -15,7 +15,7 @@ import experimental.code.csharp.Cryptography.NonCryptographicHashes from Variable v, Literal l, LoopStmt loop, Expr additional_xor where - maybeUsedInFNVFunction(v, _, _, loop) and + maybeUsedInFnvFunction(v, _, _, loop) and ( exists(BitwiseXorExpr xor2 | xor2.getAnOperand() = l and additional_xor = xor2 | loop.getAControlFlowExitNode().getASuccessor*() = xor2.getAControlFlowNode() and diff --git a/csharp/ql/lib/experimental/code/csharp/Cryptography/NonCryptographicHashes.qll b/csharp/ql/lib/experimental/code/csharp/Cryptography/NonCryptographicHashes.qll index 03585e32a775..28de629816d5 100644 --- a/csharp/ql/lib/experimental/code/csharp/Cryptography/NonCryptographicHashes.qll +++ b/csharp/ql/lib/experimental/code/csharp/Cryptography/NonCryptographicHashes.qll @@ -13,7 +13,7 @@ private import semmle.code.csharp.dataflow.TaintTracking2 predicate maybeANonCryptogrphicHash(Callable callable, Variable v, Expr xor, Expr mul, LoopStmt loop) { callable = loop.getEnclosingCallable() and ( - maybeUsedInFNVFunction(v, xor, mul, loop) or + maybeUsedInFnvFunction(v, xor, mul, loop) or maybeUsedInElfHashFunction(v, xor, mul, loop) ) } @@ -23,7 +23,7 @@ predicate maybeANonCryptogrphicHash(Callable callable, Variable v, Expr xor, Exp * where there is a loop statement `loop` where the variable `v` is used in an xor `xor` expression * followed by a multiplication `mul` expression. */ -predicate maybeUsedInFNVFunction(Variable v, Operation xor, Operation mul, LoopStmt loop) { +predicate maybeUsedInFnvFunction(Variable v, Operation xor, Operation mul, LoopStmt loop) { exists(Expr e1, Expr e2 | e1.getAChild*() = v.getAnAccess() and e2.getAChild*() = v.getAnAccess() and @@ -37,6 +37,9 @@ predicate maybeUsedInFNVFunction(Variable v, Operation xor, Operation mul, LoopS loop.getAChild*() = xor.getEnclosingStmt() } +/** DEPRECATED: Alias for maybeUsedInFnvFunction */ +deprecated predicate maybeUsedInFNVFunction = maybeUsedInFnvFunction/4; + /** * Holds if the arguments are used in a way that resembles an Elf-Hash hash function * where there is a loop statement `loop` where the variable `v` is used in an xor `xor` expression diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/Remote.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/Remote.qll index b194ad57d57b..0770a948b095 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/Remote.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/Remote.qll @@ -6,7 +6,7 @@ import csharp private import Email::Email private import ExternalLocationSink private import Html -private import semmle.code.csharp.security.dataflow.XSSSinks as XSSSinks +private import semmle.code.csharp.security.dataflow.XSSSinks as XssSinks private import semmle.code.csharp.frameworks.system.web.UI /** A data flow sink of remote user output. */ diff --git a/csharp/ql/src/Security Features/InsufficientKeySize.ql b/csharp/ql/src/Security Features/InsufficientKeySize.ql index 7e1b1bd6de4b..1a712467b890 100644 --- a/csharp/ql/src/Security Features/InsufficientKeySize.ql +++ b/csharp/ql/src/Security Features/InsufficientKeySize.ql @@ -24,7 +24,7 @@ predicate incorrectUseOfRC2(Assignment e, string msg) { msg = "Key size should be at least 128 bits for RC2 encryption." } -predicate incorrectUseOfDSA(ObjectCreation e, string msg) { +predicate incorrectUseOfDsa(ObjectCreation e, string msg) { e.getTarget() .getDeclaringType() .hasQualifiedName("System.Security.Cryptography", "DSACryptoServiceProvider") and @@ -32,7 +32,7 @@ predicate incorrectUseOfDSA(ObjectCreation e, string msg) { msg = "Key size should be at least 2048 bits for DSA encryption." } -predicate incorrectUseOfRSA(ObjectCreation e, string msg) { +predicate incorrectUseOfRsa(ObjectCreation e, string msg) { e.getTarget() .getDeclaringType() .hasQualifiedName("System.Security.Cryptography", "RSACryptoServiceProvider") and @@ -43,6 +43,6 @@ predicate incorrectUseOfRSA(ObjectCreation e, string msg) { from Expr e, string msg where incorrectUseOfRC2(e, msg) or - incorrectUseOfDSA(e, msg) or - incorrectUseOfRSA(e, msg) + incorrectUseOfDsa(e, msg) or + incorrectUseOfRsa(e, msg) select e, msg diff --git a/csharp/ql/src/experimental/ir/implementation/raw/internal/InstructionTag.qll b/csharp/ql/src/experimental/ir/implementation/raw/internal/InstructionTag.qll index b97981876d4e..3ec2d8462544 100644 --- a/csharp/ql/src/experimental/ir/implementation/raw/internal/InstructionTag.qll +++ b/csharp/ql/src/experimental/ir/implementation/raw/internal/InstructionTag.qll @@ -65,7 +65,7 @@ newtype TInstructionTag = PointerAddTag(int index) { index in [0 .. 255] } or ElementsAddressTag(int index) { index in [0 .. 255] } or ConvertTag() or - GeneratedNEQTag() or + GeneratedNeqTag() or GeneratedConstantTag() or GeneratedBranchTag() @@ -181,7 +181,7 @@ string getInstructionTagId(TInstructionTag tag) { or tag = ConvertTag() and result = "Convert" or - tag = GeneratedNEQTag() and result = "GeneratedNEQTag" + tag = GeneratedNeqTag() and result = "GeneratedNEQTag" or tag = GeneratedConstantTag() and result = "GeneratedConstantTag" or diff --git a/csharp/ql/src/experimental/ir/implementation/raw/internal/TranslatedExpr.qll b/csharp/ql/src/experimental/ir/implementation/raw/internal/TranslatedExpr.qll index 08b246558b19..1bcca4015651 100644 --- a/csharp/ql/src/experimental/ir/implementation/raw/internal/TranslatedExpr.qll +++ b/csharp/ql/src/experimental/ir/implementation/raw/internal/TranslatedExpr.qll @@ -1710,7 +1710,7 @@ class TranslatedIsExpr extends TranslatedNonConstantExpr { result = this.getParent().getChildSuccessor(this) or ( - tag = GeneratedNEQTag() and + tag = GeneratedNeqTag() and kind instanceof GotoEdge and if this.hasVar() then result = this.getInstruction(GeneratedBranchTag()) @@ -1733,7 +1733,7 @@ class TranslatedIsExpr extends TranslatedNonConstantExpr { kind instanceof GotoEdge and if this.hasVar() then result = this.getPatternVarDecl().getFirstInstruction() - else result = this.getInstruction(GeneratedNEQTag()) + else result = this.getInstruction(GeneratedNeqTag()) } override Instruction getChildSuccessor(TranslatedElement child) { @@ -1742,7 +1742,7 @@ class TranslatedIsExpr extends TranslatedNonConstantExpr { or this.hasVar() and child = this.getPatternVarDecl() and - result = this.getInstruction(GeneratedNEQTag()) + result = this.getInstruction(GeneratedNeqTag()) } override predicate hasInstruction(Opcode opcode, InstructionTag tag, CSharpType resultType) { @@ -1755,7 +1755,7 @@ class TranslatedIsExpr extends TranslatedNonConstantExpr { opcode instanceof Opcode::CheckedConvertOrNull and resultType = getTypeForPRValue(expr.getPattern().getType()) or - tag = GeneratedNEQTag() and + tag = GeneratedNeqTag() and opcode instanceof Opcode::CompareNE and resultType = getTypeForPRValue(expr.getType()) or @@ -1775,7 +1775,7 @@ class TranslatedIsExpr extends TranslatedNonConstantExpr { result = "0" } - override Instruction getResult() { result = this.getInstruction(GeneratedNEQTag()) } + override Instruction getResult() { result = this.getInstruction(GeneratedNeqTag()) } override Instruction getInstructionOperand(InstructionTag tag, OperandTag operandTag) { tag = ConvertTag() and @@ -1792,7 +1792,7 @@ class TranslatedIsExpr extends TranslatedNonConstantExpr { result = this.getPatternVarDecl().getTargetAddress() ) or - tag = GeneratedNEQTag() and + tag = GeneratedNeqTag() and ( operandTag instanceof LeftOperandTag and result = this.getInstruction(ConvertTag()) @@ -1804,7 +1804,7 @@ class TranslatedIsExpr extends TranslatedNonConstantExpr { this.hasVar() and tag = GeneratedBranchTag() and operandTag instanceof ConditionOperandTag and - result = this.getInstruction(GeneratedNEQTag()) + result = this.getInstruction(GeneratedNeqTag()) } private TranslatedExpr getIsExpr() { result = getTranslatedExpr(expr.getExpr()) } diff --git a/go/ql/lib/semmle/go/Util.qll b/go/ql/lib/semmle/go/Util.qll index ff597cdcc28a..8c089054d90b 100644 --- a/go/ql/lib/semmle/go/Util.qll +++ b/go/ql/lib/semmle/go/Util.qll @@ -12,7 +12,10 @@ class Boolean extends boolean { /** * Gets a regexp pattern that matches common top-level domain names. */ -string commonTLD() { +string commonTld() { // according to ranking by http://google.com/search?q=site:.<> result = "(?:com|org|edu|gov|uk|net|io)(?![a-z0-9])" } + +/** DEPRECATED: Alias for commonTld */ +deprecated string commonTLD() { result = commonTld() } diff --git a/go/ql/lib/semmle/go/dataflow/GlobalValueNumbering.qll b/go/ql/lib/semmle/go/dataflow/GlobalValueNumbering.qll index c9c0c58b33ef..511bbd4ddce6 100644 --- a/go/ql/lib/semmle/go/dataflow/GlobalValueNumbering.qll +++ b/go/ql/lib/semmle/go/dataflow/GlobalValueNumbering.qll @@ -114,7 +114,7 @@ private predicate entryNode(ControlFlow::Node node) { node.isEntryNode() } * graph so that we can use the dominator tree to find the most recent * side-effect. */ -private predicate sideEffectCFG(ControlFlow::Node src, ControlFlow::Node dst) { +private predicate sideEffectCfg(ControlFlow::Node src, ControlFlow::Node dst) { src.getASuccessor() = dst or // Add an edge from the entry point to any node that might have a side @@ -128,7 +128,7 @@ private predicate sideEffectCFG(ControlFlow::Node src, ControlFlow::Node dst) { * the side-effect CFG. */ private predicate iDomEffect(ControlFlow::Node dominator, ControlFlow::Node node) = - idominance(entryNode/1, sideEffectCFG/2)(_, dominator, node) + idominance(entryNode/1, sideEffectCfg/2)(_, dominator, node) /** * Gets the most recent side effect. To be more precise, `result` is a @@ -190,7 +190,7 @@ private ControlFlow::Node mostRecentSideEffect(ControlFlow::Node node) { /** Used to represent the "global value number" of an expression. */ cached -private newtype GVNBase = +private newtype GvnBase = MkNumericConst(string val) { mkNumericConst(_, val) } or MkStringConst(string val) { mkStringConst(_, val) } or MkBoolConst(boolean val) { mkBoolConst(_, val) } or @@ -204,7 +204,7 @@ private newtype GVNBase = MkOtherVariable(ValueEntity x, ControlFlow::Node dominator) { mkOtherVariable(_, x, dominator) } or MkMethodAccess(GVN base, Function m) { mkMethodAccess(_, base, m) } or MkFieldRead(GVN base, Field f, ControlFlow::Node dominator) { mkFieldRead(_, base, f, dominator) } or - MkPureCall(Function f, GVN callee, GVNList args) { mkPureCall(_, f, callee, args) } or + MkPureCall(Function f, GVN callee, GvnList args) { mkPureCall(_, f, callee, args) } or MkIndex(GVN base, GVN index, ControlFlow::Node dominator) { mkIndex(_, base, index, dominator) } or // Dereference a pointer. The value might have changed since the last // time the pointer was dereferenced, so we need to include a definition @@ -217,22 +217,22 @@ private newtype GVNBase = // given a unique number based on the expression itself. MkUnanalyzable(DataFlow::Node e) { not analyzableExpr(e) } -private newtype GVNList = +private newtype GvnList = MkNil() or - MkCons(GVN head, GVNList tail) { globalValueNumbers(_, _, head, tail) } + MkCons(GVN head, GvnList tail) { globalValueNumbers(_, _, head, tail) } -private GVNList globalValueNumbers(DataFlow::CallNode ce, int start) { +private GvnList globalValueNumbers(DataFlow::CallNode ce, int start) { analyzableCall(ce, _) and start = ce.getNumArgument() and result = MkNil() or - exists(GVN head, GVNList tail | + exists(GVN head, GvnList tail | globalValueNumbers(ce, start, head, tail) and result = MkCons(head, tail) ) } -private predicate globalValueNumbers(DataFlow::CallNode ce, int start, GVN head, GVNList tail) { +private predicate globalValueNumbers(DataFlow::CallNode ce, int start, GVN head, GvnList tail) { analyzableCall(ce, _) and head = globalValueNumber(ce.getArgument(start)) and tail = globalValueNumbers(ce, start + 1) @@ -254,8 +254,8 @@ private predicate globalValueNumbers(DataFlow::CallNode ce, int start, GVN head, * expression with this `GVN` and using its `toString` and `getLocation` * methods. */ -class GVN extends GVNBase { - GVN() { this instanceof GVNBase } +class GVN extends GvnBase { + GVN() { this instanceof GvnBase } /** Gets a data-flow node that has this GVN. */ DataFlow::Node getANode() { this = globalValueNumber(result) } @@ -386,7 +386,7 @@ private predicate analyzableCall(DataFlow::CallNode ce, Function f) { not ce.isConst() } -private predicate mkPureCall(DataFlow::CallNode ce, Function f, GVN callee, GVNList args) { +private predicate mkPureCall(DataFlow::CallNode ce, Function f, GVN callee, GvnList args) { analyzableCall(ce, f) and callee = globalValueNumber(ce.getCalleeNode()) and args = globalValueNumbers(ce, 0) @@ -523,7 +523,7 @@ GVN globalValueNumber(DataFlow::Node nd) { result = MkFieldRead(qualifier, target, dominator) ) or - exists(Function f, GVN callee, GVNList args | + exists(Function f, GVN callee, GvnList args | mkPureCall(nd, f, callee, args) and result = MkPureCall(f, callee, args) ) diff --git a/go/ql/src/RedundantCode/DuplicateCondition.ql b/go/ql/src/RedundantCode/DuplicateCondition.ql index ac3c586eda41..3d7416450dc8 100644 --- a/go/ql/src/RedundantCode/DuplicateCondition.ql +++ b/go/ql/src/RedundantCode/DuplicateCondition.ql @@ -24,10 +24,10 @@ Expr getCondition(IfStmt stmt, int i) { } /** Gets the global value number of `e`, which is the `i`th condition of `is`. */ -GVN conditionGVN(IfStmt is, int i, Expr e) { +GVN conditionGvn(IfStmt is, int i, Expr e) { e = getCondition(is, i) and result = e.getGlobalValueNumber() } from IfStmt is, Expr e, Expr f, int i, int j -where conditionGVN(is, i, e) = conditionGVN(is, j, f) and i < j +where conditionGvn(is, i, e) = conditionGvn(is, j, f) and i < j select f, "This condition is a duplicate of $@.", e, "an earlier condition" diff --git a/go/ql/src/RedundantCode/DuplicateSwitchCase.ql b/go/ql/src/RedundantCode/DuplicateSwitchCase.ql index 7af97b768751..b2777a1131f0 100644 --- a/go/ql/src/RedundantCode/DuplicateSwitchCase.ql +++ b/go/ql/src/RedundantCode/DuplicateSwitchCase.ql @@ -14,10 +14,10 @@ import go /** Gets the global value number of `e`, which is the `i`th case label of `switch`. */ -GVN switchCaseGVN(SwitchStmt switch, int i, Expr e) { +GVN switchCaseGvn(SwitchStmt switch, int i, Expr e) { e = switch.getCase(i).getExpr(0) and result = e.getGlobalValueNumber() } from SwitchStmt switch, int i, Expr e, int j, Expr f -where switchCaseGVN(switch, i, e) = switchCaseGVN(switch, j, f) and i < j +where switchCaseGvn(switch, i, e) = switchCaseGvn(switch, j, f) and i < j select f, "This case is a duplicate of $@.", e, "an earlier case" diff --git a/go/ql/src/Security/CWE-020/IncompleteHostnameRegexp.ql b/go/ql/src/Security/CWE-020/IncompleteHostnameRegexp.ql index ef0ec60d871d..a6ce8c8c8b6d 100644 --- a/go/ql/src/Security/CWE-020/IncompleteHostnameRegexp.ql +++ b/go/ql/src/Security/CWE-020/IncompleteHostnameRegexp.ql @@ -28,7 +28,7 @@ predicate isIncompleteHostNameRegexpPattern(string pattern, string hostPart) { "(? reference, * or the bean object itself. */ -class CamelJavaDSLBeanDecl extends ProcessorDefinitionElement { - CamelJavaDSLBeanDecl() { getMethod().hasName("bean") } +class CamelJavaDslBeanDecl extends ProcessorDefinitionElement { + CamelJavaDslBeanDecl() { getMethod().hasName("bean") } /** * Gets a bean class that may be registered as a target by this `bean()` declaration. @@ -71,6 +74,9 @@ class CamelJavaDSLBeanDecl extends ProcessorDefinitionElement { } } +/** DEPRECATED: Alias for CamelJavaDslBeanDecl */ +deprecated class CamelJavaDSLBeanDecl = CamelJavaDslBeanDecl; + /** * A declaration of a "beanRef" target in the Apache Camel Java DSL. * @@ -78,8 +84,8 @@ class CamelJavaDSLBeanDecl extends ProcessorDefinitionElement { * the bean reference is dependent on which registries are used by Apache Camel, but we make the * assumption that it either represetns a qualified name, or a Srping bean identifier. */ -class CamelJavaDSLBeanRefDecl extends ProcessorDefinitionElement { - CamelJavaDSLBeanRefDecl() { getMethod().hasName("beanRef") } +class CamelJavaDslBeanRefDecl extends ProcessorDefinitionElement { + CamelJavaDslBeanRefDecl() { getMethod().hasName("beanRef") } /** * Gets the string describing the bean referred to. @@ -98,13 +104,16 @@ class CamelJavaDSLBeanRefDecl extends ProcessorDefinitionElement { } } +/** DEPRECATED: Alias for CamelJavaDslBeanRefDecl */ +deprecated class CamelJavaDSLBeanRefDecl = CamelJavaDslBeanRefDecl; + /** * A "method" Camel expression in the Apache Camel Java DSL. * * An expression that represents a call to a bean, or particular method on a bean. */ -class CamelJavaDSLMethodDecl extends MethodAccess { - CamelJavaDSLMethodDecl() { +class CamelJavaDslMethodDecl extends MethodAccess { + CamelJavaDslMethodDecl() { getMethod() .getDeclaringType() .getSourceDeclaration() @@ -129,3 +138,6 @@ class CamelJavaDSLMethodDecl extends MethodAccess { else result = getArgument(0).getType() } } + +/** DEPRECATED: Alias for CamelJavaDslMethodDecl */ +deprecated class CamelJavaDSLMethodDecl = CamelJavaDslMethodDecl; diff --git a/java/ql/lib/semmle/code/java/security/CleartextStorageClassQuery.qll b/java/ql/lib/semmle/code/java/security/CleartextStorageClassQuery.qll index a236d4d8af64..3fe06a2de08d 100644 --- a/java/ql/lib/semmle/code/java/security/CleartextStorageClassQuery.qll +++ b/java/ql/lib/semmle/code/java/security/CleartextStorageClassQuery.qll @@ -49,7 +49,7 @@ private class Serializable extends ClassStore { /** The instantiation of a marshallable class, which can be stored to disk as XML. */ private class Marshallable extends ClassStore { - Marshallable() { this.getConstructor().getDeclaringType() instanceof JAXBElement } + Marshallable() { this.getConstructor().getDeclaringType() instanceof JaxbElement } /** Gets a store, for example `marshaller.marshal(instance)`. */ override Expr getAStore() { @@ -69,7 +69,7 @@ private Expr getInstanceInput(DataFlow::Node instance, RefType t) { fa.getField().getDeclaringType() = t | t.getASourceSupertype*() instanceof TypeSerializable or - t instanceof JAXBElement + t instanceof JaxbElement ) } @@ -98,7 +98,7 @@ private predicate serializableStore(DataFlow::Node instance, Expr store) { private predicate marshallableStore(DataFlow::Node instance, Expr store) { exists(MethodAccess m | store = m and - m.getMethod() instanceof JAXBMarshalMethod and + m.getMethod() instanceof JaxbMarshalMethod and instance.asExpr() = m.getArgument(0) ) } diff --git a/java/ql/lib/semmle/code/java/security/JndiInjection.qll b/java/ql/lib/semmle/code/java/security/JndiInjection.qll index 543ce2bc8597..9dca731af80e 100644 --- a/java/ql/lib/semmle/code/java/security/JndiInjection.qll +++ b/java/ql/lib/semmle/code/java/security/JndiInjection.qll @@ -176,7 +176,7 @@ private predicate nameAddStep(DataFlow::ExprNode n1, DataFlow::ExprNode n2) { * by calling `new JMXServiceURL(tainted)`. */ private predicate jmxServiceUrlStep(DataFlow::ExprNode n1, DataFlow::ExprNode n2) { - exists(ConstructorCall cc | cc.getConstructedType() instanceof TypeJMXServiceURL | + exists(ConstructorCall cc | cc.getConstructedType() instanceof TypeJmxServiceUrl | n1.asExpr() = cc.getAnArgument() and n2.asExpr() = cc ) @@ -189,7 +189,7 @@ private predicate jmxServiceUrlStep(DataFlow::ExprNode n1, DataFlow::ExprNode n2 private predicate jmxConnectorStep(DataFlow::ExprNode n1, DataFlow::ExprNode n2) { exists(MethodAccess ma, Method m | n1.asExpr() = ma.getArgument(0) and n2.asExpr() = ma | ma.getMethod() = m and - m.getDeclaringType() instanceof TypeJMXConnectorFactory and + m.getDeclaringType() instanceof TypeJmxConnectorFactory and m.hasName("newJMXConnector") ) } @@ -199,7 +199,7 @@ private predicate jmxConnectorStep(DataFlow::ExprNode n1, DataFlow::ExprNode n2) * `RMIConnector` by calling `new RMIConnector(tainted)`. */ private predicate rmiConnectorStep(DataFlow::ExprNode n1, DataFlow::ExprNode n2) { - exists(ConstructorCall cc | cc.getConstructedType() instanceof TypeRMIConnector | + exists(ConstructorCall cc | cc.getConstructedType() instanceof TypeRmiConnector | n1.asExpr() = cc.getAnArgument() and n2.asExpr() = cc ) diff --git a/java/ql/lib/semmle/code/java/security/LdapInjection.qll b/java/ql/lib/semmle/code/java/security/LdapInjection.qll index 54e0dff2eb2e..35c59279f4ee 100644 --- a/java/ql/lib/semmle/code/java/security/LdapInjection.qll +++ b/java/ql/lib/semmle/code/java/security/LdapInjection.qll @@ -140,8 +140,8 @@ private predicate filterStep(DataFlow::ExprNode n1, DataFlow::ExprNode n2) { ma.getMethod() = m | m instanceof MethodUnboundIdFilterCreate or - m instanceof MethodUnboundIdFilterCreateANDFilter or - m instanceof MethodUnboundIdFilterCreateNOTFilter or + m instanceof MethodUnboundIdFilterCreateAndFilter or + m instanceof MethodUnboundIdFilterCreateNotFilter or m instanceof MethodUnboundIdFilterCreateORFilter or m instanceof MethodUnboundIdFilterSimplifyFilter ) diff --git a/java/ql/src/Violations of Best Practice/Exception Handling/NumberFormatException.ql b/java/ql/src/Violations of Best Practice/Exception Handling/NumberFormatException.ql index 2b48745a01ca..6a7928b4561b 100644 --- a/java/ql/src/Violations of Best Practice/Exception Handling/NumberFormatException.ql +++ b/java/ql/src/Violations of Best Practice/Exception Handling/NumberFormatException.ql @@ -15,10 +15,10 @@ import semmle.code.java.NumberFormatException from Expr e where - throwsNFE(e) and + throwsNfe(e) and not exists(TryStmt t | t.getBlock() = e.getEnclosingStmt().getEnclosingStmt*() and - catchesNFE(t) + catchesNfe(t) ) and not exists(Callable c | e.getEnclosingCallable() = c and diff --git a/java/ql/src/experimental/Security/CWE/CWE-326/InsufficientKeySize.ql b/java/ql/src/experimental/Security/CWE/CWE-326/InsufficientKeySize.ql index f917936a33f2..4510bbbc869a 100644 --- a/java/ql/src/experimental/Security/CWE/CWE-326/InsufficientKeySize.ql +++ b/java/ql/src/experimental/Security/CWE/CWE-326/InsufficientKeySize.ql @@ -117,12 +117,12 @@ predicate hasShortAsymmetricKeyPair(MethodAccess ma, string msg, string type) { } /** Holds if a DSA `KeyPairGenerator` initialized by `ma` uses an insufficient key size. `msg` provides a human-readable description of the problem. */ -predicate hasShortDSAKeyPair(MethodAccess ma, string msg) { +predicate hasShortDsaKeyPair(MethodAccess ma, string msg) { hasShortAsymmetricKeyPair(ma, msg, "DSA") or hasShortAsymmetricKeyPair(ma, msg, "DH") } /** Holds if a RSA `KeyPairGenerator` initialized by `ma` uses an insufficient key size. `msg` provides a human-readable description of the problem. */ -predicate hasShortRSAKeyPair(MethodAccess ma, string msg) { +predicate hasShortRsaKeyPair(MethodAccess ma, string msg) { hasShortAsymmetricKeyPair(ma, msg, "RSA") } @@ -147,7 +147,7 @@ predicate hasShortECKeyPair(MethodAccess ma, string msg) { from Expr e, string msg where hasShortAESKey(e, msg) or - hasShortDSAKeyPair(e, msg) or - hasShortRSAKeyPair(e, msg) or + hasShortDsaKeyPair(e, msg) or + hasShortRsaKeyPair(e, msg) or hasShortECKeyPair(e, msg) select e, msg diff --git a/java/ql/src/experimental/Security/CWE/CWE-755/NFEAndroidDoS.ql b/java/ql/src/experimental/Security/CWE/CWE-755/NFEAndroidDoS.ql index b737c460fa99..9793430a2ee8 100644 --- a/java/ql/src/experimental/Security/CWE/CWE-755/NFEAndroidDoS.ql +++ b/java/ql/src/experimental/Security/CWE/CWE-755/NFEAndroidDoS.ql @@ -21,8 +21,8 @@ import DataFlow::PathGraph /** * Taint configuration tracking flow from untrusted inputs to number conversion calls in exported Android compononents. */ -class NFELocalDoSConfiguration extends TaintTracking::Configuration { - NFELocalDoSConfiguration() { this = "NFELocalDoSConfiguration" } +class NfeLocalDoSConfiguration extends TaintTracking::Configuration { + NfeLocalDoSConfiguration() { this = "NFELocalDoSConfiguration" } /** Holds if source is a remote flow source */ override predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource } @@ -31,17 +31,17 @@ class NFELocalDoSConfiguration extends TaintTracking::Configuration { override predicate isSink(DataFlow::Node sink) { exists(Expr e | e.getEnclosingCallable().getDeclaringType().(ExportableAndroidComponent).isExported() and - throwsNFE(e) and + throwsNfe(e) and not exists(TryStmt t | t.getBlock() = e.getAnEnclosingStmt() and - catchesNFE(t) + catchesNfe(t) ) and sink.asExpr() = e ) } } -from DataFlow::PathNode source, DataFlow::PathNode sink, NFELocalDoSConfiguration conf +from DataFlow::PathNode source, DataFlow::PathNode sink, NfeLocalDoSConfiguration conf where conf.hasFlowPath(source, sink) select sink.getNode(), source, sink, "Uncaught NumberFormatException in an exported Android component due to $@.", source.getNode(), diff --git a/javascript/ql/experimental/adaptivethreatmodeling/modelbuilding/DebugResultInclusion.ql b/javascript/ql/experimental/adaptivethreatmodeling/modelbuilding/DebugResultInclusion.ql index 215103358ead..28a95268a573 100644 --- a/javascript/ql/experimental/adaptivethreatmodeling/modelbuilding/DebugResultInclusion.ql +++ b/javascript/ql/experimental/adaptivethreatmodeling/modelbuilding/DebugResultInclusion.ql @@ -15,16 +15,16 @@ import extraction.ExtractEndpointData string getAReasonSinkExcluded(DataFlow::Node sinkCandidate, Query query) { query instanceof NosqlInjectionQuery and - result = NosqlInjectionATM::SinkEndpointFilter::getAReasonSinkExcluded(sinkCandidate) + result = NosqlInjectionAtm::SinkEndpointFilter::getAReasonSinkExcluded(sinkCandidate) or query instanceof SqlInjectionQuery and - result = SqlInjectionATM::SinkEndpointFilter::getAReasonSinkExcluded(sinkCandidate) + result = SqlInjectionAtm::SinkEndpointFilter::getAReasonSinkExcluded(sinkCandidate) or query instanceof TaintedPathQuery and - result = TaintedPathATM::SinkEndpointFilter::getAReasonSinkExcluded(sinkCandidate) + result = TaintedPathAtm::SinkEndpointFilter::getAReasonSinkExcluded(sinkCandidate) or query instanceof XssQuery and - result = XssATM::SinkEndpointFilter::getAReasonSinkExcluded(sinkCandidate) + result = XssAtm::SinkEndpointFilter::getAReasonSinkExcluded(sinkCandidate) } pragma[inline] diff --git a/javascript/ql/experimental/adaptivethreatmodeling/modelbuilding/extraction/ExtractEndpointData.qll b/javascript/ql/experimental/adaptivethreatmodeling/modelbuilding/extraction/ExtractEndpointData.qll index 53d559d25683..af91933b7a4b 100644 --- a/javascript/ql/experimental/adaptivethreatmodeling/modelbuilding/extraction/ExtractEndpointData.qll +++ b/javascript/ql/experimental/adaptivethreatmodeling/modelbuilding/extraction/ExtractEndpointData.qll @@ -14,10 +14,26 @@ import experimental.adaptivethreatmodeling.EndpointFeatures as EndpointFeatures import experimental.adaptivethreatmodeling.EndpointScoring as EndpointScoring import experimental.adaptivethreatmodeling.EndpointTypes import experimental.adaptivethreatmodeling.FilteringReasons -import experimental.adaptivethreatmodeling.NosqlInjectionATM as NosqlInjectionATM -import experimental.adaptivethreatmodeling.SqlInjectionATM as SqlInjectionATM -import experimental.adaptivethreatmodeling.TaintedPathATM as TaintedPathATM -import experimental.adaptivethreatmodeling.XssATM as XssATM +import experimental.adaptivethreatmodeling.NosqlInjectionATM as NosqlInjectionAtm + +/** DEPRECATED: Alias for NosqlInjectionAtm */ +deprecated module NosqlInjectionATM = NosqlInjectionAtm; + +import experimental.adaptivethreatmodeling.SqlInjectionATM as SqlInjectionAtm + +/** DEPRECATED: Alias for SqlInjectionAtm */ +deprecated module SqlInjectionATM = SqlInjectionAtm; + +import experimental.adaptivethreatmodeling.TaintedPathATM as TaintedPathAtm + +/** DEPRECATED: Alias for TaintedPathAtm */ +deprecated module TaintedPathATM = TaintedPathAtm; + +import experimental.adaptivethreatmodeling.XssATM as XssAtm + +/** DEPRECATED: Alias for XssAtm */ +deprecated module XssATM = XssAtm; + import Labels import NoFeaturizationRestrictionsConfig import Queries @@ -25,13 +41,13 @@ import Queries /** Gets the ATM configuration object for the specified query. */ AtmConfig getAtmCfg(Query query) { query instanceof NosqlInjectionQuery and - result instanceof NosqlInjectionATM::NosqlInjectionAtmConfig + result instanceof NosqlInjectionAtm::NosqlInjectionAtmConfig or - query instanceof SqlInjectionQuery and result instanceof SqlInjectionATM::SqlInjectionAtmConfig + query instanceof SqlInjectionQuery and result instanceof SqlInjectionAtm::SqlInjectionAtmConfig or - query instanceof TaintedPathQuery and result instanceof TaintedPathATM::TaintedPathAtmConfig + query instanceof TaintedPathQuery and result instanceof TaintedPathAtm::TaintedPathAtmConfig or - query instanceof XssQuery and result instanceof XssATM::DomBasedXssAtmConfig + query instanceof XssQuery and result instanceof XssAtm::DomBasedXssAtmConfig } /** DEPRECATED: Alias for getAtmCfg */ @@ -39,13 +55,13 @@ deprecated ATMConfig getATMCfg(Query query) { result = getAtmCfg(query) } /** Gets the ATM data flow configuration for the specified query. */ DataFlow::Configuration getDataFlowCfg(Query query) { - query instanceof NosqlInjectionQuery and result instanceof NosqlInjectionATM::Configuration + query instanceof NosqlInjectionQuery and result instanceof NosqlInjectionAtm::Configuration or - query instanceof SqlInjectionQuery and result instanceof SqlInjectionATM::Configuration + query instanceof SqlInjectionQuery and result instanceof SqlInjectionAtm::Configuration or - query instanceof TaintedPathQuery and result instanceof TaintedPathATM::Configuration + query instanceof TaintedPathQuery and result instanceof TaintedPathAtm::Configuration or - query instanceof XssQuery and result instanceof XssATM::Configuration + query instanceof XssQuery and result instanceof XssAtm::Configuration } /** Gets a known sink for the specified query. */ diff --git a/javascript/ql/experimental/adaptivethreatmodeling/modelbuilding/extraction/ExtractEndpointMapping.ql b/javascript/ql/experimental/adaptivethreatmodeling/modelbuilding/extraction/ExtractEndpointMapping.ql index 119865620855..697928d74b03 100644 --- a/javascript/ql/experimental/adaptivethreatmodeling/modelbuilding/extraction/ExtractEndpointMapping.ql +++ b/javascript/ql/experimental/adaptivethreatmodeling/modelbuilding/extraction/ExtractEndpointMapping.ql @@ -4,25 +4,25 @@ * Maps ML-powered queries to their `EndpointType` for clearer labelling while evaluating ML model during training. */ -import experimental.adaptivethreatmodeling.SqlInjectionATM as SqlInjectionATM -import experimental.adaptivethreatmodeling.NosqlInjectionATM as NosqlInjectionATM -import experimental.adaptivethreatmodeling.TaintedPathATM as TaintedPathATM -import experimental.adaptivethreatmodeling.XssATM as XssATM +import experimental.adaptivethreatmodeling.SqlInjectionATM as SqlInjectionAtm +import experimental.adaptivethreatmodeling.NosqlInjectionATM as NosqlInjectionAtm +import experimental.adaptivethreatmodeling.TaintedPathATM as TaintedPathAtm +import experimental.adaptivethreatmodeling.XssATM as XssAtm import experimental.adaptivethreatmodeling.AdaptiveThreatModeling from string queryName, AtmConfig c, EndpointType e where ( queryName = "SqlInjection" and - c instanceof SqlInjectionATM::SqlInjectionAtmConfig + c instanceof SqlInjectionAtm::SqlInjectionAtmConfig or queryName = "NosqlInjection" and - c instanceof NosqlInjectionATM::NosqlInjectionAtmConfig + c instanceof NosqlInjectionAtm::NosqlInjectionAtmConfig or queryName = "TaintedPath" and - c instanceof TaintedPathATM::TaintedPathAtmConfig + c instanceof TaintedPathAtm::TaintedPathAtmConfig or - queryName = "Xss" and c instanceof XssATM::DomBasedXssAtmConfig + queryName = "Xss" and c instanceof XssAtm::DomBasedXssAtmConfig ) and e = c.getASinkEndpointType() select queryName, e.getEncoding() as label diff --git a/javascript/ql/experimental/adaptivethreatmodeling/test/endpoint_large_scale/EndpointFeatures.ql b/javascript/ql/experimental/adaptivethreatmodeling/test/endpoint_large_scale/EndpointFeatures.ql index ab0191c5129d..9985625d85cb 100644 --- a/javascript/ql/experimental/adaptivethreatmodeling/test/endpoint_large_scale/EndpointFeatures.ql +++ b/javascript/ql/experimental/adaptivethreatmodeling/test/endpoint_large_scale/EndpointFeatures.ql @@ -7,20 +7,20 @@ */ import javascript -import experimental.adaptivethreatmodeling.NosqlInjectionATM as NosqlInjectionATM -import experimental.adaptivethreatmodeling.SqlInjectionATM as SqlInjectionATM -import experimental.adaptivethreatmodeling.TaintedPathATM as TaintedPathATM -import experimental.adaptivethreatmodeling.XssATM as XssATM +import experimental.adaptivethreatmodeling.NosqlInjectionATM as NosqlInjectionAtm +import experimental.adaptivethreatmodeling.SqlInjectionATM as SqlInjectionAtm +import experimental.adaptivethreatmodeling.TaintedPathATM as TaintedPathAtm +import experimental.adaptivethreatmodeling.XssATM as XssAtm import experimental.adaptivethreatmodeling.EndpointFeatures as EndpointFeatures import experimental.adaptivethreatmodeling.StandardEndpointFilters as StandardEndpointFilters import extraction.NoFeaturizationRestrictionsConfig query predicate tokenFeatures(DataFlow::Node endpoint, string featureName, string featureValue) { ( - not exists(NosqlInjectionATM::SinkEndpointFilter::getAReasonSinkExcluded(endpoint)) or - not exists(SqlInjectionATM::SinkEndpointFilter::getAReasonSinkExcluded(endpoint)) or - not exists(TaintedPathATM::SinkEndpointFilter::getAReasonSinkExcluded(endpoint)) or - not exists(XssATM::SinkEndpointFilter::getAReasonSinkExcluded(endpoint)) or + not exists(NosqlInjectionAtm::SinkEndpointFilter::getAReasonSinkExcluded(endpoint)) or + not exists(SqlInjectionAtm::SinkEndpointFilter::getAReasonSinkExcluded(endpoint)) or + not exists(TaintedPathAtm::SinkEndpointFilter::getAReasonSinkExcluded(endpoint)) or + not exists(XssAtm::SinkEndpointFilter::getAReasonSinkExcluded(endpoint)) or StandardEndpointFilters::isArgumentToModeledFunction(endpoint) ) and EndpointFeatures::tokenFeatures(endpoint, featureName, featureValue) diff --git a/javascript/ql/experimental/adaptivethreatmodeling/test/endpoint_large_scale/FilteredTruePositives.ql b/javascript/ql/experimental/adaptivethreatmodeling/test/endpoint_large_scale/FilteredTruePositives.ql index 9edae6cec5ea..8ae824464032 100644 --- a/javascript/ql/experimental/adaptivethreatmodeling/test/endpoint_large_scale/FilteredTruePositives.ql +++ b/javascript/ql/experimental/adaptivethreatmodeling/test/endpoint_large_scale/FilteredTruePositives.ql @@ -17,31 +17,31 @@ import semmle.javascript.security.dataflow.SqlInjectionCustomizations import semmle.javascript.security.dataflow.TaintedPathCustomizations import semmle.javascript.security.dataflow.DomBasedXssCustomizations import experimental.adaptivethreatmodeling.StandardEndpointFilters as StandardEndpointFilters -import experimental.adaptivethreatmodeling.NosqlInjectionATM as NosqlInjectionATM -import experimental.adaptivethreatmodeling.SqlInjectionATM as SqlInjectionATM -import experimental.adaptivethreatmodeling.TaintedPathATM as TaintedPathATM -import experimental.adaptivethreatmodeling.XssATM as XssATM +import experimental.adaptivethreatmodeling.NosqlInjectionATM as NosqlInjectionAtm +import experimental.adaptivethreatmodeling.SqlInjectionATM as SqlInjectionAtm +import experimental.adaptivethreatmodeling.TaintedPathATM as TaintedPathAtm +import experimental.adaptivethreatmodeling.XssATM as XssAtm query predicate nosqlFilteredTruePositives(DataFlow::Node endpoint, string reason) { endpoint instanceof NosqlInjection::Sink and - reason = NosqlInjectionATM::SinkEndpointFilter::getAReasonSinkExcluded(endpoint) and + reason = NosqlInjectionAtm::SinkEndpointFilter::getAReasonSinkExcluded(endpoint) and not reason = ["argument to modeled function", "modeled sink", "modeled database access"] } query predicate sqlFilteredTruePositives(DataFlow::Node endpoint, string reason) { endpoint instanceof SqlInjection::Sink and - reason = SqlInjectionATM::SinkEndpointFilter::getAReasonSinkExcluded(endpoint) and + reason = SqlInjectionAtm::SinkEndpointFilter::getAReasonSinkExcluded(endpoint) and reason != "argument to modeled function" } query predicate taintedPathFilteredTruePositives(DataFlow::Node endpoint, string reason) { endpoint instanceof TaintedPath::Sink and - reason = TaintedPathATM::SinkEndpointFilter::getAReasonSinkExcluded(endpoint) and + reason = TaintedPathAtm::SinkEndpointFilter::getAReasonSinkExcluded(endpoint) and reason != "argument to modeled function" } query predicate xssFilteredTruePositives(DataFlow::Node endpoint, string reason) { endpoint instanceof DomBasedXss::Sink and - reason = XssATM::SinkEndpointFilter::getAReasonSinkExcluded(endpoint) and + reason = XssAtm::SinkEndpointFilter::getAReasonSinkExcluded(endpoint) and reason != "argument to modeled function" } diff --git a/javascript/ql/experimental/adaptivethreatmodeling/test/modeled_apis/nosql_endpoint_filter_ignores_modeled_apis.ql b/javascript/ql/experimental/adaptivethreatmodeling/test/modeled_apis/nosql_endpoint_filter_ignores_modeled_apis.ql index 566a2bb98b80..9a81ce73d917 100644 --- a/javascript/ql/experimental/adaptivethreatmodeling/test/modeled_apis/nosql_endpoint_filter_ignores_modeled_apis.ql +++ b/javascript/ql/experimental/adaptivethreatmodeling/test/modeled_apis/nosql_endpoint_filter_ignores_modeled_apis.ql @@ -1,6 +1,6 @@ import javascript -import experimental.adaptivethreatmodeling.NosqlInjectionATM as NosqlInjectionATM +import experimental.adaptivethreatmodeling.NosqlInjectionATM as NosqlInjectionAtm query predicate effectiveSinks(DataFlow::Node node) { - not exists(NosqlInjectionATM::SinkEndpointFilter::getAReasonSinkExcluded(node)) + not exists(NosqlInjectionAtm::SinkEndpointFilter::getAReasonSinkExcluded(node)) } diff --git a/javascript/ql/lib/semmle/javascript/Actions.qll b/javascript/ql/lib/semmle/javascript/Actions.qll index 8ea789c96e02..d79bb6eff4a1 100644 --- a/javascript/ql/lib/semmle/javascript/Actions.qll +++ b/javascript/ql/lib/semmle/javascript/Actions.qll @@ -11,7 +11,7 @@ import javascript */ module Actions { /** A YAML node in a GitHub Actions workflow file. */ - private class Node extends YAMLNode { + private class Node extends YamlNode { Node() { this.getLocation() .getFile() @@ -24,12 +24,12 @@ module Actions { * An Actions workflow. This is a mapping at the top level of an Actions YAML workflow file. * See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions. */ - class Workflow extends Node, YAMLDocument, YAMLMapping { + class Workflow extends Node, YamlDocument, YamlMapping { /** Gets the `jobs` mapping from job IDs to job definitions in this workflow. */ - YAMLMapping getJobs() { result = this.lookup("jobs") } + YamlMapping getJobs() { result = this.lookup("jobs") } /** Gets the name of the workflow. */ - string getName() { result = this.lookup("name").(YAMLString).getValue() } + string getName() { result = this.lookup("name").(YamlString).getValue() } /** Gets the name of the workflow file. */ string getFileName() { result = this.getFile().getBaseName() } @@ -45,7 +45,7 @@ module Actions { * An Actions On trigger within a workflow. * See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#on. */ - class On extends YAMLNode, YAMLMappingLikeNode { + class On extends YamlNode, YamlMappingLikeNode { Workflow workflow; On() { workflow.lookup("on") = this } @@ -58,7 +58,7 @@ module Actions { * An Actions job within a workflow. * See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobs. */ - class Job extends YAMLNode, YAMLMapping { + class Job extends YamlNode, YamlMapping { string jobId; Workflow workflow; @@ -74,19 +74,19 @@ module Actions { * Gets the ID of this job, as a YAML scalar node. * This is the job's key within the `jobs` mapping. */ - YAMLString getIdNode() { workflow.getJobs().maps(result, this) } + YamlString getIdNode() { workflow.getJobs().maps(result, this) } /** Gets the human-readable name of this job, if any, as a string. */ string getName() { result = this.getNameNode().getValue() } /** Gets the human-readable name of this job, if any, as a YAML scalar node. */ - YAMLString getNameNode() { result = this.lookup("name") } + YamlString getNameNode() { result = this.lookup("name") } /** Gets the step at the given index within this job. */ Step getStep(int index) { result.getJob() = this and result.getIndex() = index } /** Gets the sequence of `steps` within this job. */ - YAMLSequence getSteps() { result = this.lookup("steps") } + YamlSequence getSteps() { result = this.lookup("steps") } /** Gets the workflow this job belongs to. */ Workflow getWorkflow() { result = workflow } @@ -99,7 +99,7 @@ module Actions { * An `if` within a job. * See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idif. */ - class JobIf extends YAMLNode, YAMLScalar { + class JobIf extends YamlNode, YamlScalar { Job job; JobIf() { job.lookup("if") = this } @@ -112,7 +112,7 @@ module Actions { * A step within an Actions job. * See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idsteps. */ - class Step extends YAMLNode, YAMLMapping { + class Step extends YamlNode, YamlMapping { int index; Job job; @@ -134,14 +134,14 @@ module Actions { StepIf getIf() { result.getStep() = this } /** Gets the ID of this step, if any. */ - string getId() { result = this.lookup("id").(YAMLString).getValue() } + string getId() { result = this.lookup("id").(YamlString).getValue() } } /** * An `if` within a step. * See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsif. */ - class StepIf extends YAMLNode, YAMLScalar { + class StepIf extends YamlNode, YamlScalar { Step step; StepIf() { step.lookup("if") = this } @@ -170,7 +170,7 @@ module Actions { * * Does not handle local repository references, e.g. `.github/actions/action-name`. */ - class Uses extends YAMLNode, YAMLScalar { + class Uses extends YamlNode, YamlScalar { Step step; Uses() { step.lookup("uses") = this } @@ -200,7 +200,7 @@ module Actions { * arg2: abc * ``` */ - class With extends YAMLNode, YAMLMapping { + class With extends YamlNode, YamlMapping { Step step; With() { step.lookup("with") = this } @@ -219,7 +219,7 @@ module Actions { * ref: ${{ github.event.pull_request.head.sha }} * ``` */ - class Ref extends YAMLNode, YAMLString { + class Ref extends YamlNode, YamlString { With with; Ref() { with.lookup("ref") = this } @@ -232,7 +232,7 @@ module Actions { * A `run` field within an Actions job step, which runs command-line programs using an operating system shell. * See https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsrun. */ - class Run extends YAMLNode, YAMLString { + class Run extends YamlNode, YamlString { Step step; Run() { step.lookup("run") = this } diff --git a/javascript/ql/lib/semmle/javascript/GeneratedCode.qll b/javascript/ql/lib/semmle/javascript/GeneratedCode.qll index 016875ff8d4a..8dd534022054 100644 --- a/javascript/ql/lib/semmle/javascript/GeneratedCode.qll +++ b/javascript/ql/lib/semmle/javascript/GeneratedCode.qll @@ -178,7 +178,7 @@ predicate isGeneratedFileName(File f) { predicate isGenerated(TopLevel tl) { tl.isMinified() or isBundle(tl) or - tl instanceof GWTGeneratedTopLevel or + tl instanceof GwtGeneratedTopLevel or tl instanceof DartGeneratedTopLevel or exists(GeneratedCodeMarkerComment gcmc | tl = gcmc.getTopLevel()) or hasManyInvocations(tl) or diff --git a/javascript/ql/lib/semmle/javascript/JsonStringifiers.qll b/javascript/ql/lib/semmle/javascript/JsonStringifiers.qll index f4cdda89e317..f4c2a846ed81 100644 --- a/javascript/ql/lib/semmle/javascript/JsonStringifiers.qll +++ b/javascript/ql/lib/semmle/javascript/JsonStringifiers.qll @@ -43,7 +43,7 @@ class JsonStringifyCall extends DataFlow::CallNode { /** * A taint step through the [`json2csv`](https://www.npmjs.com/package/json2csv) library. */ -class JSON2CSVTaintStep extends TaintTracking::SharedTaintStep { +class Json2CsvTaintStep extends TaintTracking::SharedTaintStep { override predicate step(DataFlow::Node pred, DataFlow::Node succ) { exists(API::CallNode call | call = @@ -59,6 +59,9 @@ class JSON2CSVTaintStep extends TaintTracking::SharedTaintStep { } } +/** DEPRECATED: Alias for Json2CsvTaintStep */ +deprecated class JSON2CSVTaintStep = Json2CsvTaintStep; + /** * A step through the [`prettyjson`](https://www.npmjs.com/package/prettyjson) library. * This is not quite a `JSON.stringify` call, as it e.g. does not wrap keys in double quotes. diff --git a/javascript/ql/lib/semmle/javascript/NPM.qll b/javascript/ql/lib/semmle/javascript/NPM.qll index 21d7fa4007fc..515e900f277c 100644 --- a/javascript/ql/lib/semmle/javascript/NPM.qll +++ b/javascript/ql/lib/semmle/javascript/NPM.qll @@ -168,18 +168,24 @@ class PackageJson extends JsonObject { JsonArray getCPUs() { result = this.getPropValue("cpu") } /** Gets a platform supported by this package. */ - string getWhitelistedCPU() { + string getWhitelistedCpu() { result = this.getCPUs().getElementStringValue(_) and not result.matches("!%") } + /** DEPRECATED: Alias for getWhitelistedCpu */ + deprecated string getWhitelistedCPU() { result = this.getWhitelistedCpu() } + /** Gets a platform not supported by this package. */ - string getBlacklistedCPU() { + string getBlacklistedCpu() { exists(string str | str = this.getCPUs().getElementStringValue(_) | result = str.regexpCapture("!(.*)", 1) ) } + /** DEPRECATED: Alias for getBlacklistedCpu */ + deprecated string getBlacklistedCPU() { result = this.getBlacklistedCpu() } + /** Holds if this package prefers to be installed globally. */ predicate isPreferGlobal() { this.getPropValue("preferGlobal").(JsonBoolean).getValue() = "true" } diff --git a/javascript/ql/lib/semmle/javascript/PrintAst.qll b/javascript/ql/lib/semmle/javascript/PrintAst.qll index 95c722f54025..29b1d619016f 100644 --- a/javascript/ql/lib/semmle/javascript/PrintAst.qll +++ b/javascript/ql/lib/semmle/javascript/PrintAst.qll @@ -64,8 +64,8 @@ private newtype TPrintAstNode = // JSON TJsonNode(JsonValue value) { shouldPrint(value, _) and not isNotNeeded(value) } or // YAML - TYamlNode(YAMLNode n) { shouldPrint(n, _) and not isNotNeeded(n) } or - TYamlMappingNode(YAMLMapping mapping, int i) { + TYamlNode(YamlNode n) { shouldPrint(n, _) and not isNotNeeded(n) } or + TYamlMappingNode(YamlMapping mapping, int i) { shouldPrint(mapping, _) and not isNotNeeded(mapping) and exists(mapping.getKeyNode(i)) } or // HTML @@ -628,7 +628,7 @@ module PrintYaml { * A print node representing a YAML value in a .yml file. */ class YamlNodeNode extends PrintAstNode, TYamlNode { - YAMLNode node; + YamlNode node; YamlNodeNode() { this = TYamlNode(node) } @@ -639,10 +639,10 @@ module PrintYaml { /** * Gets the `YAMLNode` represented by this node. */ - final YAMLNode getValue() { result = node } + final YamlNode getValue() { result = node } override PrintAstNode getChild(int childIndex) { - exists(YAMLNode child | result.(YamlNodeNode).getValue() = child | + exists(YamlNode child | result.(YamlNodeNode).getValue() = child | child = node.getChildNode(childIndex) ) } @@ -657,7 +657,7 @@ module PrintYaml { * Each child of this node aggregates the key and value of a mapping. */ class YamlMappingNode extends YamlNodeNode { - override YAMLMapping node; + override YamlMapping node; override PrintAstNode getChild(int childIndex) { exists(YamlMappingMapNode map | map = result | map.maps(node, childIndex)) @@ -671,21 +671,21 @@ module PrintYaml { * A print node representing the `i`th mapping in `mapping`. */ class YamlMappingMapNode extends PrintAstNode, TYamlMappingNode { - YAMLMapping mapping; + YamlMapping mapping; int i; YamlMappingMapNode() { this = TYamlMappingNode(mapping, i) } override string toString() { - result = "(Mapping " + i + ")" and not exists(mapping.getKeyNode(i).(YAMLScalar).getValue()) + result = "(Mapping " + i + ")" and not exists(mapping.getKeyNode(i).(YamlScalar).getValue()) or - result = "(Mapping " + i + ") " + mapping.getKeyNode(i).(YAMLScalar).getValue() + ":" + result = "(Mapping " + i + ") " + mapping.getKeyNode(i).(YamlScalar).getValue() + ":" } /** * Holds if this print node represents the `index`th mapping of `m`. */ - predicate maps(YAMLMapping m, int index) { + predicate maps(YamlMapping m, int index) { m = mapping and index = i } diff --git a/javascript/ql/lib/semmle/javascript/Regexp.qll b/javascript/ql/lib/semmle/javascript/Regexp.qll index e683fb0db2a9..e443ede5104f 100644 --- a/javascript/ql/lib/semmle/javascript/Regexp.qll +++ b/javascript/ql/lib/semmle/javascript/Regexp.qll @@ -1005,7 +1005,10 @@ module RegExpPatterns { * Gets a pattern that matches common top-level domain names in lower case. * DEPRECATED: use `getACommonTld` instead */ - deprecated predicate commonTLD = getACommonTld/0; + deprecated predicate commonTld = getACommonTld/0; + + /** DEPRECATED: Alias for commonTld */ + deprecated predicate commonTLD = commonTld/0; } /** diff --git a/javascript/ql/lib/semmle/javascript/Stmt.qll b/javascript/ql/lib/semmle/javascript/Stmt.qll index edf8296585ae..24a901a0dcc8 100644 --- a/javascript/ql/lib/semmle/javascript/Stmt.qll +++ b/javascript/ql/lib/semmle/javascript/Stmt.qll @@ -291,10 +291,13 @@ class StrictModeDecl extends KnownDirective { * "use asm"; * ``` */ -class ASMJSDirective extends KnownDirective { - ASMJSDirective() { this.getDirectiveText() = "use asm" } +class AsmJSDirective extends KnownDirective { + AsmJSDirective() { this.getDirectiveText() = "use asm" } } +/** DEPRECATED: Alias for AsmJSDirective */ +deprecated class ASMJSDirective = AsmJSDirective; + /** * A Babel directive. * diff --git a/javascript/ql/lib/semmle/javascript/YAML.qll b/javascript/ql/lib/semmle/javascript/YAML.qll index 49e0d28ae28f..fa8dd72b7057 100644 --- a/javascript/ql/lib/semmle/javascript/YAML.qll +++ b/javascript/ql/lib/semmle/javascript/YAML.qll @@ -20,13 +20,13 @@ import javascript * << : *DEFAULTS # an alias node referring to anchor `DEFAULTS` * ``` */ -class YAMLNode extends @yaml_node, Locatable { +class YamlNode extends @yaml_node, Locatable { override Location getLocation() { yaml_locations(this, result) } /** * Gets the parent node of this node, which is always a collection. */ - YAMLCollection getParentNode() { yaml(this, _, result, _, _, _) } + YamlCollection getParentNode() { yaml(this, _, result, _, _, _) } /** * Gets the `i`th child node of this node. @@ -34,12 +34,12 @@ class YAMLNode extends @yaml_node, Locatable { * _Note_: The index of a child node relative to its parent is considered * an implementation detail and may change between versions of the extractor. */ - YAMLNode getChildNode(int i) { yaml(result, _, this, i, _, _) } + YamlNode getChildNode(int i) { yaml(result, _, this, i, _, _) } /** * Gets a child node of this node. */ - YAMLNode getAChildNode() { result = this.getChildNode(_) } + YamlNode getAChildNode() { result = this.getChildNode(_) } /** * Gets the number of child nodes of this node. @@ -49,12 +49,12 @@ class YAMLNode extends @yaml_node, Locatable { /** * Gets the `i`th child of this node, as a YAML value. */ - YAMLValue getChild(int i) { result = this.getChildNode(i).eval() } + YamlValue getChild(int i) { result = this.getChildNode(i).eval() } /** * Gets a child of this node, as a YAML value. */ - YAMLValue getAChild() { result = this.getChild(_) } + YamlValue getAChild() { result = this.getChild(_) } /** * Gets the tag of this node. @@ -79,16 +79,19 @@ class YAMLNode extends @yaml_node, Locatable { /** * Gets the toplevel document to which this node belongs. */ - YAMLDocument getDocument() { result = this.getParentNode*() } + YamlDocument getDocument() { result = this.getParentNode*() } /** * Gets the YAML value this node corresponds to after resolving aliases and includes. */ - YAMLValue eval() { result = this } + YamlValue eval() { result = this } override string getAPrimaryQlClass() { result = "YAMLNode" } } +/** DEPRECATED: Alias for YamlNode */ +deprecated class YAMLNode = YamlNode; + /** * A YAML value; that is, either a scalar or a collection. * @@ -102,7 +105,10 @@ class YAMLNode extends @yaml_node, Locatable { * - sequence * ``` */ -abstract class YAMLValue extends YAMLNode { } +abstract class YamlValue extends YamlNode { } + +/** DEPRECATED: Alias for YamlValue */ +deprecated class YAMLValue = YamlValue; /** * A YAML scalar. @@ -118,7 +124,7 @@ abstract class YAMLValue extends YAMLNode { } * "hello" * ``` */ -class YAMLScalar extends YAMLValue, @yaml_scalar_node { +class YamlScalar extends YamlValue, @yaml_scalar_node { /** * Gets the style of this scalar, which is one of the following: * @@ -150,6 +156,9 @@ class YAMLScalar extends YAMLValue, @yaml_scalar_node { override string getAPrimaryQlClass() { result = "YAMLScalar" } } +/** DEPRECATED: Alias for YamlScalar */ +deprecated class YAMLScalar = YamlScalar; + /** * A YAML scalar representing an integer value. * @@ -160,8 +169,8 @@ class YAMLScalar extends YAMLValue, @yaml_scalar_node { * 0xffff * ``` */ -class YAMLInteger extends YAMLScalar { - YAMLInteger() { this.hasStandardTypeTag("int") } +class YamlInteger extends YamlScalar { + YamlInteger() { this.hasStandardTypeTag("int") } /** * Gets the value of this scalar, as an integer. @@ -169,6 +178,9 @@ class YAMLInteger extends YAMLScalar { int getIntValue() { result = this.getValue().toInt() } } +/** DEPRECATED: Alias for YamlInteger */ +deprecated class YAMLInteger = YamlInteger; + /** * A YAML scalar representing a floating point value. * @@ -179,8 +191,8 @@ class YAMLInteger extends YAMLScalar { * 6.626e-34 * ``` */ -class YAMLFloat extends YAMLScalar { - YAMLFloat() { this.hasStandardTypeTag("float") } +class YamlFloat extends YamlScalar { + YamlFloat() { this.hasStandardTypeTag("float") } /** * Gets the value of this scalar, as a floating point number. @@ -188,6 +200,9 @@ class YAMLFloat extends YAMLScalar { float getFloatValue() { result = this.getValue().toFloat() } } +/** DEPRECATED: Alias for YamlFloat */ +deprecated class YAMLFloat = YamlFloat; + /** * A YAML scalar representing a time stamp. * @@ -197,8 +212,8 @@ class YAMLFloat extends YAMLScalar { * 2001-12-15T02:59:43.1Z * ``` */ -class YAMLTimestamp extends YAMLScalar { - YAMLTimestamp() { this.hasStandardTypeTag("timestamp") } +class YamlTimestamp extends YamlScalar { + YamlTimestamp() { this.hasStandardTypeTag("timestamp") } /** * Gets the value of this scalar, as a date. @@ -206,6 +221,9 @@ class YAMLTimestamp extends YAMLScalar { date getDateValue() { result = this.getValue().toDate() } } +/** DEPRECATED: Alias for YamlTimestamp */ +deprecated class YAMLTimestamp = YamlTimestamp; + /** * A YAML scalar representing a Boolean value. * @@ -215,8 +233,8 @@ class YAMLTimestamp extends YAMLScalar { * true * ``` */ -class YAMLBool extends YAMLScalar { - YAMLBool() { this.hasStandardTypeTag("bool") } +class YamlBool extends YamlScalar { + YamlBool() { this.hasStandardTypeTag("bool") } /** * Gets the value of this scalar, as a Boolean. @@ -224,6 +242,9 @@ class YAMLBool extends YAMLScalar { boolean getBoolValue() { if this.getValue() = "true" then result = true else result = false } } +/** DEPRECATED: Alias for YamlBool */ +deprecated class YAMLBool = YamlBool; + /** * A YAML scalar representing the null value. * @@ -233,10 +254,13 @@ class YAMLBool extends YAMLScalar { * null * ``` */ -class YAMLNull extends YAMLScalar { - YAMLNull() { this.hasStandardTypeTag("null") } +class YamlNull extends YamlScalar { + YamlNull() { this.hasStandardTypeTag("null") } } +/** DEPRECATED: Alias for YamlNull */ +deprecated class YAMLNull = YamlNull; + /** * A YAML scalar representing a string value. * @@ -246,10 +270,13 @@ class YAMLNull extends YAMLScalar { * "hello" * ``` */ -class YAMLString extends YAMLScalar { - YAMLString() { this.hasStandardTypeTag("str") } +class YamlString extends YamlScalar { + YamlString() { this.hasStandardTypeTag("str") } } +/** DEPRECATED: Alias for YamlString */ +deprecated class YAMLString = YamlString; + /** * A YAML scalar representing a merge key. * @@ -260,10 +287,13 @@ class YAMLString extends YAMLScalar { * << : *DEFAULTS # merge key * ``` */ -class YAMLMergeKey extends YAMLScalar { - YAMLMergeKey() { this.hasStandardTypeTag("merge") } +class YamlMergeKey extends YamlScalar { + YamlMergeKey() { this.hasStandardTypeTag("merge") } } +/** DEPRECATED: Alias for YamlMergeKey */ +deprecated class YAMLMergeKey = YamlMergeKey; + /** * A YAML scalar representing an `!include` directive. * @@ -271,11 +301,11 @@ class YAMLMergeKey extends YAMLScalar { * !include common.yaml * ``` */ -class YAMLInclude extends YAMLScalar { - YAMLInclude() { this.getTag() = "!include" } +class YamlInclude extends YamlScalar { + YamlInclude() { this.getTag() = "!include" } - override YAMLValue eval() { - exists(YAMLDocument targetDoc | + override YamlValue eval() { + exists(YamlDocument targetDoc | targetDoc.getFile().getAbsolutePath() = this.getTargetPath() and result = targetDoc.eval() ) @@ -293,6 +323,9 @@ class YAMLInclude extends YAMLScalar { } } +/** DEPRECATED: Alias for YamlInclude */ +deprecated class YAMLInclude = YamlInclude; + /** * A YAML collection, that is, either a mapping or a sequence. * @@ -310,10 +343,13 @@ class YAMLInclude extends YAMLScalar { * - -blue * ``` */ -class YAMLCollection extends YAMLValue, @yaml_collection_node { +class YamlCollection extends YamlValue, @yaml_collection_node { override string getAPrimaryQlClass() { result = "YAMLCollection" } } +/** DEPRECATED: Alias for YamlCollection */ +deprecated class YAMLCollection = YamlCollection; + /** * A YAML mapping. * @@ -324,11 +360,11 @@ class YAMLCollection extends YAMLValue, @yaml_collection_node { * y: 1 * ``` */ -class YAMLMapping extends YAMLCollection, @yaml_mapping_node { +class YamlMapping extends YamlCollection, @yaml_mapping_node { /** * Gets the `i`th key of this mapping. */ - YAMLNode getKeyNode(int i) { + YamlNode getKeyNode(int i) { i >= 0 and exists(int j | i = j - 1 and result = this.getChildNode(j)) } @@ -336,7 +372,7 @@ class YAMLMapping extends YAMLCollection, @yaml_mapping_node { /** * Gets the `i`th value of this mapping. */ - YAMLNode getValueNode(int i) { + YamlNode getValueNode(int i) { i >= 0 and exists(int j | i = -j - 1 and result = this.getChildNode(j)) } @@ -344,30 +380,33 @@ class YAMLMapping extends YAMLCollection, @yaml_mapping_node { /** * Gets the `i`th key of this mapping, as a YAML value. */ - YAMLValue getKey(int i) { result = this.getKeyNode(i).eval() } + YamlValue getKey(int i) { result = this.getKeyNode(i).eval() } /** * Gets the `i`th value of this mapping, as a YAML value. */ - YAMLValue getValue(int i) { result = this.getValueNode(i).eval() } + YamlValue getValue(int i) { result = this.getValueNode(i).eval() } /** * Holds if this mapping maps `key` to `value`. */ - predicate maps(YAMLValue key, YAMLValue value) { + predicate maps(YamlValue key, YamlValue value) { exists(int i | key = this.getKey(i) and value = this.getValue(i)) or - exists(YAMLMergeKey merge, YAMLMapping that | this.maps(merge, that) | that.maps(key, value)) + exists(YamlMergeKey merge, YamlMapping that | this.maps(merge, that) | that.maps(key, value)) } /** * Gets the value that this mapping maps `key` to. */ - YAMLValue lookup(string key) { exists(YAMLScalar s | s.getValue() = key | this.maps(s, result)) } + YamlValue lookup(string key) { exists(YamlScalar s | s.getValue() = key | this.maps(s, result)) } override string getAPrimaryQlClass() { result = "YAMLMapping" } } +/** DEPRECATED: Alias for YamlMapping */ +deprecated class YAMLMapping = YamlMapping; + /** * A YAML sequence. * @@ -379,20 +418,23 @@ class YAMLMapping extends YAMLCollection, @yaml_mapping_node { * - blue * ``` */ -class YAMLSequence extends YAMLCollection, @yaml_sequence_node { +class YamlSequence extends YamlCollection, @yaml_sequence_node { /** * Gets the `i`th element in this sequence. */ - YAMLNode getElementNode(int i) { result = this.getChildNode(i) } + YamlNode getElementNode(int i) { result = this.getChildNode(i) } /** * Gets the `i`th element in this sequence, as a YAML value. */ - YAMLValue getElement(int i) { result = this.getElementNode(i).eval() } + YamlValue getElement(int i) { result = this.getElementNode(i).eval() } override string getAPrimaryQlClass() { result = "YAMLSequence" } } +/** DEPRECATED: Alias for YamlSequence */ +deprecated class YAMLSequence = YamlSequence; + /** * A YAML alias node referring to a target anchor. * @@ -402,8 +444,8 @@ class YAMLSequence extends YAMLCollection, @yaml_sequence_node { * *DEFAULTS * ``` */ -class YAMLAliasNode extends YAMLNode, @yaml_alias_node { - override YAMLValue eval() { +class YamlAliasNode extends YamlNode, @yaml_alias_node { + override YamlValue eval() { result.getAnchor() = this.getTarget() and result.getDocument() = this.getDocument() } @@ -416,6 +458,9 @@ class YAMLAliasNode extends YAMLNode, @yaml_alias_node { override string getAPrimaryQlClass() { result = "YAMLAliasNode" } } +/** DEPRECATED: Alias for YamlAliasNode */ +deprecated class YAMLAliasNode = YamlAliasNode; + /** * A YAML document. * @@ -427,14 +472,17 @@ class YAMLAliasNode extends YAMLNode, @yaml_alias_node { * y: 1 * ``` */ -class YAMLDocument extends YAMLNode { - YAMLDocument() { not exists(this.getParentNode()) } +class YamlDocument extends YamlNode { + YamlDocument() { not exists(this.getParentNode()) } } +/** DEPRECATED: Alias for YamlDocument */ +deprecated class YAMLDocument = YamlDocument; + /** * An error message produced by the YAML parser while processing a YAML file. */ -class YAMLParseError extends @yaml_error, Error { +class YamlParseError extends @yaml_error, Error { override Location getLocation() { yaml_locations(this, result) } override string getMessage() { yaml_errors(this, result) } @@ -442,6 +490,9 @@ class YAMLParseError extends @yaml_error, Error { override string toString() { result = this.getMessage() } } +/** DEPRECATED: Alias for YamlParseError */ +deprecated class YAMLParseError = YamlParseError; + /** * A YAML node that may contain sub-nodes that can be identified by a name. * I.e. a mapping, sequence, or scalar. @@ -464,30 +515,30 @@ class YAMLParseError extends @yaml_error, Error { * * are equivalent. */ -class YAMLMappingLikeNode extends YAMLNode { - YAMLMappingLikeNode() { - this instanceof YAMLMapping +class YamlMappingLikeNode extends YamlNode { + YamlMappingLikeNode() { + this instanceof YamlMapping or - this instanceof YAMLSequence + this instanceof YamlSequence or - this instanceof YAMLScalar + this instanceof YamlScalar } /** Gets sub-name identified by `name`. */ - YAMLNode getNode(string name) { - exists(YAMLMapping mapping | + YamlNode getNode(string name) { + exists(YamlMapping mapping | mapping = this and result = mapping.lookup(name) ) or - exists(YAMLSequence sequence, YAMLNode node | + exists(YamlSequence sequence, YamlNode node | sequence = this and sequence.getAChildNode() = node and node.eval().toString() = name and result = node ) or - exists(YAMLScalar scalar | + exists(YamlScalar scalar | scalar = this and scalar.getValue() = name and result = scalar @@ -496,19 +547,22 @@ class YAMLMappingLikeNode extends YAMLNode { /** Gets the number of elements in this mapping or sequence. */ int getElementCount() { - exists(YAMLMapping mapping | + exists(YamlMapping mapping | mapping = this and result = mapping.getNumChild() / 2 ) or - exists(YAMLSequence sequence | + exists(YamlSequence sequence | sequence = this and result = sequence.getNumChild() ) or - exists(YAMLScalar scalar | + exists(YamlScalar scalar | scalar = this and result = 1 ) } } + +/** DEPRECATED: Alias for YamlMappingLikeNode */ +deprecated class YAMLMappingLikeNode = YamlMappingLikeNode; diff --git a/javascript/ql/lib/semmle/javascript/dataflow/internal/InterProceduralTypeInference.qll b/javascript/ql/lib/semmle/javascript/dataflow/internal/InterProceduralTypeInference.qll index 6105b1b8115a..2ac0c0bbad6c 100644 --- a/javascript/ql/lib/semmle/javascript/dataflow/internal/InterProceduralTypeInference.qll +++ b/javascript/ql/lib/semmle/javascript/dataflow/internal/InterProceduralTypeInference.qll @@ -171,10 +171,10 @@ abstract class CallWithNonLocalAnalyzedReturnFlow extends DataFlow::AnalyzedValu /** * Flow analysis for the return value of IIFEs. */ -private class IIFEWithAnalyzedReturnFlow extends CallWithAnalyzedReturnFlow { +private class IifeWithAnalyzedReturnFlow extends CallWithAnalyzedReturnFlow { ImmediatelyInvokedFunctionExpr iife; - IIFEWithAnalyzedReturnFlow() { astNode = iife.getInvocation() } + IifeWithAnalyzedReturnFlow() { astNode = iife.getInvocation() } override AnalyzedFunction getACallee() { result = iife.analyze() } } diff --git a/javascript/ql/lib/semmle/javascript/dataflow/internal/VariableTypeInference.qll b/javascript/ql/lib/semmle/javascript/dataflow/internal/VariableTypeInference.qll index f2b905086c58..b55c0ddc3028 100644 --- a/javascript/ql/lib/semmle/javascript/dataflow/internal/VariableTypeInference.qll +++ b/javascript/ql/lib/semmle/javascript/dataflow/internal/VariableTypeInference.qll @@ -692,10 +692,10 @@ abstract private class CallWithAnalyzedParameters extends FunctionWithAnalyzedPa /** * Flow analysis for simple parameters of IIFEs. */ -private class IIFEWithAnalyzedParameters extends CallWithAnalyzedParameters { +private class IifeWithAnalyzedParameters extends CallWithAnalyzedParameters { ImmediatelyInvokedFunctionExpr iife; - IIFEWithAnalyzedParameters() { + IifeWithAnalyzedParameters() { this = iife and iife.getInvocationKind() = "direct" } diff --git a/javascript/ql/lib/semmle/javascript/dependencies/Dependencies.qll b/javascript/ql/lib/semmle/javascript/dependencies/Dependencies.qll index 1f47bd3e3502..024a966bf212 100644 --- a/javascript/ql/lib/semmle/javascript/dependencies/Dependencies.qll +++ b/javascript/ql/lib/semmle/javascript/dependencies/Dependencies.qll @@ -276,15 +276,15 @@ class ExternalScriptDependency extends ScriptDependency, @xmlattribute { /** * A dependency on GWT indicated by a GWT header script. */ -private class GWTDependency extends ScriptDependency { - GWTDependency() { this instanceof GWTHeader } +private class GwtDependency extends ScriptDependency { + GwtDependency() { this instanceof GwtHeader } override predicate info(string id, string v) { id = "gwt" and - exists(GWTHeader h | h = this | - v = h.getGWTVersion() + exists(GwtHeader h | h = this | + v = h.getGwtVersion() or - not exists(h.getGWTVersion()) and v = "unknown" + not exists(h.getGwtVersion()) and v = "unknown" ) } diff --git a/javascript/ql/lib/semmle/javascript/dependencies/FrameworkLibraries.qll b/javascript/ql/lib/semmle/javascript/dependencies/FrameworkLibraries.qll index 0d4664a79f43..1b0c00f6b7b5 100644 --- a/javascript/ql/lib/semmle/javascript/dependencies/FrameworkLibraries.qll +++ b/javascript/ql/lib/semmle/javascript/dependencies/FrameworkLibraries.qll @@ -904,8 +904,8 @@ private class SinonJS extends FrameworkLibraryWithGenericUrl, FrameworkLibraryWi /** * The TinyMCE framework. */ -private class TinyMCE extends FrameworkLibraryWithGenericUrl { - TinyMCE() { this = "tinymce" } +private class TinyMce extends FrameworkLibraryWithGenericUrl { + TinyMce() { this = "tinymce" } override string getAnAlias() { result = "jquery.tinymce" or result = "tinymce.jquery" } } diff --git a/javascript/ql/lib/semmle/javascript/frameworks/Electron.qll b/javascript/ql/lib/semmle/javascript/frameworks/Electron.qll index 038f4b8afb39..5ec9c8edcf97 100644 --- a/javascript/ql/lib/semmle/javascript/frameworks/Electron.qll +++ b/javascript/ql/lib/semmle/javascript/frameworks/Electron.qll @@ -112,7 +112,7 @@ module Electron { */ class ProcessSender extends Process { ProcessSender() { - exists(IPCSendRegistration reg | reg.getEmitter() instanceof MainProcess | + exists(IpcSendRegistration reg | reg.getEmitter() instanceof MainProcess | this = reg.getABoundCallbackParameter(1, 0).getAPropertyRead("sender") ) } @@ -123,28 +123,31 @@ module Electron { * Does mostly the same as an EventEmitter event handler, * except that values can be returned through the `event.returnValue` property. */ - class IPCSendRegistration extends EventRegistration::DefaultEventRegistration, + class IpcSendRegistration extends EventRegistration::DefaultEventRegistration, DataFlow::MethodCallNode { override Process emitter; - IPCSendRegistration() { this = emitter.ref().getAMethodCall(EventEmitter::on()) } + IpcSendRegistration() { this = emitter.ref().getAMethodCall(EventEmitter::on()) } override DataFlow::Node getAReturnedValue() { result = this.getABoundCallbackParameter(1, 0).getAPropertyWrite("returnValue").getRhs() } - override IPCDispatch getAReturnDispatch() { result.getCalleeName() = "sendSync" } + override IpcDispatch getAReturnDispatch() { result.getCalleeName() = "sendSync" } } + /** DEPRECATED: Alias for IpcSendRegistration */ + deprecated class IPCSendRegistration = IpcSendRegistration; + /** * A dispatch of an IPC event. * An IPC event is sent from the renderer to the main process. * And a value can be returned through the `returnValue` property of the event (first parameter in the callback). */ - class IPCDispatch extends EventDispatch::DefaultEventDispatch, DataFlow::InvokeNode { + class IpcDispatch extends EventDispatch::DefaultEventDispatch, DataFlow::InvokeNode { override Process emitter; - IPCDispatch() { + IpcDispatch() { exists(string methodName | methodName = "sendSync" or methodName = "send" | this = emitter.ref().getAMemberCall(methodName) ) @@ -163,7 +166,7 @@ module Electron { /** * Gets a registration that this dispatch can send an event to. */ - override IPCSendRegistration getAReceiver() { + override IpcSendRegistration getAReceiver() { this.getEmitter() instanceof RendererProcess and result.getEmitter() instanceof MainProcess or @@ -171,6 +174,9 @@ module Electron { result.getEmitter() instanceof RendererProcess } } + + /** DEPRECATED: Alias for IpcDispatch */ + deprecated class IPCDispatch = IpcDispatch; } /** diff --git a/javascript/ql/lib/semmle/javascript/frameworks/Emscripten.qll b/javascript/ql/lib/semmle/javascript/frameworks/Emscripten.qll index 0e5575226f77..5c0128a57c63 100644 --- a/javascript/ql/lib/semmle/javascript/frameworks/Emscripten.qll +++ b/javascript/ql/lib/semmle/javascript/frameworks/Emscripten.qll @@ -13,10 +13,13 @@ abstract class EmscriptenMarkerComment extends GeneratedCodeMarkerComment { } /** * An `EMSCRIPTEN_START_ASM` marker comment. */ -class EmscriptenStartASMComment extends EmscriptenMarkerComment { - EmscriptenStartASMComment() { getText().trim() = "EMSCRIPTEN_START_ASM" } +class EmscriptenStartAsmComment extends EmscriptenMarkerComment { + EmscriptenStartAsmComment() { getText().trim() = "EMSCRIPTEN_START_ASM" } } +/** DEPRECATED: Alias for EmscriptenStartAsmComment */ +deprecated class EmscriptenStartASMComment = EmscriptenStartAsmComment; + /** * An `EMSCRIPTEN_START_FUNCS` marker comment. */ @@ -27,10 +30,13 @@ class EmscriptenStartFuncsComment extends EmscriptenMarkerComment { /** * An `EMSCRIPTEN_END_ASM` marker comment. */ -class EmscriptenEndASMComment extends EmscriptenMarkerComment { - EmscriptenEndASMComment() { getText().trim() = "EMSCRIPTEN_END_ASM" } +class EmscriptenEndAsmComment extends EmscriptenMarkerComment { + EmscriptenEndAsmComment() { getText().trim() = "EMSCRIPTEN_END_ASM" } } +/** DEPRECATED: Alias for EmscriptenEndAsmComment */ +deprecated class EmscriptenEndASMComment = EmscriptenEndAsmComment; + /** * An `EMSCRIPTEN_END_FUNCS` marker comment. */ diff --git a/javascript/ql/lib/semmle/javascript/frameworks/GWT.qll b/javascript/ql/lib/semmle/javascript/frameworks/GWT.qll index 608f3d8b1fd2..7450c48378be 100644 --- a/javascript/ql/lib/semmle/javascript/frameworks/GWT.qll +++ b/javascript/ql/lib/semmle/javascript/frameworks/GWT.qll @@ -7,32 +7,44 @@ import javascript /** * A `$gwt_version` variable. */ -class GWTVersionVariable extends GlobalVariable { - GWTVersionVariable() { getName() = "$gwt_version" } +class GwtVersionVariable extends GlobalVariable { + GwtVersionVariable() { getName() = "$gwt_version" } } +/** DEPRECATED: Alias for GwtVersionVariable */ +deprecated class GWTVersionVariable = GwtVersionVariable; + /** * A GWT header script that defines the `$gwt_version` variable. */ -class GWTHeader extends InlineScript { - GWTHeader() { - exists(GWTVersionVariable gwtVersion | gwtVersion.getADeclaration().getTopLevel() = this) +class GwtHeader extends InlineScript { + GwtHeader() { + exists(GwtVersionVariable gwtVersion | gwtVersion.getADeclaration().getTopLevel() = this) } /** * Gets the GWT version this script was generated with, if it can be determined. */ - string getGWTVersion() { + string getGwtVersion() { exists(Expr e | e.getTopLevel() = this | - e = any(GWTVersionVariable v).getAnAssignedExpr() and + e = any(GwtVersionVariable v).getAnAssignedExpr() and result = e.getStringValue() ) } + + /** DEPRECATED: Alias for getGwtVersion */ + deprecated string getGWTVersion() { result = getGwtVersion() } } +/** DEPRECATED: Alias for GwtHeader */ +deprecated class GWTHeader = GwtHeader; + /** * A toplevel in a file that appears to be GWT-generated. */ -class GWTGeneratedTopLevel extends TopLevel { - GWTGeneratedTopLevel() { exists(GWTHeader h | getFile() = h.getFile()) } +class GwtGeneratedTopLevel extends TopLevel { + GwtGeneratedTopLevel() { exists(GwtHeader h | getFile() = h.getFile()) } } + +/** DEPRECATED: Alias for GwtGeneratedTopLevel */ +deprecated class GWTGeneratedTopLevel = GwtGeneratedTopLevel; diff --git a/javascript/ql/lib/semmle/javascript/frameworks/ServerLess.qll b/javascript/ql/lib/semmle/javascript/frameworks/ServerLess.qll index 0eccacac0b7f..6eace6700aeb 100644 --- a/javascript/ql/lib/semmle/javascript/frameworks/ServerLess.qll +++ b/javascript/ql/lib/semmle/javascript/frameworks/ServerLess.qll @@ -15,21 +15,21 @@ private module ServerLess { * `codeURI` defaults to the empty string if no explicit value is set in the configuration. */ private predicate hasServerlessHandler(File ymlFile, string handler, string codeUri) { - exists(YAMLMapping resource | ymlFile = resource.getFile() | + exists(YamlMapping resource | ymlFile = resource.getFile() | // There exists at least "AWS::Serverless::Function" and "Aliyun::Serverless::Function" - resource.lookup("Type").(YAMLScalar).getValue().regexpMatch(".*::Serverless::Function") and - exists(YAMLMapping properties | properties = resource.lookup("Properties") | - handler = properties.lookup("Handler").(YAMLScalar).getValue() and + resource.lookup("Type").(YamlScalar).getValue().regexpMatch(".*::Serverless::Function") and + exists(YamlMapping properties | properties = resource.lookup("Properties") | + handler = properties.lookup("Handler").(YamlScalar).getValue() and if exists(properties.lookup("CodeUri")) - then codeUri = properties.lookup("CodeUri").(YAMLScalar).getValue() + then codeUri = properties.lookup("CodeUri").(YamlScalar).getValue() else codeUri = "" ) or // The `serverless` library, which specifies a top-level `functions` property - exists(YAMLMapping functions | + exists(YamlMapping functions | functions = resource.lookup("functions") and not exists(resource.getParentNode()) and - handler = functions.getValue(_).(YAMLMapping).lookup("handler").(YAMLScalar).getValue() and + handler = functions.getValue(_).(YamlMapping).lookup("handler").(YamlScalar).getValue() and codeUri = "" ) ) diff --git a/javascript/ql/lib/semmle/javascript/frameworks/Testing.qll b/javascript/ql/lib/semmle/javascript/frameworks/Testing.qll index 6923d59124f4..f8f0c2126f0e 100644 --- a/javascript/ql/lib/semmle/javascript/frameworks/Testing.qll +++ b/javascript/ql/lib/semmle/javascript/frameworks/Testing.qll @@ -27,8 +27,8 @@ class QUnitTest extends Test, @call_expr { * that is, an invocation of a function named `it` where the first argument * is a string and the second argument is a function. */ -class BDDTest extends Test, @call_expr { - BDDTest() { +class BddTest extends Test, @call_expr { + BddTest() { exists(CallExpr call | call = this | call.getCallee().(VarAccess).getName() = "it" and exists(call.getArgument(0).getStringValue()) and @@ -37,6 +37,9 @@ class BDDTest extends Test, @call_expr { } } +/** DEPRECATED: Alias for BddTest */ +deprecated class BDDTest = BddTest; + /** * Gets the test file for `f` with stem extension `stemExt`, where `stemExt` is "test" or "spec". * That is, a file named `..` in the diff --git a/javascript/ql/lib/semmle/javascript/frameworks/jQuery.qll b/javascript/ql/lib/semmle/javascript/frameworks/jQuery.qll index 0f2b36216c99..d40a356f3bc6 100644 --- a/javascript/ql/lib/semmle/javascript/frameworks/jQuery.qll +++ b/javascript/ql/lib/semmle/javascript/frameworks/jQuery.qll @@ -281,7 +281,7 @@ private module JQueryClientRequest { .getParameter(0) or result = - getAResponseNodeFromAnXHRObject(this.getOptionArgument([0 .. 1], + getAResponseNodeFromAnXhrObject(this.getOptionArgument([0 .. 1], any(string method | method = "error" or method = "complete")) .getALocalSource() .(DataFlow::FunctionNode) @@ -303,15 +303,15 @@ private module JQueryClientRequest { .getParameter(0) or result = - getAResponseNodeFromAnXHRObject(request.getAMemberCall("fail").getCallback(0).getParameter(0)) + getAResponseNodeFromAnXhrObject(request.getAMemberCall("fail").getCallback(0).getParameter(0)) } /** * Gets a node referring to the response contained in an `jqXHR` object. */ - private DataFlow::SourceNode getAResponseNodeFromAnXHRObject(DataFlow::SourceNode jqXHR) { + private DataFlow::SourceNode getAResponseNodeFromAnXhrObject(DataFlow::SourceNode jqXhr) { result = - jqXHR + jqXhr .getAPropertyRead(any(string s | s = "responseText" or s = "responseXML" diff --git a/javascript/ql/lib/semmle/javascript/linters/ESLint.qll b/javascript/ql/lib/semmle/javascript/linters/ESLint.qll index 32b9f217a271..76164f25f185 100644 --- a/javascript/ql/lib/semmle/javascript/linters/ESLint.qll +++ b/javascript/ql/lib/semmle/javascript/linters/ESLint.qll @@ -60,7 +60,7 @@ module ESLint { } /** An `.eslintrc.yaml` file. */ - private class EslintrcYaml extends Configuration, YAMLDocument, YAMLMapping { + private class EslintrcYaml extends Configuration, YamlDocument, YamlMapping { EslintrcYaml() { exists(string n | n = getFile().getBaseName() | n = ".eslintrc.yaml" or n = ".eslintrc.yml" or n = ".eslintrc" @@ -71,11 +71,11 @@ module ESLint { } /** An ESLint configuration object in YAML format. */ - private class YamlConfigurationObject extends ConfigurationObject, YAMLMapping { + private class YamlConfigurationObject extends ConfigurationObject, YamlMapping { override Configuration getConfiguration() { this = result.(EslintrcYaml).getValue(_) } override boolean getBooleanProperty(string p) { - exists(string v | v = lookup(p).(YAMLBool).getValue() | + exists(string v | v = lookup(p).(YamlBool).getValue() | v = "true" and result = true or v = "false" and result = false diff --git a/javascript/ql/lib/semmle/javascript/security/PasswordInConfigurationFileQuery.qll b/javascript/ql/lib/semmle/javascript/security/PasswordInConfigurationFileQuery.qll index e31b482c25fe..183fca296c76 100644 --- a/javascript/ql/lib/semmle/javascript/security/PasswordInConfigurationFileQuery.qll +++ b/javascript/ql/lib/semmle/javascript/security/PasswordInConfigurationFileQuery.qll @@ -21,11 +21,11 @@ predicate config(string key, string val, Locatable valElement) { val = valElement.(JsonString).getValue() ) or - exists(YAMLMapping m, YAMLString keyElement | + exists(YamlMapping m, YamlString keyElement | m.maps(keyElement, valElement) and key = keyElement.getValue() and ( - val = valElement.(YAMLString).getValue() + val = valElement.(YamlString).getValue() or valElement.toString() = "" and val = "" diff --git a/javascript/ql/lib/semmle/javascript/security/dataflow/XssThroughDomCustomizations.qll b/javascript/ql/lib/semmle/javascript/security/dataflow/XssThroughDomCustomizations.qll index 3f0f569eff6d..bd3aa65aa4de 100644 --- a/javascript/ql/lib/semmle/javascript/security/dataflow/XssThroughDomCustomizations.qll +++ b/javascript/ql/lib/semmle/javascript/security/dataflow/XssThroughDomCustomizations.qll @@ -67,10 +67,10 @@ module XssThroughDom { /** * A source for text from a DOM property read by jQuery. */ - class JQueryDOMPropertySource extends DomPropertySource instanceof JQuery::MethodCall { + class JQueryDomPropertySource extends DomPropertySource instanceof JQuery::MethodCall { string prop; - JQueryDOMPropertySource() { + JQueryDomPropertySource() { exists(string methodName | this.getMethodName() = methodName and this.getNumArgument() = 1 and @@ -87,6 +87,9 @@ module XssThroughDom { override string getPropertyName() { result = prop } } + /** DEPRECATED: Alias for JQueryDomPropertySource */ + deprecated class JQueryDOMPropertySource = JQueryDomPropertySource; + /** * A source for text from the DOM from a `d3` method call. */ diff --git a/javascript/ql/src/Security/CWE-830/FunctionalityFromUntrustedSource.ql b/javascript/ql/src/Security/CWE-830/FunctionalityFromUntrustedSource.ql index 98ab953ff61e..a801420b44f4 100644 --- a/javascript/ql/src/Security/CWE-830/FunctionalityFromUntrustedSource.ql +++ b/javascript/ql/src/Security/CWE-830/FunctionalityFromUntrustedSource.ql @@ -61,8 +61,8 @@ module StaticCreation { } /** A script element that refers to untrusted content. */ - class CDNScriptElementWithUntrustedContent extends AddsUntrustedUrl, HTML::ScriptElement { - CDNScriptElementWithUntrustedContent() { + class CdnScriptElementWithUntrustedContent extends AddsUntrustedUrl, HTML::ScriptElement { + CdnScriptElementWithUntrustedContent() { not exists(string digest | not digest = "" | this.getIntegrityDigest() = digest) and isCdnUrlWithCheckingRequired(this.getSourcePath()) } diff --git a/javascript/ql/src/experimental/Security/CWE-094/UntrustedCheckout.ql b/javascript/ql/src/experimental/Security/CWE-094/UntrustedCheckout.ql index ee410fe92457..dc89f8530aa8 100644 --- a/javascript/ql/src/experimental/Security/CWE-094/UntrustedCheckout.ql +++ b/javascript/ql/src/experimental/Security/CWE-094/UntrustedCheckout.ql @@ -78,9 +78,9 @@ class ProbableJob extends Actions::Job { /** * An action step that doesn't contain `actor` or `label` check in `if:` or */ -class ProbablePullRequestTarget extends Actions::On, YAMLMappingLikeNode { +class ProbablePullRequestTarget extends Actions::On, YamlMappingLikeNode { ProbablePullRequestTarget() { - exists(YAMLNode prtNode | + exists(YamlNode prtNode | // The `on:` is triggered on `pull_request_target` this.getNode("pull_request_target") = prtNode and ( @@ -88,7 +88,7 @@ class ProbablePullRequestTarget extends Actions::On, YAMLMappingLikeNode { not exists(prtNode.getAChild()) or // or has the filter, that is something else than just [labeled] - exists(YAMLMappingLikeNode prt, YAMLMappingLikeNode types | + exists(YamlMappingLikeNode prt, YamlMappingLikeNode types | types = prt.getNode("types") and prtNode = prt and ( diff --git a/javascript/ql/test/library-tests/YAML/tests.ql b/javascript/ql/test/library-tests/YAML/tests.ql index 664b727402ed..469b57fa67c7 100644 --- a/javascript/ql/test/library-tests/YAML/tests.ql +++ b/javascript/ql/test/library-tests/YAML/tests.ql @@ -1,18 +1,18 @@ import javascript -query predicate anchors(YAMLNode n, string anchor) { n.getAnchor() = anchor } +query predicate anchors(YamlNode n, string anchor) { n.getAnchor() = anchor } -query predicate eval(YAMLNode n, YAMLValue eval) { +query predicate eval(YamlNode n, YamlValue eval) { not n.eval() = n and eval = n.eval() } -query predicate yamlParseError(YAMLParseError err) { any() } +query predicate yamlParseError(YamlParseError err) { any() } -query predicate yamlMapping_maps(YAMLMapping m, YAMLValue k, YAMLValue v) { m.maps(k, v) } +query predicate yamlMapping_maps(YamlMapping m, YamlValue k, YamlValue v) { m.maps(k, v) } -query predicate yamlNode(YAMLNode n, string tag) { tag = n.getTag() } +query predicate yamlNode(YamlNode n, string tag) { tag = n.getTag() } -query predicate yamlScalar(YAMLScalar s, string style, string value) { +query predicate yamlScalar(YamlScalar s, string style, string value) { style = s.getStyle() and value = s.getValue() } diff --git a/javascript/ql/test/library-tests/frameworks/GWT/GWTGeneratedTopLevel.ql b/javascript/ql/test/library-tests/frameworks/GWT/GWTGeneratedTopLevel.ql index bc3d25d7e2d3..335086bd7de2 100644 --- a/javascript/ql/test/library-tests/frameworks/GWT/GWTGeneratedTopLevel.ql +++ b/javascript/ql/test/library-tests/frameworks/GWT/GWTGeneratedTopLevel.ql @@ -1,4 +1,4 @@ import semmle.javascript.frameworks.GWT -from GWTGeneratedTopLevel g +from GwtGeneratedTopLevel g select g diff --git a/javascript/ql/test/library-tests/frameworks/GWT/GWTHeader.ql b/javascript/ql/test/library-tests/frameworks/GWT/GWTHeader.ql index 14a5da47e4ad..c504c8ca7bd9 100644 --- a/javascript/ql/test/library-tests/frameworks/GWT/GWTHeader.ql +++ b/javascript/ql/test/library-tests/frameworks/GWT/GWTHeader.ql @@ -1,4 +1,4 @@ import semmle.javascript.frameworks.GWT -from GWTHeader h +from GwtHeader h select h diff --git a/javascript/ql/test/tutorials/Validating RAML-based APIs/RAML.qll b/javascript/ql/test/tutorials/Validating RAML-based APIs/RAML.qll index 1156ea4c3980..a871d5e751ef 100644 --- a/javascript/ql/test/tutorials/Validating RAML-based APIs/RAML.qll +++ b/javascript/ql/test/tutorials/Validating RAML-based APIs/RAML.qll @@ -3,7 +3,7 @@ import javascript import HTTP /** A RAML specification. */ -class RamlSpec extends YAMLDocument, YAMLMapping { +class RamlSpec extends YamlDocument, YamlMapping { RamlSpec() { getLocation().getFile().getExtension() = "raml" } } @@ -11,10 +11,10 @@ class RamlSpec extends YAMLDocument, YAMLMapping { deprecated class RAMLSpec = RamlSpec; /** A RAML resource specification. */ -class RamlResource extends YAMLMapping { +class RamlResource extends YamlMapping { RamlResource() { getDocument() instanceof RamlSpec and - exists(YAMLMapping m, string name | + exists(YamlMapping m, string name | this = m.lookup(name) and name.matches("/%") ) @@ -41,16 +41,16 @@ class RamlResource extends YAMLMapping { deprecated class RAMLResource = RamlResource; /** A RAML method specification. */ -class RamlMethod extends YAMLValue { +class RamlMethod extends YamlValue { RamlMethod() { getDocument() instanceof RamlSpec and - exists(YAMLMapping obj | this = obj.lookup(httpVerb())) + exists(YamlMapping obj | this = obj.lookup(httpVerb())) } /** Get the response specification for the given status code. */ - YAMLValue getResponse(int code) { - exists(YAMLMapping obj, string s | - obj = this.(YAMLMapping).lookup("responses") and + YamlValue getResponse(int code) { + exists(YamlMapping obj, string s | + obj = this.(YamlMapping).lookup("responses") and result = obj.lookup(s) and code = s.toInt() ) diff --git a/javascript/ql/test/tutorials/Validating RAML-based APIs/query1.ql b/javascript/ql/test/tutorials/Validating RAML-based APIs/query1.ql index a20fd7f18f18..6a5c8cf71cbb 100644 --- a/javascript/ql/test/tutorials/Validating RAML-based APIs/query1.ql +++ b/javascript/ql/test/tutorials/Validating RAML-based APIs/query1.ql @@ -1,7 +1,7 @@ import javascript /** A RAML specification. */ -class RamlSpec extends YAMLDocument, YAMLMapping { +class RamlSpec extends YamlDocument, YamlMapping { RamlSpec() { getLocation().getFile().getExtension() = "raml" } } diff --git a/javascript/ql/test/tutorials/Validating RAML-based APIs/query2.ql b/javascript/ql/test/tutorials/Validating RAML-based APIs/query2.ql index e0230cbfdb06..47e264001e48 100644 --- a/javascript/ql/test/tutorials/Validating RAML-based APIs/query2.ql +++ b/javascript/ql/test/tutorials/Validating RAML-based APIs/query2.ql @@ -3,15 +3,15 @@ import javascript string httpVerb() { result = ["get", "put", "post", "delete"] } /** A RAML specification. */ -class RamlSpec extends YAMLDocument, YAMLMapping { +class RamlSpec extends YamlDocument, YamlMapping { RamlSpec() { getLocation().getFile().getExtension() = "raml" } } /** A RAML resource specification. */ -class RamlResource extends YAMLMapping { +class RamlResource extends YamlMapping { RamlResource() { getDocument() instanceof RamlSpec and - exists(YAMLMapping m, string name | + exists(YamlMapping m, string name | this = m.lookup(name) and name.matches("/%") ) @@ -35,16 +35,16 @@ class RamlResource extends YAMLMapping { } /** A RAML method specification. */ -class RamlMethod extends YAMLValue { +class RamlMethod extends YamlValue { RamlMethod() { getDocument() instanceof RamlSpec and - exists(YAMLMapping obj | this = obj.lookup(httpVerb())) + exists(YamlMapping obj | this = obj.lookup(httpVerb())) } /** Get the response specification for the given status code. */ - YAMLValue getResponse(int code) { - exists(YAMLMapping obj, string s | - obj = this.(YAMLMapping).lookup("responses") and + YamlValue getResponse(int code) { + exists(YamlMapping obj, string s | + obj = this.(YamlMapping).lookup("responses") and result = obj.lookup(s) and code = s.toInt() ) diff --git a/javascript/ql/test/tutorials/Validating RAML-based APIs/query3.ql b/javascript/ql/test/tutorials/Validating RAML-based APIs/query3.ql index 60ee68a83691..12e38689590e 100644 --- a/javascript/ql/test/tutorials/Validating RAML-based APIs/query3.ql +++ b/javascript/ql/test/tutorials/Validating RAML-based APIs/query3.ql @@ -3,15 +3,15 @@ import javascript string httpVerb() { result = ["get", "put", "post", "delete"] } /** A RAML specification. */ -class RamlSpec extends YAMLDocument, YAMLMapping { +class RamlSpec extends YamlDocument, YamlMapping { RamlSpec() { getLocation().getFile().getExtension() = "raml" } } /** A RAML resource specification. */ -class RamlResource extends YAMLMapping { +class RamlResource extends YamlMapping { RamlResource() { getDocument() instanceof RamlSpec and - exists(YAMLMapping m, string name | + exists(YamlMapping m, string name | this = m.lookup(name) and name.matches("/%") ) @@ -34,10 +34,10 @@ class RamlResource extends YAMLMapping { } } -class RamlMethod extends YAMLValue { +class RamlMethod extends YamlValue { RamlMethod() { getDocument() instanceof RamlSpec and - exists(YAMLMapping obj | this = obj.lookup(httpVerb())) + exists(YamlMapping obj | this = obj.lookup(httpVerb())) } } diff --git a/javascript/ql/test/tutorials/Validating RAML-based APIs/query4.ql b/javascript/ql/test/tutorials/Validating RAML-based APIs/query4.ql index 0cabb0adb256..fe3986d27637 100644 --- a/javascript/ql/test/tutorials/Validating RAML-based APIs/query4.ql +++ b/javascript/ql/test/tutorials/Validating RAML-based APIs/query4.ql @@ -3,15 +3,15 @@ import javascript string httpVerb() { result = ["get", "put", "post", "delete"] } /** A RAML specification. */ -class RamlSpec extends YAMLDocument, YAMLMapping { +class RamlSpec extends YamlDocument, YamlMapping { RamlSpec() { getLocation().getFile().getExtension() = "raml" } } /** A RAML resource specification. */ -class RamlResource extends YAMLMapping { +class RamlResource extends YamlMapping { RamlResource() { getDocument() instanceof RamlSpec and - exists(YAMLMapping m, string name | + exists(YamlMapping m, string name | this = m.lookup(name) and name.matches("/%") ) @@ -35,16 +35,16 @@ class RamlResource extends YAMLMapping { } /** A RAML method specification. */ -class RamlMethod extends YAMLValue { +class RamlMethod extends YamlValue { RamlMethod() { getDocument() instanceof RamlSpec and - exists(YAMLMapping obj | this = obj.lookup(httpVerb())) + exists(YamlMapping obj | this = obj.lookup(httpVerb())) } /** Get the response specification for the given status code. */ - YAMLValue getResponse(int code) { - exists(YAMLMapping obj, string s | - obj = this.(YAMLMapping).lookup("responses") and + YamlValue getResponse(int code) { + exists(YamlMapping obj, string s | + obj = this.(YamlMapping).lookup("responses") and result = obj.lookup(s) and code = s.toInt() ) diff --git a/python/ql/lib/semmle/python/frameworks/Stdlib.qll b/python/ql/lib/semmle/python/frameworks/Stdlib.qll index 3ba54a417187..9b5ff4c291e2 100644 --- a/python/ql/lib/semmle/python/frameworks/Stdlib.qll +++ b/python/ql/lib/semmle/python/frameworks/Stdlib.qll @@ -2098,8 +2098,8 @@ private module StdlibPrivate { * * See https://docs.python.org/3.10/library/wsgiref.html#wsgiref.simple_server.WSGIRequestHandler.get_environ */ - class WSGIEnvirontParameter extends RemoteFlowSource::Range, DataFlow::ParameterNode { - WSGIEnvirontParameter() { + class WsgiEnvirontParameter extends RemoteFlowSource::Range, DataFlow::ParameterNode { + WsgiEnvirontParameter() { exists(WsgirefSimpleServerApplication func | if func.isMethod() then this.getParameter() = func.getArg(1) @@ -2112,6 +2112,9 @@ private module StdlibPrivate { } } + /** DEPRECATED: Alias for WsgiEnvirontParameter */ + deprecated class WSGIEnvirontParameter = WsgiEnvirontParameter; + /** * Gets a reference to the parameter of a `WsgirefSimpleServerApplication` that * takes the `start_response` function. diff --git a/python/ql/src/experimental/semmle/python/frameworks/Django.qll b/python/ql/src/experimental/semmle/python/frameworks/Django.qll index f1895af0ea91..58d1c6a4abe3 100644 --- a/python/ql/src/experimental/semmle/python/frameworks/Django.qll +++ b/python/ql/src/experimental/semmle/python/frameworks/Django.qll @@ -22,11 +22,14 @@ private module ExperimentalPrivateDjango { module Request { module HttpRequest { - class DjangoGETParameter extends DataFlow::Node, RemoteFlowSource::Range { - DjangoGETParameter() { this = request().getMember("GET").getMember("get").getACall() } + class DjangoGetParameter extends DataFlow::Node, RemoteFlowSource::Range { + DjangoGetParameter() { this = request().getMember("GET").getMember("get").getACall() } override string getSourceType() { result = "django.http.request.GET.get" } } + + /** DEPRECATED: Alias for DjangoGetParameter */ + deprecated class DjangoGETParameter = DjangoGetParameter; } } diff --git a/python/ql/src/experimental/semmle/python/frameworks/LDAP.qll b/python/ql/src/experimental/semmle/python/frameworks/LDAP.qll index 6ba16ae4a4e2..d95149bfc504 100644 --- a/python/ql/src/experimental/semmle/python/frameworks/LDAP.qll +++ b/python/ql/src/experimental/semmle/python/frameworks/LDAP.qll @@ -126,9 +126,9 @@ private module Ldap { ( // ldap_connection.start_tls_s() // see https://www.python-ldap.org/en/python-ldap-3.3.0/reference/ldap.html#ldap.LDAPObject.start_tls_s - exists(DataFlow::MethodCallNode startTLS | - startTLS.getObject().getALocalSource() = initialize and - startTLS.getMethodName() = "start_tls_s" + exists(DataFlow::MethodCallNode startTls | + startTls.getObject().getALocalSource() = initialize and + startTls.getMethodName() = "start_tls_s" ) or // ldap_connection.set_option(ldap.OPT_X_TLS_%s, True) @@ -234,9 +234,9 @@ private module Ldap { or // ldap_connection.start_tls_s() // see https://www.python-ldap.org/en/python-ldap-3.3.0/reference/ldap.html#ldap.LDAPObject.start_tls_s - exists(DataFlow::MethodCallNode startTLS | - startTLS.getMethodName() = "start_tls_s" and - startTLS.getObject().getALocalSource() = this + exists(DataFlow::MethodCallNode startTls | + startTls.getMethodName() = "start_tls_s" and + startTls.getObject().getALocalSource() = this ) } diff --git a/python/ql/src/experimental/semmle/python/libraries/SmtpLib.qll b/python/ql/src/experimental/semmle/python/libraries/SmtpLib.qll index 8d69bcb1a629..3eeca7a560ca 100644 --- a/python/ql/src/experimental/semmle/python/libraries/SmtpLib.qll +++ b/python/ql/src/experimental/semmle/python/libraries/SmtpLib.qll @@ -31,8 +31,8 @@ module SmtpLib { * argument. Used because of the impossibility to get local source nodes from `_subparts`' * `(List|Tuple)` elements. */ - private class SMTPMessageConfig extends TaintTracking2::Configuration { - SMTPMessageConfig() { this = "SMTPMessageConfig" } + private class SmtpMessageConfig extends TaintTracking2::Configuration { + SmtpMessageConfig() { this = "SMTPMessageConfig" } override predicate isSource(DataFlow::Node source) { source = mimeText(_) } @@ -87,7 +87,7 @@ module SmtpLib { sink = [sendCall.getArg(2), sendCall.getArg(2).(DataFlow::MethodCallNode).getObject()] .getALocalSource() and - any(SMTPMessageConfig a) + any(SmtpMessageConfig a) .hasFlow(source, sink.(DataFlow::CallCfgNode).getArgByName("_subparts")) or // via .attach() @@ -117,7 +117,7 @@ module SmtpLib { * * `sub` would be `message["Subject"]` (`Subscript`) * * `result` would be `"multipart test"` */ - private DataFlow::Node getSMTPSubscriptByIndex(DataFlow::CallCfgNode sendCall, string index) { + private DataFlow::Node getSmtpSubscriptByIndex(DataFlow::CallCfgNode sendCall, string index) { exists(DefinitionNode def, Subscript sub | sub = def.getNode() and DataFlow::exprNode(sub.getObject()).getALocalSource() = @@ -163,15 +163,15 @@ module SmtpLib { override DataFlow::Node getHtmlBody() { result = getSmtpMessage(this, "html") } override DataFlow::Node getTo() { - result in [this.getArg(1), getSMTPSubscriptByIndex(this, "To")] + result in [this.getArg(1), getSmtpSubscriptByIndex(this, "To")] } override DataFlow::Node getFrom() { - result in [this.getArg(0), getSMTPSubscriptByIndex(this, "From")] + result in [this.getArg(0), getSmtpSubscriptByIndex(this, "From")] } override DataFlow::Node getSubject() { - result in [this.getArg(2), getSMTPSubscriptByIndex(this, "Subject")] + result in [this.getArg(2), getSmtpSubscriptByIndex(this, "Subject")] } } } diff --git a/python/ql/test/experimental/dataflow/TestUtil/NormalDataflowTest.qll b/python/ql/test/experimental/dataflow/TestUtil/NormalDataflowTest.qll index 5f19564c0282..b0f0009b30d3 100644 --- a/python/ql/test/experimental/dataflow/TestUtil/NormalDataflowTest.qll +++ b/python/ql/test/experimental/dataflow/TestUtil/NormalDataflowTest.qll @@ -13,7 +13,7 @@ class DataFlowTest extends FlowTest { } } -query predicate missingAnnotationOnSINK(Location location, string error, string element) { +query predicate missingAnnotationOnSink(Location location, string error, string element) { error = "ERROR, you should add `# $ MISSING: flow` annotation" and exists(DataFlow::Node sink | exists(DataFlow::CallCfgNode call | @@ -31,3 +31,6 @@ query predicate missingAnnotationOnSINK(Location location, string error, string ) ) } + +/** DEPRECATED: Alias for missingAnnotationOnSink */ +deprecated predicate missingAnnotationOnSINK = missingAnnotationOnSink/3; diff --git a/ql/ql/src/codeql_ql/ast/Ast.qll b/ql/ql/src/codeql_ql/ast/Ast.qll index 7e7013b36c74..21fc1ad566bc 100644 --- a/ql/ql/src/codeql_ql/ast/Ast.qll +++ b/ql/ql/src/codeql_ql/ast/Ast.qll @@ -2477,15 +2477,18 @@ class BindingSet extends Annotation { */ module YAML { /** A node in a YAML file */ - class YAMLNode extends TYamlNode, AstNode { + class YamlNode extends TYamlNode, AstNode { /** Holds if the predicate is a root node (has no parent) */ predicate isRoot() { not exists(this.getParent()) } override AstNode getParent() { toGenerateYaml(result) = toGenerateYaml(this).getParent() } } + /** DEPRECATED: Alias for YamlNode */ + deprecated class YAMLNode = YamlNode; + /** A YAML comment. */ - class YamlComment extends TYamlCommemt, YAMLNode { + class YamlComment extends TYamlCommemt, YamlNode { Yaml::Comment yamlcomment; YamlComment() { this = TYamlCommemt(yamlcomment) } @@ -2497,7 +2500,7 @@ module YAML { deprecated class YAMLComment = YamlComment; /** A YAML entry. */ - class YamlEntry extends TYamlEntry, YAMLNode { + class YamlEntry extends TYamlEntry, YamlNode { Yaml::Entry yamle; YamlEntry() { this = TYamlEntry(yamle) } @@ -2527,7 +2530,7 @@ module YAML { deprecated class YAMLEntry = YamlEntry; /** A YAML key. */ - class YamlKey extends TYamlKey, YAMLNode { + class YamlKey extends TYamlKey, YamlNode { Yaml::Key yamlkey; YamlKey() { this = TYamlKey(yamlkey) } @@ -2566,7 +2569,7 @@ module YAML { deprecated class YAMLKey = YamlKey; /** A YAML list item. */ - class YamlListItem extends TYamlListitem, YAMLNode { + class YamlListItem extends TYamlListitem, YamlNode { Yaml::Listitem yamllistitem; YamlListItem() { this = TYamlListitem(yamllistitem) } @@ -2583,7 +2586,7 @@ module YAML { deprecated class YAMLListItem = YamlListItem; /** A YAML value. */ - class YamlValue extends TYamlValue, YAMLNode { + class YamlValue extends TYamlValue, YamlNode { Yaml::Value yamlvalue; YamlValue() { this = TYamlValue(yamlvalue) } @@ -2691,7 +2694,7 @@ module YAML { Location getLocation() { // hacky, just pick the first node in the file. result = - min(YAMLNode entry, Location l, File f | + min(YamlNode entry, Location l, File f | entry.getLocation().getFile() = file and f = file and l = entry.getLocation() diff --git a/ruby/ql/lib/codeql/ruby/frameworks/XmlParsing.qll b/ruby/ql/lib/codeql/ruby/frameworks/XmlParsing.qll index 8113bb537e29..51fa3d5f76b1 100644 --- a/ruby/ql/lib/codeql/ruby/frameworks/XmlParsing.qll +++ b/ruby/ql/lib/codeql/ruby/frameworks/XmlParsing.qll @@ -97,13 +97,13 @@ class Feature extends TFeature { abstract string getConstantName(); } -private class FeatureNOENT extends Feature, TNOENT { +private class FeatureNoent extends Feature, TNOENT { override int getValue() { result = 2 } override string getConstantName() { result = "NOENT" } } -private class FeatureNONET extends Feature, TNONET { +private class FeatureNonet extends Feature, TNONET { override int getValue() { result = 2048 } override string getConstantName() { result = "NONET" } From ebb1106d9d5d924557255f21233e183e56950b18 Mon Sep 17 00:00:00 2001 From: erik-krogh Date: Wed, 24 Aug 2022 14:03:59 +0200 Subject: [PATCH 2/4] add missing qldoc --- java/ql/lib/semmle/code/java/deadcode/EntryPoints.qll | 2 ++ 1 file changed, 2 insertions(+) diff --git a/java/ql/lib/semmle/code/java/deadcode/EntryPoints.qll b/java/ql/lib/semmle/code/java/deadcode/EntryPoints.qll index 493df8d7979f..d6d0653c1eac 100644 --- a/java/ql/lib/semmle/code/java/deadcode/EntryPoints.qll +++ b/java/ql/lib/semmle/code/java/deadcode/EntryPoints.qll @@ -128,6 +128,7 @@ class JacksonMixinCallableEntryPoint extends EntryPoint { override Callable getALiveCallable() { result = this } } +/** A JAX annotation seen as a reflectively constructed class. */ class JaxAnnotationReflectivelyConstructedClass extends ReflectivelyConstructedClass { JaxAnnotationReflectivelyConstructedClass() { this instanceof JaxWsEndpoint or @@ -346,6 +347,7 @@ class GsonDeserializationEntryPoint extends ReflectivelyConstructedClass { } } +/** A JAXB deserialization entry point seen as a reflectively constructed class. */ class JaxbDeserializationEntryPoint extends ReflectivelyConstructedClass { JaxbDeserializationEntryPoint() { // A class can be deserialized by JAXB if it's an `XmlRootElement`... From 4b06bca770d3f3e79953f9e4babd99d1a3a97ed0 Mon Sep 17 00:00:00 2001 From: erik-krogh Date: Wed, 24 Aug 2022 14:45:22 +0200 Subject: [PATCH 3/4] fixup getAPrimaryQlClass --- javascript/ql/lib/semmle/javascript/YAML.qll | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/javascript/ql/lib/semmle/javascript/YAML.qll b/javascript/ql/lib/semmle/javascript/YAML.qll index fa8dd72b7057..e7b491654997 100644 --- a/javascript/ql/lib/semmle/javascript/YAML.qll +++ b/javascript/ql/lib/semmle/javascript/YAML.qll @@ -86,7 +86,7 @@ class YamlNode extends @yaml_node, Locatable { */ YamlValue eval() { result = this } - override string getAPrimaryQlClass() { result = "YAMLNode" } + override string getAPrimaryQlClass() { result = "YamlNode" } } /** DEPRECATED: Alias for YamlNode */ @@ -153,7 +153,7 @@ class YamlScalar extends YamlValue, @yaml_scalar_node { */ string getValue() { yaml_scalars(this, _, result) } - override string getAPrimaryQlClass() { result = "YAMLScalar" } + override string getAPrimaryQlClass() { result = "YamlScalar" } } /** DEPRECATED: Alias for YamlScalar */ @@ -344,7 +344,7 @@ deprecated class YAMLInclude = YamlInclude; * ``` */ class YamlCollection extends YamlValue, @yaml_collection_node { - override string getAPrimaryQlClass() { result = "YAMLCollection" } + override string getAPrimaryQlClass() { result = "YamlCollection" } } /** DEPRECATED: Alias for YamlCollection */ @@ -401,7 +401,7 @@ class YamlMapping extends YamlCollection, @yaml_mapping_node { */ YamlValue lookup(string key) { exists(YamlScalar s | s.getValue() = key | this.maps(s, result)) } - override string getAPrimaryQlClass() { result = "YAMLMapping" } + override string getAPrimaryQlClass() { result = "YamlMapping" } } /** DEPRECATED: Alias for YamlMapping */ @@ -429,7 +429,7 @@ class YamlSequence extends YamlCollection, @yaml_sequence_node { */ YamlValue getElement(int i) { result = this.getElementNode(i).eval() } - override string getAPrimaryQlClass() { result = "YAMLSequence" } + override string getAPrimaryQlClass() { result = "YamlSequence" } } /** DEPRECATED: Alias for YamlSequence */ @@ -455,7 +455,7 @@ class YamlAliasNode extends YamlNode, @yaml_alias_node { */ string getTarget() { yaml_aliases(this, result) } - override string getAPrimaryQlClass() { result = "YAMLAliasNode" } + override string getAPrimaryQlClass() { result = "YamlAliasNode" } } /** DEPRECATED: Alias for YamlAliasNode */ From 1d1aa7c8b4aa2f115ba4262c2bf91f4818254bf5 Mon Sep 17 00:00:00 2001 From: erik-krogh Date: Wed, 24 Aug 2022 17:26:30 +0200 Subject: [PATCH 4/4] update some expected output --- .../test/library-tests/YAML/printAst.expected | 266 +++++++++--------- .../coverage/NormalDataflowTest.expected | 2 +- .../fieldflow/NormalDataflowTest.expected | 2 +- .../match/NormalDataflowTest.expected | 2 +- .../README.md | 4 +- .../test-1-normal/NormalDataflowTest.expected | 2 +- .../NormalDataflowTest.expected | 2 +- .../NormalDataflowTest.expected | 2 +- .../NormalDataflowTest.expected | 2 +- .../NormalDataflowTest.expected | 2 +- .../NormalDataflowTest.expected | 2 +- .../django-orm/NormalDataflowTest.expected | 2 +- 12 files changed, 145 insertions(+), 145 deletions(-) diff --git a/javascript/ql/test/library-tests/YAML/printAst.expected b/javascript/ql/test/library-tests/YAML/printAst.expected index 765288fe38ec..1be958a78a42 100644 --- a/javascript/ql/test/library-tests/YAML/printAst.expected +++ b/javascript/ql/test/library-tests/YAML/printAst.expected @@ -1,6 +1,6 @@ nodes -| external.yml:1:1:1:2 | [YAMLScalar] 42 | semmle.label | [YAMLScalar] 42 | -| external.yml:1:1:1:2 | [YAMLScalar] 42 | semmle.order | 1 | +| external.yml:1:1:1:2 | [YamlScalar] 42 | semmle.label | [YamlScalar] 42 | +| external.yml:1:1:1:2 | [YamlScalar] 42 | semmle.order | 1 | | file://:0:0:0:0 | (Mapping 0) name: | semmle.label | (Mapping 0) name: | | file://:0:0:0:0 | (Mapping 0) name: | semmle.label | (Mapping 0) name: | | file://:0:0:0:0 | (Mapping 0) street: | semmle.label | (Mapping 0) street: | @@ -15,137 +15,137 @@ nodes | file://:0:0:0:0 | (Mapping 1) y: | semmle.label | (Mapping 1) y: | | file://:0:0:0:0 | (Mapping 2) country: | semmle.label | (Mapping 2) country: | | file://:0:0:0:0 | (Mapping 2) country: | semmle.label | (Mapping 2) country: | -| merge.yaml:1:1:3:8 | [YAMLSequence] - &A { ... y: 42 } | semmle.label | [YAMLSequence] - &A { ... y: 42 } | -| merge.yaml:1:1:3:8 | [YAMLSequence] - &A { ... y: 42 } | semmle.order | 2 | -| merge.yaml:1:3:1:21 | [YAMLMapping] &A { x: 23, y: 42 } | semmle.label | [YAMLMapping] &A { x: 23, y: 42 } | -| merge.yaml:1:8:1:8 | [YAMLScalar] x | semmle.label | [YAMLScalar] x | -| merge.yaml:1:11:1:12 | [YAMLScalar] 23 | semmle.label | [YAMLScalar] 23 | -| merge.yaml:1:15:1:15 | [YAMLScalar] y | semmle.label | [YAMLScalar] y | -| merge.yaml:1:18:1:19 | [YAMLScalar] 42 | semmle.label | [YAMLScalar] 42 | -| merge.yaml:2:3:2:3 | [YAMLScalar] x | semmle.label | [YAMLScalar] x | -| merge.yaml:2:3:3:8 | [YAMLMapping] x: 56 | semmle.label | [YAMLMapping] x: 56 | -| merge.yaml:2:6:2:7 | [YAMLScalar] 56 | semmle.label | [YAMLScalar] 56 | -| merge.yaml:3:3:3:4 | [YAMLScalar] << | semmle.label | [YAMLScalar] << | -| merge.yaml:3:7:3:8 | [YAMLAliasNode] *A | semmle.label | [YAMLAliasNode] *A | -| tst.yml:1:1:14:23 | [YAMLSequence] - "name ... Knopf" | semmle.label | [YAMLSequence] - "name ... Knopf" | -| tst.yml:1:1:14:23 | [YAMLSequence] - "name ... Knopf" | semmle.order | 3 | -| tst.yml:1:3:1:8 | [YAMLScalar] "name" | semmle.label | [YAMLScalar] "name" | -| tst.yml:1:3:7:0 | [YAMLMapping] "name": "Jim Knopf" | semmle.label | [YAMLMapping] "name": "Jim Knopf" | -| tst.yml:1:11:1:21 | [YAMLScalar] "Jim Knopf" | semmle.label | [YAMLScalar] "Jim Knopf" | -| tst.yml:2:3:2:9 | [YAMLScalar] address | semmle.label | [YAMLScalar] address | -| tst.yml:2:12:6:3 | [YAMLMapping] { | semmle.label | [YAMLMapping] { | -| tst.yml:3:5:3:12 | [YAMLScalar] "street" | semmle.label | [YAMLScalar] "street" | -| tst.yml:3:14:3:13 | [YAMLScalar] | semmle.label | [YAMLScalar] | -| tst.yml:4:5:4:12 | [YAMLScalar] "number" | semmle.label | [YAMLScalar] "number" | -| tst.yml:4:15:4:16 | [YAMLScalar] -1 | semmle.label | [YAMLScalar] -1 | -| tst.yml:5:5:5:13 | [YAMLScalar] "country" | semmle.label | [YAMLScalar] "country" | -| tst.yml:5:16:5:27 | [YAMLScalar] "Lummerland" | semmle.label | [YAMLScalar] "Lummerland" | -| tst.yml:7:3:7:6 | [YAMLScalar] name | semmle.label | [YAMLScalar] name | -| tst.yml:7:3:14:0 | [YAMLMapping] name: Frau Mahlzahn | semmle.label | [YAMLMapping] name: Frau Mahlzahn | -| tst.yml:7:9:7:21 | [YAMLScalar] Frau Mahlzahn | semmle.label | [YAMLScalar] Frau Mahlzahn | -| tst.yml:8:3:8:9 | [YAMLScalar] address | semmle.label | [YAMLScalar] address | -| tst.yml:9:5:9:10 | [YAMLScalar] street | semmle.label | [YAMLScalar] street | -| tst.yml:9:5:14:0 | [YAMLMapping] street: \| | semmle.label | [YAMLMapping] street: \| | -| tst.yml:9:13:11:0 | [YAMLScalar] \| | semmle.label | [YAMLScalar] \| | -| tst.yml:11:5:11:10 | [YAMLScalar] number | semmle.label | [YAMLScalar] number | -| tst.yml:11:13:11:15 | [YAMLScalar] 133 | semmle.label | [YAMLScalar] 133 | -| tst.yml:12:5:12:11 | [YAMLScalar] country | semmle.label | [YAMLScalar] country | -| tst.yml:12:14:13:18 | [YAMLScalar] < | semmle.label | [YAMLScalar] < | -| tst.yml:14:3:14:23 | [YAMLScalar] !includ ... nal.yml | semmle.label | [YAMLScalar] !includ ... nal.yml | +| merge.yaml:1:1:3:8 | [YamlSequence] - &A { ... y: 42 } | semmle.label | [YamlSequence] - &A { ... y: 42 } | +| merge.yaml:1:1:3:8 | [YamlSequence] - &A { ... y: 42 } | semmle.order | 2 | +| merge.yaml:1:3:1:21 | [YamlMapping] &A { x: 23, y: 42 } | semmle.label | [YamlMapping] &A { x: 23, y: 42 } | +| merge.yaml:1:8:1:8 | [YamlScalar] x | semmle.label | [YamlScalar] x | +| merge.yaml:1:11:1:12 | [YamlScalar] 23 | semmle.label | [YamlScalar] 23 | +| merge.yaml:1:15:1:15 | [YamlScalar] y | semmle.label | [YamlScalar] y | +| merge.yaml:1:18:1:19 | [YamlScalar] 42 | semmle.label | [YamlScalar] 42 | +| merge.yaml:2:3:2:3 | [YamlScalar] x | semmle.label | [YamlScalar] x | +| merge.yaml:2:3:3:8 | [YamlMapping] x: 56 | semmle.label | [YamlMapping] x: 56 | +| merge.yaml:2:6:2:7 | [YamlScalar] 56 | semmle.label | [YamlScalar] 56 | +| merge.yaml:3:3:3:4 | [YamlScalar] << | semmle.label | [YamlScalar] << | +| merge.yaml:3:7:3:8 | [YamlAliasNode] *A | semmle.label | [YamlAliasNode] *A | +| tst.yml:1:1:14:23 | [YamlSequence] - "name ... Knopf" | semmle.label | [YamlSequence] - "name ... Knopf" | +| tst.yml:1:1:14:23 | [YamlSequence] - "name ... Knopf" | semmle.order | 3 | +| tst.yml:1:3:1:8 | [YamlScalar] "name" | semmle.label | [YamlScalar] "name" | +| tst.yml:1:3:7:0 | [YamlMapping] "name": "Jim Knopf" | semmle.label | [YamlMapping] "name": "Jim Knopf" | +| tst.yml:1:11:1:21 | [YamlScalar] "Jim Knopf" | semmle.label | [YamlScalar] "Jim Knopf" | +| tst.yml:2:3:2:9 | [YamlScalar] address | semmle.label | [YamlScalar] address | +| tst.yml:2:12:6:3 | [YamlMapping] { | semmle.label | [YamlMapping] { | +| tst.yml:3:5:3:12 | [YamlScalar] "street" | semmle.label | [YamlScalar] "street" | +| tst.yml:3:14:3:13 | [YamlScalar] | semmle.label | [YamlScalar] | +| tst.yml:4:5:4:12 | [YamlScalar] "number" | semmle.label | [YamlScalar] "number" | +| tst.yml:4:15:4:16 | [YamlScalar] -1 | semmle.label | [YamlScalar] -1 | +| tst.yml:5:5:5:13 | [YamlScalar] "country" | semmle.label | [YamlScalar] "country" | +| tst.yml:5:16:5:27 | [YamlScalar] "Lummerland" | semmle.label | [YamlScalar] "Lummerland" | +| tst.yml:7:3:7:6 | [YamlScalar] name | semmle.label | [YamlScalar] name | +| tst.yml:7:3:14:0 | [YamlMapping] name: Frau Mahlzahn | semmle.label | [YamlMapping] name: Frau Mahlzahn | +| tst.yml:7:9:7:21 | [YamlScalar] Frau Mahlzahn | semmle.label | [YamlScalar] Frau Mahlzahn | +| tst.yml:8:3:8:9 | [YamlScalar] address | semmle.label | [YamlScalar] address | +| tst.yml:9:5:9:10 | [YamlScalar] street | semmle.label | [YamlScalar] street | +| tst.yml:9:5:14:0 | [YamlMapping] street: \| | semmle.label | [YamlMapping] street: \| | +| tst.yml:9:13:11:0 | [YamlScalar] \| | semmle.label | [YamlScalar] \| | +| tst.yml:11:5:11:10 | [YamlScalar] number | semmle.label | [YamlScalar] number | +| tst.yml:11:13:11:15 | [YamlScalar] 133 | semmle.label | [YamlScalar] 133 | +| tst.yml:12:5:12:11 | [YamlScalar] country | semmle.label | [YamlScalar] country | +| tst.yml:12:14:13:18 | [YamlScalar] < | semmle.label | [YamlScalar] < | +| tst.yml:14:3:14:23 | [YamlScalar] !includ ... nal.yml | semmle.label | [YamlScalar] !includ ... nal.yml | edges -| file://:0:0:0:0 | (Mapping 0) name: | tst.yml:1:3:1:8 | [YAMLScalar] "name" | semmle.label | 0 | -| file://:0:0:0:0 | (Mapping 0) name: | tst.yml:1:3:1:8 | [YAMLScalar] "name" | semmle.order | 0 | -| file://:0:0:0:0 | (Mapping 0) name: | tst.yml:1:11:1:21 | [YAMLScalar] "Jim Knopf" | semmle.label | 1 | -| file://:0:0:0:0 | (Mapping 0) name: | tst.yml:1:11:1:21 | [YAMLScalar] "Jim Knopf" | semmle.order | 1 | -| file://:0:0:0:0 | (Mapping 0) name: | tst.yml:7:3:7:6 | [YAMLScalar] name | semmle.label | 0 | -| file://:0:0:0:0 | (Mapping 0) name: | tst.yml:7:3:7:6 | [YAMLScalar] name | semmle.order | 0 | -| file://:0:0:0:0 | (Mapping 0) name: | tst.yml:7:9:7:21 | [YAMLScalar] Frau Mahlzahn | semmle.label | 1 | -| file://:0:0:0:0 | (Mapping 0) name: | tst.yml:7:9:7:21 | [YAMLScalar] Frau Mahlzahn | semmle.order | 1 | -| file://:0:0:0:0 | (Mapping 0) street: | tst.yml:3:5:3:12 | [YAMLScalar] "street" | semmle.label | 0 | -| file://:0:0:0:0 | (Mapping 0) street: | tst.yml:3:5:3:12 | [YAMLScalar] "street" | semmle.order | 0 | -| file://:0:0:0:0 | (Mapping 0) street: | tst.yml:3:14:3:13 | [YAMLScalar] | semmle.label | 1 | -| file://:0:0:0:0 | (Mapping 0) street: | tst.yml:3:14:3:13 | [YAMLScalar] | semmle.order | 1 | -| file://:0:0:0:0 | (Mapping 0) street: | tst.yml:9:5:9:10 | [YAMLScalar] street | semmle.label | 0 | -| file://:0:0:0:0 | (Mapping 0) street: | tst.yml:9:5:9:10 | [YAMLScalar] street | semmle.order | 0 | -| file://:0:0:0:0 | (Mapping 0) street: | tst.yml:9:13:11:0 | [YAMLScalar] \| | semmle.label | 1 | -| file://:0:0:0:0 | (Mapping 0) street: | tst.yml:9:13:11:0 | [YAMLScalar] \| | semmle.order | 1 | -| file://:0:0:0:0 | (Mapping 0) x: | merge.yaml:1:8:1:8 | [YAMLScalar] x | semmle.label | 0 | -| file://:0:0:0:0 | (Mapping 0) x: | merge.yaml:1:8:1:8 | [YAMLScalar] x | semmle.order | 0 | -| file://:0:0:0:0 | (Mapping 0) x: | merge.yaml:1:11:1:12 | [YAMLScalar] 23 | semmle.label | 1 | -| file://:0:0:0:0 | (Mapping 0) x: | merge.yaml:1:11:1:12 | [YAMLScalar] 23 | semmle.order | 1 | -| file://:0:0:0:0 | (Mapping 0) x: | merge.yaml:2:3:2:3 | [YAMLScalar] x | semmle.label | 0 | -| file://:0:0:0:0 | (Mapping 0) x: | merge.yaml:2:3:2:3 | [YAMLScalar] x | semmle.order | 0 | -| file://:0:0:0:0 | (Mapping 0) x: | merge.yaml:2:6:2:7 | [YAMLScalar] 56 | semmle.label | 1 | -| file://:0:0:0:0 | (Mapping 0) x: | merge.yaml:2:6:2:7 | [YAMLScalar] 56 | semmle.order | 1 | -| file://:0:0:0:0 | (Mapping 1) <<: | merge.yaml:3:3:3:4 | [YAMLScalar] << | semmle.label | 0 | -| file://:0:0:0:0 | (Mapping 1) <<: | merge.yaml:3:3:3:4 | [YAMLScalar] << | semmle.order | 0 | -| file://:0:0:0:0 | (Mapping 1) <<: | merge.yaml:3:7:3:8 | [YAMLAliasNode] *A | semmle.label | 1 | -| file://:0:0:0:0 | (Mapping 1) <<: | merge.yaml:3:7:3:8 | [YAMLAliasNode] *A | semmle.order | 1 | -| file://:0:0:0:0 | (Mapping 1) address: | tst.yml:2:3:2:9 | [YAMLScalar] address | semmle.label | 0 | -| file://:0:0:0:0 | (Mapping 1) address: | tst.yml:2:3:2:9 | [YAMLScalar] address | semmle.order | 0 | -| file://:0:0:0:0 | (Mapping 1) address: | tst.yml:2:12:6:3 | [YAMLMapping] { | semmle.label | 1 | -| file://:0:0:0:0 | (Mapping 1) address: | tst.yml:2:12:6:3 | [YAMLMapping] { | semmle.order | 1 | -| file://:0:0:0:0 | (Mapping 1) address: | tst.yml:8:3:8:9 | [YAMLScalar] address | semmle.label | 0 | -| file://:0:0:0:0 | (Mapping 1) address: | tst.yml:8:3:8:9 | [YAMLScalar] address | semmle.order | 0 | -| file://:0:0:0:0 | (Mapping 1) address: | tst.yml:9:5:14:0 | [YAMLMapping] street: \| | semmle.label | 1 | -| file://:0:0:0:0 | (Mapping 1) address: | tst.yml:9:5:14:0 | [YAMLMapping] street: \| | semmle.order | 1 | -| file://:0:0:0:0 | (Mapping 1) number: | tst.yml:4:5:4:12 | [YAMLScalar] "number" | semmle.label | 0 | -| file://:0:0:0:0 | (Mapping 1) number: | tst.yml:4:5:4:12 | [YAMLScalar] "number" | semmle.order | 0 | -| file://:0:0:0:0 | (Mapping 1) number: | tst.yml:4:15:4:16 | [YAMLScalar] -1 | semmle.label | 1 | -| file://:0:0:0:0 | (Mapping 1) number: | tst.yml:4:15:4:16 | [YAMLScalar] -1 | semmle.order | 1 | -| file://:0:0:0:0 | (Mapping 1) number: | tst.yml:11:5:11:10 | [YAMLScalar] number | semmle.label | 0 | -| file://:0:0:0:0 | (Mapping 1) number: | tst.yml:11:5:11:10 | [YAMLScalar] number | semmle.order | 0 | -| file://:0:0:0:0 | (Mapping 1) number: | tst.yml:11:13:11:15 | [YAMLScalar] 133 | semmle.label | 1 | -| file://:0:0:0:0 | (Mapping 1) number: | tst.yml:11:13:11:15 | [YAMLScalar] 133 | semmle.order | 1 | -| file://:0:0:0:0 | (Mapping 1) y: | merge.yaml:1:15:1:15 | [YAMLScalar] y | semmle.label | 0 | -| file://:0:0:0:0 | (Mapping 1) y: | merge.yaml:1:15:1:15 | [YAMLScalar] y | semmle.order | 0 | -| file://:0:0:0:0 | (Mapping 1) y: | merge.yaml:1:18:1:19 | [YAMLScalar] 42 | semmle.label | 1 | -| file://:0:0:0:0 | (Mapping 1) y: | merge.yaml:1:18:1:19 | [YAMLScalar] 42 | semmle.order | 1 | -| file://:0:0:0:0 | (Mapping 2) country: | tst.yml:5:5:5:13 | [YAMLScalar] "country" | semmle.label | 0 | -| file://:0:0:0:0 | (Mapping 2) country: | tst.yml:5:5:5:13 | [YAMLScalar] "country" | semmle.order | 0 | -| file://:0:0:0:0 | (Mapping 2) country: | tst.yml:5:16:5:27 | [YAMLScalar] "Lummerland" | semmle.label | 1 | -| file://:0:0:0:0 | (Mapping 2) country: | tst.yml:5:16:5:27 | [YAMLScalar] "Lummerland" | semmle.order | 1 | -| file://:0:0:0:0 | (Mapping 2) country: | tst.yml:12:5:12:11 | [YAMLScalar] country | semmle.label | 0 | -| file://:0:0:0:0 | (Mapping 2) country: | tst.yml:12:5:12:11 | [YAMLScalar] country | semmle.order | 0 | -| file://:0:0:0:0 | (Mapping 2) country: | tst.yml:12:14:13:18 | [YAMLScalar] < | semmle.label | 1 | -| file://:0:0:0:0 | (Mapping 2) country: | tst.yml:12:14:13:18 | [YAMLScalar] < | semmle.order | 1 | -| merge.yaml:1:1:3:8 | [YAMLSequence] - &A { ... y: 42 } | merge.yaml:1:3:1:21 | [YAMLMapping] &A { x: 23, y: 42 } | semmle.label | 0 | -| merge.yaml:1:1:3:8 | [YAMLSequence] - &A { ... y: 42 } | merge.yaml:1:3:1:21 | [YAMLMapping] &A { x: 23, y: 42 } | semmle.order | 0 | -| merge.yaml:1:1:3:8 | [YAMLSequence] - &A { ... y: 42 } | merge.yaml:2:3:3:8 | [YAMLMapping] x: 56 | semmle.label | 1 | -| merge.yaml:1:1:3:8 | [YAMLSequence] - &A { ... y: 42 } | merge.yaml:2:3:3:8 | [YAMLMapping] x: 56 | semmle.order | 1 | -| merge.yaml:1:3:1:21 | [YAMLMapping] &A { x: 23, y: 42 } | file://:0:0:0:0 | (Mapping 0) x: | semmle.label | 0 | -| merge.yaml:1:3:1:21 | [YAMLMapping] &A { x: 23, y: 42 } | file://:0:0:0:0 | (Mapping 0) x: | semmle.order | 0 | -| merge.yaml:1:3:1:21 | [YAMLMapping] &A { x: 23, y: 42 } | file://:0:0:0:0 | (Mapping 1) y: | semmle.label | 1 | -| merge.yaml:1:3:1:21 | [YAMLMapping] &A { x: 23, y: 42 } | file://:0:0:0:0 | (Mapping 1) y: | semmle.order | 1 | -| merge.yaml:2:3:3:8 | [YAMLMapping] x: 56 | file://:0:0:0:0 | (Mapping 0) x: | semmle.label | 0 | -| merge.yaml:2:3:3:8 | [YAMLMapping] x: 56 | file://:0:0:0:0 | (Mapping 0) x: | semmle.order | 0 | -| merge.yaml:2:3:3:8 | [YAMLMapping] x: 56 | file://:0:0:0:0 | (Mapping 1) <<: | semmle.label | 1 | -| merge.yaml:2:3:3:8 | [YAMLMapping] x: 56 | file://:0:0:0:0 | (Mapping 1) <<: | semmle.order | 1 | -| tst.yml:1:1:14:23 | [YAMLSequence] - "name ... Knopf" | tst.yml:1:3:7:0 | [YAMLMapping] "name": "Jim Knopf" | semmle.label | 0 | -| tst.yml:1:1:14:23 | [YAMLSequence] - "name ... Knopf" | tst.yml:1:3:7:0 | [YAMLMapping] "name": "Jim Knopf" | semmle.order | 0 | -| tst.yml:1:1:14:23 | [YAMLSequence] - "name ... Knopf" | tst.yml:7:3:14:0 | [YAMLMapping] name: Frau Mahlzahn | semmle.label | 1 | -| tst.yml:1:1:14:23 | [YAMLSequence] - "name ... Knopf" | tst.yml:7:3:14:0 | [YAMLMapping] name: Frau Mahlzahn | semmle.order | 1 | -| tst.yml:1:1:14:23 | [YAMLSequence] - "name ... Knopf" | tst.yml:14:3:14:23 | [YAMLScalar] !includ ... nal.yml | semmle.label | 2 | -| tst.yml:1:1:14:23 | [YAMLSequence] - "name ... Knopf" | tst.yml:14:3:14:23 | [YAMLScalar] !includ ... nal.yml | semmle.order | 2 | -| tst.yml:1:3:7:0 | [YAMLMapping] "name": "Jim Knopf" | file://:0:0:0:0 | (Mapping 0) name: | semmle.label | 0 | -| tst.yml:1:3:7:0 | [YAMLMapping] "name": "Jim Knopf" | file://:0:0:0:0 | (Mapping 0) name: | semmle.order | 0 | -| tst.yml:1:3:7:0 | [YAMLMapping] "name": "Jim Knopf" | file://:0:0:0:0 | (Mapping 1) address: | semmle.label | 1 | -| tst.yml:1:3:7:0 | [YAMLMapping] "name": "Jim Knopf" | file://:0:0:0:0 | (Mapping 1) address: | semmle.order | 1 | -| tst.yml:2:12:6:3 | [YAMLMapping] { | file://:0:0:0:0 | (Mapping 0) street: | semmle.label | 0 | -| tst.yml:2:12:6:3 | [YAMLMapping] { | file://:0:0:0:0 | (Mapping 0) street: | semmle.order | 0 | -| tst.yml:2:12:6:3 | [YAMLMapping] { | file://:0:0:0:0 | (Mapping 1) number: | semmle.label | 1 | -| tst.yml:2:12:6:3 | [YAMLMapping] { | file://:0:0:0:0 | (Mapping 1) number: | semmle.order | 1 | -| tst.yml:2:12:6:3 | [YAMLMapping] { | file://:0:0:0:0 | (Mapping 2) country: | semmle.label | 2 | -| tst.yml:2:12:6:3 | [YAMLMapping] { | file://:0:0:0:0 | (Mapping 2) country: | semmle.order | 2 | -| tst.yml:7:3:14:0 | [YAMLMapping] name: Frau Mahlzahn | file://:0:0:0:0 | (Mapping 0) name: | semmle.label | 0 | -| tst.yml:7:3:14:0 | [YAMLMapping] name: Frau Mahlzahn | file://:0:0:0:0 | (Mapping 0) name: | semmle.order | 0 | -| tst.yml:7:3:14:0 | [YAMLMapping] name: Frau Mahlzahn | file://:0:0:0:0 | (Mapping 1) address: | semmle.label | 1 | -| tst.yml:7:3:14:0 | [YAMLMapping] name: Frau Mahlzahn | file://:0:0:0:0 | (Mapping 1) address: | semmle.order | 1 | -| tst.yml:9:5:14:0 | [YAMLMapping] street: \| | file://:0:0:0:0 | (Mapping 0) street: | semmle.label | 0 | -| tst.yml:9:5:14:0 | [YAMLMapping] street: \| | file://:0:0:0:0 | (Mapping 0) street: | semmle.order | 0 | -| tst.yml:9:5:14:0 | [YAMLMapping] street: \| | file://:0:0:0:0 | (Mapping 1) number: | semmle.label | 1 | -| tst.yml:9:5:14:0 | [YAMLMapping] street: \| | file://:0:0:0:0 | (Mapping 1) number: | semmle.order | 1 | -| tst.yml:9:5:14:0 | [YAMLMapping] street: \| | file://:0:0:0:0 | (Mapping 2) country: | semmle.label | 2 | -| tst.yml:9:5:14:0 | [YAMLMapping] street: \| | file://:0:0:0:0 | (Mapping 2) country: | semmle.order | 2 | +| file://:0:0:0:0 | (Mapping 0) name: | tst.yml:1:3:1:8 | [YamlScalar] "name" | semmle.label | 0 | +| file://:0:0:0:0 | (Mapping 0) name: | tst.yml:1:3:1:8 | [YamlScalar] "name" | semmle.order | 0 | +| file://:0:0:0:0 | (Mapping 0) name: | tst.yml:1:11:1:21 | [YamlScalar] "Jim Knopf" | semmle.label | 1 | +| file://:0:0:0:0 | (Mapping 0) name: | tst.yml:1:11:1:21 | [YamlScalar] "Jim Knopf" | semmle.order | 1 | +| file://:0:0:0:0 | (Mapping 0) name: | tst.yml:7:3:7:6 | [YamlScalar] name | semmle.label | 0 | +| file://:0:0:0:0 | (Mapping 0) name: | tst.yml:7:3:7:6 | [YamlScalar] name | semmle.order | 0 | +| file://:0:0:0:0 | (Mapping 0) name: | tst.yml:7:9:7:21 | [YamlScalar] Frau Mahlzahn | semmle.label | 1 | +| file://:0:0:0:0 | (Mapping 0) name: | tst.yml:7:9:7:21 | [YamlScalar] Frau Mahlzahn | semmle.order | 1 | +| file://:0:0:0:0 | (Mapping 0) street: | tst.yml:3:5:3:12 | [YamlScalar] "street" | semmle.label | 0 | +| file://:0:0:0:0 | (Mapping 0) street: | tst.yml:3:5:3:12 | [YamlScalar] "street" | semmle.order | 0 | +| file://:0:0:0:0 | (Mapping 0) street: | tst.yml:3:14:3:13 | [YamlScalar] | semmle.label | 1 | +| file://:0:0:0:0 | (Mapping 0) street: | tst.yml:3:14:3:13 | [YamlScalar] | semmle.order | 1 | +| file://:0:0:0:0 | (Mapping 0) street: | tst.yml:9:5:9:10 | [YamlScalar] street | semmle.label | 0 | +| file://:0:0:0:0 | (Mapping 0) street: | tst.yml:9:5:9:10 | [YamlScalar] street | semmle.order | 0 | +| file://:0:0:0:0 | (Mapping 0) street: | tst.yml:9:13:11:0 | [YamlScalar] \| | semmle.label | 1 | +| file://:0:0:0:0 | (Mapping 0) street: | tst.yml:9:13:11:0 | [YamlScalar] \| | semmle.order | 1 | +| file://:0:0:0:0 | (Mapping 0) x: | merge.yaml:1:8:1:8 | [YamlScalar] x | semmle.label | 0 | +| file://:0:0:0:0 | (Mapping 0) x: | merge.yaml:1:8:1:8 | [YamlScalar] x | semmle.order | 0 | +| file://:0:0:0:0 | (Mapping 0) x: | merge.yaml:1:11:1:12 | [YamlScalar] 23 | semmle.label | 1 | +| file://:0:0:0:0 | (Mapping 0) x: | merge.yaml:1:11:1:12 | [YamlScalar] 23 | semmle.order | 1 | +| file://:0:0:0:0 | (Mapping 0) x: | merge.yaml:2:3:2:3 | [YamlScalar] x | semmle.label | 0 | +| file://:0:0:0:0 | (Mapping 0) x: | merge.yaml:2:3:2:3 | [YamlScalar] x | semmle.order | 0 | +| file://:0:0:0:0 | (Mapping 0) x: | merge.yaml:2:6:2:7 | [YamlScalar] 56 | semmle.label | 1 | +| file://:0:0:0:0 | (Mapping 0) x: | merge.yaml:2:6:2:7 | [YamlScalar] 56 | semmle.order | 1 | +| file://:0:0:0:0 | (Mapping 1) <<: | merge.yaml:3:3:3:4 | [YamlScalar] << | semmle.label | 0 | +| file://:0:0:0:0 | (Mapping 1) <<: | merge.yaml:3:3:3:4 | [YamlScalar] << | semmle.order | 0 | +| file://:0:0:0:0 | (Mapping 1) <<: | merge.yaml:3:7:3:8 | [YamlAliasNode] *A | semmle.label | 1 | +| file://:0:0:0:0 | (Mapping 1) <<: | merge.yaml:3:7:3:8 | [YamlAliasNode] *A | semmle.order | 1 | +| file://:0:0:0:0 | (Mapping 1) address: | tst.yml:2:3:2:9 | [YamlScalar] address | semmle.label | 0 | +| file://:0:0:0:0 | (Mapping 1) address: | tst.yml:2:3:2:9 | [YamlScalar] address | semmle.order | 0 | +| file://:0:0:0:0 | (Mapping 1) address: | tst.yml:2:12:6:3 | [YamlMapping] { | semmle.label | 1 | +| file://:0:0:0:0 | (Mapping 1) address: | tst.yml:2:12:6:3 | [YamlMapping] { | semmle.order | 1 | +| file://:0:0:0:0 | (Mapping 1) address: | tst.yml:8:3:8:9 | [YamlScalar] address | semmle.label | 0 | +| file://:0:0:0:0 | (Mapping 1) address: | tst.yml:8:3:8:9 | [YamlScalar] address | semmle.order | 0 | +| file://:0:0:0:0 | (Mapping 1) address: | tst.yml:9:5:14:0 | [YamlMapping] street: \| | semmle.label | 1 | +| file://:0:0:0:0 | (Mapping 1) address: | tst.yml:9:5:14:0 | [YamlMapping] street: \| | semmle.order | 1 | +| file://:0:0:0:0 | (Mapping 1) number: | tst.yml:4:5:4:12 | [YamlScalar] "number" | semmle.label | 0 | +| file://:0:0:0:0 | (Mapping 1) number: | tst.yml:4:5:4:12 | [YamlScalar] "number" | semmle.order | 0 | +| file://:0:0:0:0 | (Mapping 1) number: | tst.yml:4:15:4:16 | [YamlScalar] -1 | semmle.label | 1 | +| file://:0:0:0:0 | (Mapping 1) number: | tst.yml:4:15:4:16 | [YamlScalar] -1 | semmle.order | 1 | +| file://:0:0:0:0 | (Mapping 1) number: | tst.yml:11:5:11:10 | [YamlScalar] number | semmle.label | 0 | +| file://:0:0:0:0 | (Mapping 1) number: | tst.yml:11:5:11:10 | [YamlScalar] number | semmle.order | 0 | +| file://:0:0:0:0 | (Mapping 1) number: | tst.yml:11:13:11:15 | [YamlScalar] 133 | semmle.label | 1 | +| file://:0:0:0:0 | (Mapping 1) number: | tst.yml:11:13:11:15 | [YamlScalar] 133 | semmle.order | 1 | +| file://:0:0:0:0 | (Mapping 1) y: | merge.yaml:1:15:1:15 | [YamlScalar] y | semmle.label | 0 | +| file://:0:0:0:0 | (Mapping 1) y: | merge.yaml:1:15:1:15 | [YamlScalar] y | semmle.order | 0 | +| file://:0:0:0:0 | (Mapping 1) y: | merge.yaml:1:18:1:19 | [YamlScalar] 42 | semmle.label | 1 | +| file://:0:0:0:0 | (Mapping 1) y: | merge.yaml:1:18:1:19 | [YamlScalar] 42 | semmle.order | 1 | +| file://:0:0:0:0 | (Mapping 2) country: | tst.yml:5:5:5:13 | [YamlScalar] "country" | semmle.label | 0 | +| file://:0:0:0:0 | (Mapping 2) country: | tst.yml:5:5:5:13 | [YamlScalar] "country" | semmle.order | 0 | +| file://:0:0:0:0 | (Mapping 2) country: | tst.yml:5:16:5:27 | [YamlScalar] "Lummerland" | semmle.label | 1 | +| file://:0:0:0:0 | (Mapping 2) country: | tst.yml:5:16:5:27 | [YamlScalar] "Lummerland" | semmle.order | 1 | +| file://:0:0:0:0 | (Mapping 2) country: | tst.yml:12:5:12:11 | [YamlScalar] country | semmle.label | 0 | +| file://:0:0:0:0 | (Mapping 2) country: | tst.yml:12:5:12:11 | [YamlScalar] country | semmle.order | 0 | +| file://:0:0:0:0 | (Mapping 2) country: | tst.yml:12:14:13:18 | [YamlScalar] < | semmle.label | 1 | +| file://:0:0:0:0 | (Mapping 2) country: | tst.yml:12:14:13:18 | [YamlScalar] < | semmle.order | 1 | +| merge.yaml:1:1:3:8 | [YamlSequence] - &A { ... y: 42 } | merge.yaml:1:3:1:21 | [YamlMapping] &A { x: 23, y: 42 } | semmle.label | 0 | +| merge.yaml:1:1:3:8 | [YamlSequence] - &A { ... y: 42 } | merge.yaml:1:3:1:21 | [YamlMapping] &A { x: 23, y: 42 } | semmle.order | 0 | +| merge.yaml:1:1:3:8 | [YamlSequence] - &A { ... y: 42 } | merge.yaml:2:3:3:8 | [YamlMapping] x: 56 | semmle.label | 1 | +| merge.yaml:1:1:3:8 | [YamlSequence] - &A { ... y: 42 } | merge.yaml:2:3:3:8 | [YamlMapping] x: 56 | semmle.order | 1 | +| merge.yaml:1:3:1:21 | [YamlMapping] &A { x: 23, y: 42 } | file://:0:0:0:0 | (Mapping 0) x: | semmle.label | 0 | +| merge.yaml:1:3:1:21 | [YamlMapping] &A { x: 23, y: 42 } | file://:0:0:0:0 | (Mapping 0) x: | semmle.order | 0 | +| merge.yaml:1:3:1:21 | [YamlMapping] &A { x: 23, y: 42 } | file://:0:0:0:0 | (Mapping 1) y: | semmle.label | 1 | +| merge.yaml:1:3:1:21 | [YamlMapping] &A { x: 23, y: 42 } | file://:0:0:0:0 | (Mapping 1) y: | semmle.order | 1 | +| merge.yaml:2:3:3:8 | [YamlMapping] x: 56 | file://:0:0:0:0 | (Mapping 0) x: | semmle.label | 0 | +| merge.yaml:2:3:3:8 | [YamlMapping] x: 56 | file://:0:0:0:0 | (Mapping 0) x: | semmle.order | 0 | +| merge.yaml:2:3:3:8 | [YamlMapping] x: 56 | file://:0:0:0:0 | (Mapping 1) <<: | semmle.label | 1 | +| merge.yaml:2:3:3:8 | [YamlMapping] x: 56 | file://:0:0:0:0 | (Mapping 1) <<: | semmle.order | 1 | +| tst.yml:1:1:14:23 | [YamlSequence] - "name ... Knopf" | tst.yml:1:3:7:0 | [YamlMapping] "name": "Jim Knopf" | semmle.label | 0 | +| tst.yml:1:1:14:23 | [YamlSequence] - "name ... Knopf" | tst.yml:1:3:7:0 | [YamlMapping] "name": "Jim Knopf" | semmle.order | 0 | +| tst.yml:1:1:14:23 | [YamlSequence] - "name ... Knopf" | tst.yml:7:3:14:0 | [YamlMapping] name: Frau Mahlzahn | semmle.label | 1 | +| tst.yml:1:1:14:23 | [YamlSequence] - "name ... Knopf" | tst.yml:7:3:14:0 | [YamlMapping] name: Frau Mahlzahn | semmle.order | 1 | +| tst.yml:1:1:14:23 | [YamlSequence] - "name ... Knopf" | tst.yml:14:3:14:23 | [YamlScalar] !includ ... nal.yml | semmle.label | 2 | +| tst.yml:1:1:14:23 | [YamlSequence] - "name ... Knopf" | tst.yml:14:3:14:23 | [YamlScalar] !includ ... nal.yml | semmle.order | 2 | +| tst.yml:1:3:7:0 | [YamlMapping] "name": "Jim Knopf" | file://:0:0:0:0 | (Mapping 0) name: | semmle.label | 0 | +| tst.yml:1:3:7:0 | [YamlMapping] "name": "Jim Knopf" | file://:0:0:0:0 | (Mapping 0) name: | semmle.order | 0 | +| tst.yml:1:3:7:0 | [YamlMapping] "name": "Jim Knopf" | file://:0:0:0:0 | (Mapping 1) address: | semmle.label | 1 | +| tst.yml:1:3:7:0 | [YamlMapping] "name": "Jim Knopf" | file://:0:0:0:0 | (Mapping 1) address: | semmle.order | 1 | +| tst.yml:2:12:6:3 | [YamlMapping] { | file://:0:0:0:0 | (Mapping 0) street: | semmle.label | 0 | +| tst.yml:2:12:6:3 | [YamlMapping] { | file://:0:0:0:0 | (Mapping 0) street: | semmle.order | 0 | +| tst.yml:2:12:6:3 | [YamlMapping] { | file://:0:0:0:0 | (Mapping 1) number: | semmle.label | 1 | +| tst.yml:2:12:6:3 | [YamlMapping] { | file://:0:0:0:0 | (Mapping 1) number: | semmle.order | 1 | +| tst.yml:2:12:6:3 | [YamlMapping] { | file://:0:0:0:0 | (Mapping 2) country: | semmle.label | 2 | +| tst.yml:2:12:6:3 | [YamlMapping] { | file://:0:0:0:0 | (Mapping 2) country: | semmle.order | 2 | +| tst.yml:7:3:14:0 | [YamlMapping] name: Frau Mahlzahn | file://:0:0:0:0 | (Mapping 0) name: | semmle.label | 0 | +| tst.yml:7:3:14:0 | [YamlMapping] name: Frau Mahlzahn | file://:0:0:0:0 | (Mapping 0) name: | semmle.order | 0 | +| tst.yml:7:3:14:0 | [YamlMapping] name: Frau Mahlzahn | file://:0:0:0:0 | (Mapping 1) address: | semmle.label | 1 | +| tst.yml:7:3:14:0 | [YamlMapping] name: Frau Mahlzahn | file://:0:0:0:0 | (Mapping 1) address: | semmle.order | 1 | +| tst.yml:9:5:14:0 | [YamlMapping] street: \| | file://:0:0:0:0 | (Mapping 0) street: | semmle.label | 0 | +| tst.yml:9:5:14:0 | [YamlMapping] street: \| | file://:0:0:0:0 | (Mapping 0) street: | semmle.order | 0 | +| tst.yml:9:5:14:0 | [YamlMapping] street: \| | file://:0:0:0:0 | (Mapping 1) number: | semmle.label | 1 | +| tst.yml:9:5:14:0 | [YamlMapping] street: \| | file://:0:0:0:0 | (Mapping 1) number: | semmle.order | 1 | +| tst.yml:9:5:14:0 | [YamlMapping] street: \| | file://:0:0:0:0 | (Mapping 2) country: | semmle.label | 2 | +| tst.yml:9:5:14:0 | [YamlMapping] street: \| | file://:0:0:0:0 | (Mapping 2) country: | semmle.order | 2 | graphProperties | semmle.graphKind | tree | diff --git a/python/ql/test/experimental/dataflow/coverage/NormalDataflowTest.expected b/python/ql/test/experimental/dataflow/coverage/NormalDataflowTest.expected index dd7fb1265269..3875da4e143c 100644 --- a/python/ql/test/experimental/dataflow/coverage/NormalDataflowTest.expected +++ b/python/ql/test/experimental/dataflow/coverage/NormalDataflowTest.expected @@ -1,2 +1,2 @@ -missingAnnotationOnSINK +missingAnnotationOnSink failures diff --git a/python/ql/test/experimental/dataflow/fieldflow/NormalDataflowTest.expected b/python/ql/test/experimental/dataflow/fieldflow/NormalDataflowTest.expected index dd7fb1265269..3875da4e143c 100644 --- a/python/ql/test/experimental/dataflow/fieldflow/NormalDataflowTest.expected +++ b/python/ql/test/experimental/dataflow/fieldflow/NormalDataflowTest.expected @@ -1,2 +1,2 @@ -missingAnnotationOnSINK +missingAnnotationOnSink failures diff --git a/python/ql/test/experimental/dataflow/match/NormalDataflowTest.expected b/python/ql/test/experimental/dataflow/match/NormalDataflowTest.expected index dd7fb1265269..3875da4e143c 100644 --- a/python/ql/test/experimental/dataflow/match/NormalDataflowTest.expected +++ b/python/ql/test/experimental/dataflow/match/NormalDataflowTest.expected @@ -1,2 +1,2 @@ -missingAnnotationOnSINK +missingAnnotationOnSink failures diff --git a/python/ql/test/experimental/dataflow/strange-pointsto-interaction-investigation/README.md b/python/ql/test/experimental/dataflow/strange-pointsto-interaction-investigation/README.md index 7f098028457e..59e9087ee493 100644 --- a/python/ql/test/experimental/dataflow/strange-pointsto-interaction-investigation/README.md +++ b/python/ql/test/experimental/dataflow/strange-pointsto-interaction-investigation/README.md @@ -39,7 +39,7 @@ diff '--color=auto' -u -r test-1-normal/NormalDataflowTest.expected test-5-max-i --- test-1-normal/NormalDataflowTest.expected 2022-02-27 10:33:00.603882599 +0100 +++ test-5-max-import-depth-3/NormalDataflowTest.expected 2022-02-28 10:10:08.930743800 +0100 @@ -1,2 +1,3 @@ - missingAnnotationOnSINK + missingAnnotationOnSink failures +| ../src/urandom_problem.py:43:6:43:8 | ControlFlowNode for foo | Fixed missing result:flow="SOURCE, l:-15 -> foo" | diff '--color=auto' -u -r test-1-normal/options test-5-max-import-depth-3/options @@ -88,7 +88,7 @@ diff '--color=auto' -u -r test-4-max-import-depth-100/NormalDataflowTest.expecte --- test-4-max-import-depth-100/NormalDataflowTest.expected 2022-02-28 10:10:02.206608379 +0100 +++ test-6-max-import-depth-2/NormalDataflowTest.expected 2022-02-28 10:10:13.882716665 +0100 @@ -1,3 +1,5 @@ - missingAnnotationOnSINK + missingAnnotationOnSink +| ../src/isfile_no_problem.py:43:6:43:8 | ../src/isfile_no_problem.py:43 | ERROR, you should add `# $ MISSING: flow` annotation | foo | failures +| ../src/isfile_no_problem.py:43:11:43:41 | Comment # $ flow="SOURCE, l:-15 -> foo" | Missing result:flow="SOURCE, l:-15 -> foo" | diff --git a/python/ql/test/experimental/dataflow/strange-pointsto-interaction-investigation/test-1-normal/NormalDataflowTest.expected b/python/ql/test/experimental/dataflow/strange-pointsto-interaction-investigation/test-1-normal/NormalDataflowTest.expected index dd7fb1265269..3875da4e143c 100644 --- a/python/ql/test/experimental/dataflow/strange-pointsto-interaction-investigation/test-1-normal/NormalDataflowTest.expected +++ b/python/ql/test/experimental/dataflow/strange-pointsto-interaction-investigation/test-1-normal/NormalDataflowTest.expected @@ -1,2 +1,2 @@ -missingAnnotationOnSINK +missingAnnotationOnSink failures diff --git a/python/ql/test/experimental/dataflow/strange-pointsto-interaction-investigation/test-2-without-splitting/NormalDataflowTest.expected b/python/ql/test/experimental/dataflow/strange-pointsto-interaction-investigation/test-2-without-splitting/NormalDataflowTest.expected index dc83fab39078..ceeb0ef30e0a 100644 --- a/python/ql/test/experimental/dataflow/strange-pointsto-interaction-investigation/test-2-without-splitting/NormalDataflowTest.expected +++ b/python/ql/test/experimental/dataflow/strange-pointsto-interaction-investigation/test-2-without-splitting/NormalDataflowTest.expected @@ -1,3 +1,3 @@ -missingAnnotationOnSINK +missingAnnotationOnSink failures | ../src/urandom_problem.py:43:6:43:8 | ControlFlowNode for foo | Fixed missing result:flow="SOURCE, l:-15 -> foo" | diff --git a/python/ql/test/experimental/dataflow/strange-pointsto-interaction-investigation/test-3-max-import-depth-0/NormalDataflowTest.expected b/python/ql/test/experimental/dataflow/strange-pointsto-interaction-investigation/test-3-max-import-depth-0/NormalDataflowTest.expected index dc83fab39078..ceeb0ef30e0a 100644 --- a/python/ql/test/experimental/dataflow/strange-pointsto-interaction-investigation/test-3-max-import-depth-0/NormalDataflowTest.expected +++ b/python/ql/test/experimental/dataflow/strange-pointsto-interaction-investigation/test-3-max-import-depth-0/NormalDataflowTest.expected @@ -1,3 +1,3 @@ -missingAnnotationOnSINK +missingAnnotationOnSink failures | ../src/urandom_problem.py:43:6:43:8 | ControlFlowNode for foo | Fixed missing result:flow="SOURCE, l:-15 -> foo" | diff --git a/python/ql/test/experimental/dataflow/strange-pointsto-interaction-investigation/test-4-max-import-depth-100/NormalDataflowTest.expected b/python/ql/test/experimental/dataflow/strange-pointsto-interaction-investigation/test-4-max-import-depth-100/NormalDataflowTest.expected index dc83fab39078..ceeb0ef30e0a 100644 --- a/python/ql/test/experimental/dataflow/strange-pointsto-interaction-investigation/test-4-max-import-depth-100/NormalDataflowTest.expected +++ b/python/ql/test/experimental/dataflow/strange-pointsto-interaction-investigation/test-4-max-import-depth-100/NormalDataflowTest.expected @@ -1,3 +1,3 @@ -missingAnnotationOnSINK +missingAnnotationOnSink failures | ../src/urandom_problem.py:43:6:43:8 | ControlFlowNode for foo | Fixed missing result:flow="SOURCE, l:-15 -> foo" | diff --git a/python/ql/test/experimental/dataflow/strange-pointsto-interaction-investigation/test-5-max-import-depth-3/NormalDataflowTest.expected b/python/ql/test/experimental/dataflow/strange-pointsto-interaction-investigation/test-5-max-import-depth-3/NormalDataflowTest.expected index dc83fab39078..ceeb0ef30e0a 100644 --- a/python/ql/test/experimental/dataflow/strange-pointsto-interaction-investigation/test-5-max-import-depth-3/NormalDataflowTest.expected +++ b/python/ql/test/experimental/dataflow/strange-pointsto-interaction-investigation/test-5-max-import-depth-3/NormalDataflowTest.expected @@ -1,3 +1,3 @@ -missingAnnotationOnSINK +missingAnnotationOnSink failures | ../src/urandom_problem.py:43:6:43:8 | ControlFlowNode for foo | Fixed missing result:flow="SOURCE, l:-15 -> foo" | diff --git a/python/ql/test/experimental/dataflow/strange-pointsto-interaction-investigation/test-6-max-import-depth-2/NormalDataflowTest.expected b/python/ql/test/experimental/dataflow/strange-pointsto-interaction-investigation/test-6-max-import-depth-2/NormalDataflowTest.expected index aa4bfeb5ae42..7b5784017f32 100644 --- a/python/ql/test/experimental/dataflow/strange-pointsto-interaction-investigation/test-6-max-import-depth-2/NormalDataflowTest.expected +++ b/python/ql/test/experimental/dataflow/strange-pointsto-interaction-investigation/test-6-max-import-depth-2/NormalDataflowTest.expected @@ -1,4 +1,4 @@ -missingAnnotationOnSINK +missingAnnotationOnSink | ../src/isfile_no_problem.py:43:6:43:8 | ../src/isfile_no_problem.py:43 | ERROR, you should add `# $ MISSING: flow` annotation | foo | failures | ../src/isfile_no_problem.py:43:11:43:41 | Comment # $ flow="SOURCE, l:-15 -> foo" | Missing result:flow="SOURCE, l:-15 -> foo" | diff --git a/python/ql/test/library-tests/frameworks/django-orm/NormalDataflowTest.expected b/python/ql/test/library-tests/frameworks/django-orm/NormalDataflowTest.expected index dd7fb1265269..3875da4e143c 100644 --- a/python/ql/test/library-tests/frameworks/django-orm/NormalDataflowTest.expected +++ b/python/ql/test/library-tests/frameworks/django-orm/NormalDataflowTest.expected @@ -1,2 +1,2 @@ -missingAnnotationOnSINK +missingAnnotationOnSink failures