Skip to content

Commit 7df397f

Browse files
authored
Merge pull request #486 from xiemaisi/js/lower-severities
Approved by asger-semmle
2 parents f5e25e6 + 1b59a28 commit 7df397f

File tree

6 files changed

+18
-13
lines changed

6 files changed

+18
-13
lines changed

change-notes/1.19/analysis-javascript.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
* Modelling of taint flow through array operations has been improved. This may give additional results for the security queries.
66

7-
* The taint tracking library now recognizes additional sanitization patterns. This may give fewer false-positive results for the security queries.
8-
97
* Support for AMD modules has been improved. This may give additional results for the security queries as well as any queries that use type inference on code bases that use such modules.
108

119
* Support for popular libraries has been improved. Consequently, queries may produce more results on code bases that use the following features:
1210
- file system access, for example through [fs-extra](https://github.com/jprichardson/node-fs-extra) or [globby](https://www.npmjs.com/package/globby)
1311
- outbound network access, for example through the [fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)
1412
- the [lodash](https://lodash.com), [underscore](https://underscorejs.org/), [async](https://www.npmjs.com/package/async) and [async-es](https://www.npmjs.com/package/async-es) libraries
1513

14+
* The taint tracking library now recognizes additional sanitization patterns. This may give fewer false-positive results for the security queries.
15+
1616
* Type inference for function calls has been improved. This may give additional results for queries that rely on type inference.
1717

1818
* Where applicable, path explanations have been added to the security queries.
@@ -35,12 +35,19 @@
3535

3636
| **Query** | **Expected impact** | **Change** |
3737
|--------------------------------|----------------------------|----------------------------------------------|
38+
| Ambiguous HTML id attribute | Lower severity | The severity of this rule has been revised to "warning". |
3839
| Client side cross-site scripting | More results | This rule now also flags HTML injection in the body of an email. |
40+
| Client-side URL redirect | Fewer false-positive results | This rule now recognizes safe redirects in more cases. |
41+
| Conflicting HTML element attributes | Lower severity | The severity of this rule has been revised to "warning". |
42+
| Duplicate 'if' condition | Lower severity | The severity of this rule has been revised to "warning". |
43+
| Duplicate switch case | Lower severity | The severity of this rule has been revised to "warning". |
3944
| Information exposure through a stack trace | More results | This rule now also flags cases where the entire exception object (including the stack trace) may be exposed. |
4045
| Missing CSRF middleware | Fewer false-positive results | This rule now recognizes additional CSRF protection middlewares. |
46+
| Missing variable declaration | Lower severity | The severity of this rule has been revised to "warning". |
4147
| Regular expression injection | Fewer false-positive results | This rule now identifies calls to `String.prototype.search` with more precision. |
4248
| Remote property injection | Fewer results | The precision of this rule has been revised to "medium". Results are no longer shown on LGTM by default. |
4349
| Self assignment | Fewer false-positive results | This rule now ignores self-assignments preceded by a JSDoc comment with a `@type` tag. |
50+
| Server-side URL redirect | Fewer false-positive results | This rule now recognizes safe redirects in more cases. |
4451
| Server-side URL redirect | More results | This rule now recognizes redirection calls in more cases. |
4552
| Unbound event handler receiver | Fewer false-positive results | This rule now recognizes additional ways class methods can be bound. |
4653
| Uncontrolled data used in remote request | More results | This rule now recognizes additional kinds of requests. |
@@ -49,15 +56,13 @@
4956
| Unused variable, import, function or class | Fewer results | This rule now flags import statements with multiple unused imports once. |
5057
| Useless assignment to local variable | Fewer false-positive results | This rule now recognizes additional ways default values can be set. |
5158
| Whitespace contradicts operator precedence | Fewer false-positive results | This rule no longer flags operators with asymmetric whitespace. |
52-
| Client-side URL redirect | Fewer false-positive results | This rule now recognizes safe redirects in more cases. |
53-
| Server-side URL redirect | Fewer false-positive results | This rule now recognizes safe redirects in more cases. |
5459

5560
## Changes to QL libraries
5661

57-
* The flow configuration framework now supports distinguishing and tracking different kinds of taint, specified by an extensible class `FlowLabel` (which can also be referred to by its alias `TaintKind`).
58-
59-
* The `DataFlow::ThisNode` class now corresponds to the implicit receiver parameter of a function, as opposed to an indivdual `this` expression. This means `getALocalSource` now maps all `this` expressions within a given function to the same source. The data-flow node associated with a `ThisExpr` can no longer be cast to `DataFlow::SourceNode` or `DataFlow::ThisNode` - it is recomended to use `getALocalSource` before casting or instead of casting.
62+
* A `DataFlow::ParameterNode` instance now exists for all function parameters. Previously, unused parameters did not have a corresponding dataflow node.
6063

6164
* `ReactComponent::getAThisAccess` has been renamed to `getAThisNode`. The old name is still usable but is deprecated. It no longer gets individual `this` expressions, but the `ThisNode` mentioned above.
6265

63-
* A `DataFlow::ParameterNode` instance now exists for all function parameters. Previously, unused parameters did not have a corresponding dataflow node.
66+
* The `DataFlow::ThisNode` class now corresponds to the implicit receiver parameter of a function, as opposed to an indivdual `this` expression. This means `getALocalSource` now maps all `this` expressions within a given function to the same source. The data-flow node associated with a `ThisExpr` can no longer be cast to `DataFlow::SourceNode` or `DataFlow::ThisNode` - it is recomended to use `getALocalSource` before casting or instead of casting.
67+
68+
* The flow configuration framework now supports distinguishing and tracking different kinds of taint, specified by an extensible class `FlowLabel` (which can also be referred to by its alias `TaintKind`).

javascript/ql/src/DOM/AmbiguousIdAttribute.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* same id attribute, it may be interpreted differently
55
* by different browsers.
66
* @kind problem
7-
* @problem.severity error
7+
* @problem.severity warning
88
* @id js/duplicate-html-id
99
* @tags maintainability
1010
* correctness

javascript/ql/src/DOM/ConflictingAttributes.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @description If an HTML element has two attributes with the same name
44
* but different values, its behavior may be browser-dependent.
55
* @kind problem
6-
* @problem.severity error
6+
* @problem.severity warning
77
* @id js/conflicting-html-attribute
88
* @tags maintainability
99
* correctness

javascript/ql/src/Declarations/MissingVarDecl.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @description If a variable is not declared as a local variable, it becomes a global variable
44
* by default, which may be unintentional and could lead to unexpected behavior.
55
* @kind problem
6-
* @problem.severity error
6+
* @problem.severity warning
77
* @id js/missing-variable-declaration
88
* @tags reliability
99
* maintainability

javascript/ql/src/Expressions/DuplicateCondition.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @description If two conditions in an 'if'-'else if' chain are identical, the
44
* second condition will never hold.
55
* @kind problem
6-
* @problem.severity error
6+
* @problem.severity warning
77
* @id js/duplicate-condition
88
* @tags maintainability
99
* correctness

javascript/ql/src/Expressions/DuplicateSwitchCase.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @description If two cases in a switch statement have the same label, the second case
44
* will never be executed.
55
* @kind problem
6-
* @problem.severity error
6+
* @problem.severity warning
77
* @id js/duplicate-switch-case
88
* @tags maintainability
99
* correctness

0 commit comments

Comments
 (0)