GeezerVison is showing github.com — JavaScript: Autoformat. · github/codeql@ca45fb5
File treeExpand file treeCollapse file tree Open diff view settings examples/queries/dataflow/DecodingAfterSanitization query-tests/Security/CWE-022/TaintedPath
480c0c6f68fac1441d25defa4562f61a5f968d11 64ea4d71964ad03f6604cf49f4869163dacbab66
Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: javascript/ql/examples/queries/dataflow/DecodingAfterSanitization/DecodingAfterSanitizationGeneralized.ql -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -17,7 +17,6 @@ import DataFlow::PathGraph | 17 | 17 | */ | 18 | 18 | class DecodingCall extends CallNode { | 19 | 19 | string kind; | 20 | | - | 21 | 20 | Node input; | 22 | 21 |
| 23 | 22 | DecodingCall() { | |
Collapse file Copy file name to clipboardExpand all lines: javascript/ql/src/AlertSuppression.ql -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -12,7 +12,6 @@ import javascript | 12 | 12 | */ | 13 | 13 | class SuppressionComment extends Locatable { | 14 | 14 | string text; | 15 | | - | 16 | 15 | string annotation; | 17 | 16 |
| 18 | 17 | SuppressionComment() { | |
Collapse file Copy file name to clipboardExpand all lines: javascript/ql/src/AngularJS/InsecureUrlWhitelist.ql -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -32,7 +32,6 @@ predicate isResourceUrlWhitelist( | 32 | 32 | */ | 33 | 33 | class ResourceUrlWhitelistEntry extends Expr { | 34 | 34 | DataFlow::MethodCallNode setupCall; | 35 | | - | 36 | 35 | string pattern; | 37 | 36 |
| 38 | 37 | ResourceUrlWhitelistEntry() { | |
Collapse file Copy file name to clipboardExpand all lines: javascript/ql/src/Declarations/DeadStoreOfLocal.ql +3-4Lines changed: 3 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 58 | 58 | ( | 59 | 59 | // To avoid confusion about the meaning of "definition" and "declaration" we avoid | 60 | 60 | // the term "definition" when the alert location is a variable declaration. | 61 | | - if dead instanceof VariableDeclarator then | 62 | | - msg = "The initial value of " + v.getName() + " is unused, since it is always overwritten." | 63 | | - else | 64 | | - msg = "This definition of " + v.getName() + " is useless, since its value is never read." | | 61 | + if dead instanceof VariableDeclarator | | 62 | + then msg = "The initial value of " + v.getName() + " is unused, since it is always overwritten." | | 63 | + else msg = "This definition of " + v.getName() + " is useless, since its value is never read." | 65 | 64 | ) | 66 | 65 | select dead, msg |
Collapse file Copy file name to clipboardExpand all lines: javascript/ql/src/Declarations/DeadStoreOfProperty.ql +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -160,7 +160,8 @@ where | 160 | 160 | ) and | 161 | 161 | // exclude results from non-value definitions from `Object.defineProperty` | 162 | 162 | ( | 163 | | - assign1 instanceof CallToObjectDefineProperty implies | | 163 | + assign1 instanceof CallToObjectDefineProperty | | 164 | + implies | 164 | 165 | assign1.(CallToObjectDefineProperty).hasPropertyAttributeWrite("value", _) | 165 | 166 | ) | 166 | 167 | select assign1.getWriteNode(), | |
Collapse file Copy file name to clipboardExpand all lines: javascript/ql/src/Declarations/UnusedProperty.ql +5-4Lines changed: 5 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -34,15 +34,16 @@ predicate hasUnknownPropertyRead(LocalObject obj) { | 34 | 34 | * Holds if `obj` flows to an expression that must have a specific type. | 35 | 35 | */ | 36 | 36 | predicate flowsToTypeRestrictedExpression(LocalObject obj) { | 37 | | - exists (Expr restricted, TypeExpr type | | | 37 | + exists(Expr restricted, TypeExpr type | | 38 | 38 | obj.flowsToExpr(restricted) and | 39 | | - not type.isAny() | | 40 | | - exists (TypeAssertion assertion | | | 39 | + not type.isAny() | | 40 | + | | | 41 | + exists(TypeAssertion assertion | | 41 | 42 | type = assertion.getTypeAnnotation() and | 42 | 43 | restricted = assertion.getExpression() | 43 | 44 | ) | 44 | 45 | or | 45 | | - exists (BindingPattern v | | | 46 | + exists(BindingPattern v | | 46 | 47 | type = v.getTypeAnnotation() and | 47 | 48 | restricted = v.getAVariable().getAnAssignedExpr() | 48 | 49 | ) | |
Collapse file Copy file name to clipboardExpand all lines: javascript/ql/src/Expressions/ExprHasNoEffect.ql +7-7Lines changed: 7 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -36,16 +36,16 @@ predicate isDeclaration(Expr e) { | 36 | 36 | */ | 37 | 37 | predicate isGetterProperty(string name) { | 38 | 38 | // there is a call of the form `Object.defineProperty(..., name, descriptor)` ... | 39 | | - exists(CallToObjectDefineProperty defProp | | 40 | | - name = defProp.getPropertyName() | | | 39 | + exists(CallToObjectDefineProperty defProp | name = defProp.getPropertyName() | | 41 | 40 | // ... where `descriptor` defines a getter | 42 | | - defProp.hasPropertyAttributeWrite("get", _) or | | 41 | + defProp.hasPropertyAttributeWrite("get", _) | | 42 | + or | 43 | 43 | // ... where `descriptor` may define a getter | 44 | | - exists (DataFlow::SourceNode descriptor | | 45 | | - descriptor.flowsTo(defProp.getPropertyDescriptor()) | | 46 | | - descriptor.isIncomplete(_) or | | 44 | + exists(DataFlow::SourceNode descriptor | descriptor.flowsTo(defProp.getPropertyDescriptor()) | | | 45 | + descriptor.isIncomplete(_) | | 46 | + or | 47 | 47 | // minimal escape analysis for the descriptor | 48 | | - exists (DataFlow::InvokeNode invk | | | 48 | + exists(DataFlow::InvokeNode invk | | 49 | 49 | not invk = defProp and | 50 | 50 | descriptor.flowsTo(invk.getAnArgument()) | 51 | 51 | ) | |
Collapse file Copy file name to clipboardExpand all lines: javascript/ql/src/Expressions/UnboundEventHandlerReceiver.ql +3-2Lines changed: 3 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -28,9 +28,10 @@ private predicate isBoundInMethod(MethodDeclaration method) { | 28 | 28 | ) | 29 | 29 | or | 30 | 30 | // require("auto-bind")(this) | 31 | | - exists (string mod | | | 31 | + exists(string mod | | 32 | 32 | mod = "auto-bind" or | 33 | | - mod = "react-autobind" | | | 33 | + mod = "react-autobind" | | 34 | + | | 34 | 35 | thiz.flowsTo(DataFlow::moduleImport(mod).getACall().getArgument(0)) | 35 | 36 | ) | 36 | 37 | or | |
Collapse file Copy file name to clipboardExpand all lines: javascript/ql/src/LanguageFeatures/TemplateSyntaxInStringLiteral.ql -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -18,7 +18,6 @@ class CandidateTopLevel extends TopLevel { | 18 | 18 | /** A string literal in a toplevel that contains at least one template literal. */ | 19 | 19 | class CandidateStringLiteral extends StringLiteral { | 20 | 20 | CandidateTopLevel tl; | 21 | | - | 22 | 21 | string v; | 23 | 22 |
| 24 | 23 | CandidateStringLiteral() { | |
Collapse file Copy file name to clipboardExpand all lines: javascript/ql/src/Performance/ReDoS.ql -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -395,7 +395,6 @@ newtype TStatePair = | 395 | 395 |
| 396 | 396 | class StatePair extends TStatePair { | 397 | 397 | State q1; | 398 | | - | 399 | 398 | State q2; | 400 | 399 |
| 401 | 400 | StatePair() { this = MkStatePair(q1, q2) } | |
|